Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDESGETREQWRAPPR

SDESGETREQWRAPPR.m

Go to the documentation of this file.
  1. SDESGETREQWRAPPR ;ALB/BLB,MGD,JAS,LAB,TJB/BLB - VISTA SCHEDULING GET REQUEST RPCS ;JUL 19, 2023
  1. ;;5.3;Scheduling;**815,818,820,823,825,831,838,842,843,847,851,873**;Aug 13, 1993;Build 10
  1. ;;Per VHA Directive 6402, this routine should not be modified
  1. ;
  1. ;
  1. ; Return
  1. ;("Request",1,"ByPatientOrProvider")
  1. ;("Request",1,"ClinicIEN")
  1. ;("Request",1,"ClinicName")
  1. ;("Request",1,"ClinicSecondaryStopCodeAMIS")
  1. ;("Request",1,"ClinicStopCodeAMIS")
  1. ;("Request",1,"ClinicStopCodeIEN")
  1. ;("Request",1,"ClinicStopCodeName")
  1. ;("Request",1,"CommentMultiple")
  1. ;("Request",1,"ConsultAssociatedStopCodes",1,"StopCode")
  1. ;("Request",1,"ConsultCanEditPid")
  1. ;("Request",1,"ConsultClinicIndicatedDate")
  1. ;("Request",1,"ConsultCovidPriority")
  1. ;("Request",1,"ConsultDateReleasedFromCPRS")
  1. ;("Request",1,"ConsultProhibitedClinicFlag")
  1. ;("Request",1,"ConsultRequestType")
  1. ;("Request",1,"ConsultServiceRenderedAs")
  1. ;("Request",1,"ConsultToService")
  1. ;("Request",1,"ConsultUrgencyOrEarliestDate")
  1. ;("Request",1,"CPRSOrderID")=""
  1. ;("Request",1,"CPRSTimeSensitive")=""
  1. ;("Request",1,"CPRSPreRequisites",1)=""
  1. ;("Request",1,"CreateDate")
  1. ;("Request",1,"DateLinkedApptMade")
  1. ;("Request",1,"DateTimeEntered")
  1. ;("Request",1,"DispositionReason")
  1. ;("Request",1,"DispositionedBy")
  1. ;("Request",1,"DispositionedDate")
  1. ;("Request",1,"EASTrackingNumber")
  1. ;("Request",1,"EnrollmentPriorityGroup")
  1. ;("Request",1,"EnteredByIEN")
  1. ;("Request",1,"EnteredByName")
  1. ;("Request",1,"InstitutionIEN")
  1. ;("Request",1,"InstitutionName")
  1. ;("Request",1,"LinkedApptType")
  1. ;("Request",1,"LinkedApptClinic")
  1. ;("Request",1,"LinkedApptCreditStopCode")
  1. ;("Request",1,"LinkedApptEnteredBy")
  1. ;("Request",1,"LinkedApptInstitutionNumber")
  1. ;("Request",1,"LinkedApptStatus")
  1. ;("Request",1,"LinkedApptStopCode")
  1. ;("Request",1,"LinkedApptInstitutionName")
  1. ;("Request",1,"MRTC",1,"ChildRequestIEN")
  1. ;("Request",1,"MRTC",1,"LinkedAppointmentIEN")
  1. ;("Request",1,"MRTC",1,"PatientIndicatedDate")
  1. ;("Request",1,"MRTCDaysBetweenAppts")
  1. ;("Request",1,"MRTCHowManyNeeded")
  1. ;("Request",1,"MRTCNeeded")
  1. ;("Request",1,"MRTCTotal")
  1. ;("Request",1,"ParentRequest")
  1. ;("Request",1,"PatientComment",1,"Comment")
  1. ;("Request",1,"PatientContact",1,"Action")
  1. ;("Request",1,"PatientContact",1,"DateEntered")
  1. ;("Request",1,"PatientContact",1,"EnteredByIEN")
  1. ;("Request",1,"PatientContact",1,"EnteredByName")
  1. ;("Request",1,"PatientContact",1,"PatientPhone")
  1. ;("Request",1,"PatientIEN")
  1. ;("Request",1,"PatientIndicatedDate")
  1. ;("Request",1,"PatientName")
  1. ;("Request",1,"PatientStatus")
  1. ;("Request",1,"PIDChangeAllowed")
  1. ;("Request",1,"Priority")
  1. ;("Request",1,"ProviderIEN")
  1. ;("Request",1,"ProviderName")
  1. ;("Request",1,"ProviderSecID")
  1. ;("Request",1,"RecallAccessionNumber")
  1. ;("Request",1,"RecallAppointmentLength")
  1. ;("Request",1,"RecallAppointmentType")
  1. ;("Request",1,"RecallClinicStopCodeIEN")
  1. ;("Request",1,"RecallClinicStopCodeAMIS")
  1. ;("Request",1,"RecallClinicStopCodeName")
  1. ;("Request",1,"RecallClinicSecondaryStopCodeIEN")
  1. ;("Request",1,"RecallClinicSecondaryStopCodeAMIS")
  1. ;("Request",1,"RecallClinicSecondaryStopCodeName")
  1. ;("Request",1,"RecallComment")
  1. ;("Request",1,"RecallDateReminderSent")
  1. ;("Request",1,"RecallEnteredBySecID")
  1. ;("Request",1,"RecallFastingNonFasting")
  1. ;("Request",1,"RecallGAFScore")
  1. ;("Request",1,"RecallPatientSensitiveRecordAccessChecks")
  1. ;("Request",1,"RecallProviderIEN")
  1. ;("Request",1,"RecallProviderIndicatedDate")
  1. ;("Request",1,"RecallProviderName")
  1. ;("Request",1,"RecallProviderNewPersonIEN")
  1. ;("Request",1,"RecallProviderSecID")
  1. ;("Request",1,"RecallSecondPrint")
  1. ;("Request",1,"RecallSimilarPatientData")
  1. ;("Request",1,"RequestComments")
  1. ;("Request",1,"RequestIEN")
  1. ;("Request",1,"RequestSubType")
  1. ;("Request",1,"ScheduledDateOfAppt")
  1. ;("Request",1,"SdecContactDateOfLastLetterSent")
  1. ;("Request",1,"SdecContactNumberOfCalls")
  1. ;("Request",1,"SdecContactNumberOfContacts")
  1. ;("Request",1,"SdecContactNumberOfEmailContact")
  1. ;("Request",1,"SdecContactNumberOfLetters")
  1. ;("Request",1,"SdecContactNumberOfSecureMessage")
  1. ;("Request",1,"SdecContactNumberOfTextContact")
  1. ;("Request",1,"ServiceConnectedPriority")
  1. ;("Request",1,"Status")
  1. ;("Request",1,"Type")
  1. ;
  1. Q
  1. ;
  1. GETREQLISTBYDFN(JSONRETURN,DFN,EAS) ;
  1. ;
  1. N ISDFNVALID,ISEASVALID,RETURN,ERRORS,REQUESTIEN,REQUEST,CONSULTIEN,CPRSSTATUS,IFCROLE,RECALLIEN
  1. ;
  1. S ISDFNVALID=$$VALIDATEDFN(.ERRORS,$G(DFN))
  1. S ISEASVALID=$$VALIDATEEAS(.ERRORS,$G(EAS))
  1. I $D(ERRORS) S ERRORS("Request",1)="" M RETURN=ERRORS D BUILDJSON(.JSONRETURN,.RETURN) Q
  1. ;
  1. S REQUESTIEN=0
  1. F S REQUESTIEN=$O(^SDEC(409.85,"B",DFN,REQUESTIEN)) Q:'REQUESTIEN D
  1. .I $$GET1^DIQ(409.85,REQUESTIEN,23,"I")="C" Q
  1. .D GETREQUEST^SDESGETAPPTREQ(.REQUEST,REQUESTIEN)
  1. ;
  1. S RECALLIEN=0
  1. F S RECALLIEN=$O(^SD(403.5,"B",DFN,RECALLIEN)) Q:RECALLIEN="" D
  1. .S DFN=$$GET1^DIQ(403.5,RECALLIEN,.01,"I")
  1. .D GETRECALL^SDESGETRECALL(.REQUEST,RECALLIEN,DFN)
  1. ;
  1. S CONSULTIEN=0
  1. F S CONSULTIEN=$O(^GMR(123,"F",DFN,CONSULTIEN)) Q:'CONSULTIEN D
  1. .S CPRSSTATUS=$$GET1^DIQ(123,CONSULTIEN,8,"E"),IFCROLE=$$GET1^DIQ(123,CONSULTIEN,.125,"E")
  1. .I CPRSSTATUS'="PENDING",CPRSSTATUS'="ACTIVE" Q
  1. .I IFCROLE="PLACER" Q
  1. .D GETCONSULT^SDESGETCONSULTS(.REQUEST,CONSULTIEN)
  1. ;
  1. I '$D(REQUEST) S REQUEST("Request",1)=""
  1. M RETURN=REQUEST
  1. D BUILDJSON(.JSONRETURN,.RETURN)
  1. Q
  1. ;
  1. VALIDATEDFN(ERRORS,DFN) ;
  1. I DFN="" D ERRLOG^SDESJSON(.ERRORS,1) Q 0
  1. I DFN'="",'$D(^DPT(DFN,0)) D ERRLOG^SDESJSON(.ERRORS,2) Q 0
  1. Q 1
  1. ;
  1. VALIDATEEAS(ERRORS,EAS) ;
  1. I $L(EAS) S EAS=$$EASVALIDATE^SDESUTIL($G(EAS))
  1. I $P($G(EAS),U)=-1 D ERRLOG^SDESJSON(.ERRORS,142) Q 0
  1. Q 1
  1. ;
  1. BUILDJSON(JSONRETURN,RETURN) ;
  1. D ENCODE^XLFJSON("RETURN","JSONRETURN","ERR")
  1. Q
  1. ;
  1. APPTREQUEST(REQUEST,NUM) ;
  1. ;
  1. S REQUEST("Request",NUM,"ChildRequestSequenceNumber")=""
  1. S REQUEST("Request",NUM,"InstitutionIEN")=""
  1. S REQUEST("Request",NUM,"InstitutionName")=""
  1. S REQUEST("Request",NUM,"RequestType")=""
  1. S REQUEST("Request",NUM,"ClinicStopCodeIEN")=""
  1. S REQUEST("Request",NUM,"ClinicStopCodeName")=""
  1. S REQUEST("Request",NUM,"LinkedAppointmentType")=""
  1. S REQUEST("Request",NUM,"DateTimeEntered")=""
  1. S REQUEST("Request",NUM,"Priority")=""
  1. S REQUEST("Request",NUM,"EnrollmentPriorityGroup")=""
  1. S REQUEST("Request",NUM,"ByPatientOrProvider")=""
  1. S REQUEST("Request",NUM,"DateLinkedApptMade")=""
  1. S REQUEST("Request",NUM,"LinkedApptClinic")=""
  1. S REQUEST("Request",NUM,"LinkedInstitution")=""
  1. S REQUEST("Request",NUM,"LinkedApptStopCode")=""
  1. S REQUEST("Request",NUM,"LinkedApptCreditStopCode")=""
  1. S REQUEST("Request",NUM,"LinkedApptStationNumber")=""
  1. S REQUEST("Request",NUM,"LinkedApptEnteredBy")=""
  1. S REQUEST("Request",NUM,"LinkedApptStatus")=""
  1. S REQUEST("Request",NUM,"MRTCNeeded")=""
  1. S REQUEST("Request",NUM,"MRTCDaysBetweenAppts")=""
  1. S REQUEST("Request",NUM,"MRTCHowManyNeeded")=""
  1. I '$D(REQUEST("Request",NUM,"EASTrackingNumber")) S REQUEST("Request",NUM,"EASTrackingNumber")=""
  1. S REQUEST("Request",NUM,"DispositionedDate")=""
  1. S REQUEST("Request",NUM,"DispositionedBy")=""
  1. S REQUEST("Request",NUM,"DispositionReason")=""
  1. S REQUEST("Request",NUM,"ServiceConnectedPriority")=""
  1. S REQUEST("Request",NUM,"PatientStatus")=""
  1. S REQUEST("Request",NUM,"ParentRequestIEN")=""
  1. S REQUEST("Request",NUM,"PatientContact",1)=""
  1. S REQUEST("Request",NUM,"Status")=""
  1. S REQUEST("Request",NUM,"MRTC",1)=""
  1. S REQUEST("Request",NUM,"PatientComment",1)=""
  1. S REQUEST("Request",NUM,"ScheduledDateOfAppt")=""
  1. S REQUEST("Request",NUM,"CPRSOrderID")=""
  1. S REQUEST("Request",NUM,"CPRSTimeSensitive")=""
  1. S REQUEST("Request",NUM,"CPRSPreRequisites",1)=""
  1. S REQUEST("Request",NUM,"ClinicSecondaryStopCodeAMIS")=""
  1. S REQUEST("Request",NUM,"ClinicStopCodeAMIS")=""
  1. S REQUEST("Request",NUM,"CommentMultiple",1)=""
  1. S REQUEST("Request",NUM,"RequestComments")=""
  1. S REQUEST("Request",NUM,"ServiceConnectedPercentage")=""
  1. S REQUEST("Request",NUM,"PIDChangeAllowed")=""
  1. Q
  1. ;
  1. SDECONTACT(REQUEST,NUM) ;
  1. S REQUEST("Request",NUM,"SdecContactNumberOfCalls")=""
  1. S REQUEST("Request",NUM,"SdecContactNumberOfEmailContact")=""
  1. S REQUEST("Request",NUM,"SdecContactNumberOfTextContact")=""
  1. S REQUEST("Request",NUM,"SdecContactNumberOfSecureMessage")=""
  1. S REQUEST("Request",NUM,"SdecContactDateOfLastLetterSent")=""
  1. S REQUEST("Request",NUM,"SdecContactNumberOfContacts")=0
  1. Q
  1. ;
  1. RECALL(REQUEST,NUM) ;
  1. ;
  1. S REQUEST("Request",NUM,"RecallAccessionNumber")=""
  1. S REQUEST("Request",NUM,"RecallComment")=""
  1. S REQUEST("Request",NUM,"RecallFastingNonFasting")=""
  1. S REQUEST("Request",NUM,"RecallProviderIEN")=""
  1. S REQUEST("Request",NUM,"RecallProviderName")=""
  1. S REQUEST("Request",NUM,"RecallAppointmentLength")=""
  1. S REQUEST("Request",NUM,"RecallProviderIndicatedDate")=""
  1. S REQUEST("Request",NUM,"RecallDateReminderSent")=""
  1. S REQUEST("Request",NUM,"RecallSecondPrint")=""
  1. S REQUEST("Request",NUM,"RecallGAFScore")=""
  1. S REQUEST("Request",NUM,"RecallPatientSensitiveRecordAccessChecks")=""
  1. S REQUEST("Request",NUM,"RecallSimilarPatientData")=""
  1. S REQUEST("Request",NUM,"RecallAppointmentType")=""
  1. S REQUEST("Request",NUM,"RecallProviderNewPersonIEN")=""
  1. S REQUEST("Request",NUM,"RecallProviderSecID")=""
  1. S REQUEST("Request",NUM,"RecallClinicStopCodeIEN")=""
  1. S REQUEST("Request",NUM,"RecallClinicStopCodeAMIS")=""
  1. S REQUEST("Request",NUM,"RecallClinicStopCodeName")=""
  1. S REQUEST("Request",NUM,"RecallClinicSecondaryStopCodeIEN")=""
  1. S REQUEST("Request",NUM,"RecallClinicSecondaryStopCodeAMIS")=""
  1. S REQUEST("Request",NUM,"RecallClinicSecondaryStopCodeName")=""
  1. S REQUEST("Request",NUM,"RecallEnteredBySecID")=""
  1. I '$D(REQUEST("Request",NUM,"EASTrackingNumber")) S REQUEST("Request",NUM,"EASTrackingNumber")=""
  1. Q
  1. ;
  1. CONSULT(REQUEST,NUM) ;
  1. ;
  1. S REQUEST("Request",NUM,"ConsultAssociatedStopCodes",1)=""
  1. S REQUEST("Request",NUM,"ConsultRequestType")=""
  1. S REQUEST("Request",NUM,"ConsultToService")=""
  1. S REQUEST("Request",NUM,"ConsultCovidPriority")=""
  1. S REQUEST("Request",NUM,"ConsultDateReleasedFromCPRS")="" ; check
  1. S REQUEST("Request",NUM,"ConsultUrgencyOrEarliestDate")=""
  1. S REQUEST("Request",NUM,"ConsultServiceRenderedAs")=""
  1. S REQUEST("Request",NUM,"ConsultProhibitedClinicFlag")=""
  1. S REQUEST("Request",NUM,"ConsultClinicIndicatedDate")=""
  1. S REQUEST("Request",NUM,"ConsultCanEditPid")=""
  1. I '$D(REQUEST("Request",NUM,"EASTrackingNumber")) S REQUEST("Request",NUM,"EASTrackingNumber")=""
  1. Q
  1. ;