- SDESGETREQWRAPPR ;ALB/BLB,MGD,JAS,LAB,TJB/BLB - VISTA SCHEDULING GET REQUEST RPCS ;JUL 19, 2023
- ;;5.3;Scheduling;**815,818,820,823,825,831,838,842,843,847,851,873**;Aug 13, 1993;Build 10
- ;;Per VHA Directive 6402, this routine should not be modified
- ;
- ;
- ; Return
- ;("Request",1,"ByPatientOrProvider")
- ;("Request",1,"ClinicIEN")
- ;("Request",1,"ClinicName")
- ;("Request",1,"ClinicSecondaryStopCodeAMIS")
- ;("Request",1,"ClinicStopCodeAMIS")
- ;("Request",1,"ClinicStopCodeIEN")
- ;("Request",1,"ClinicStopCodeName")
- ;("Request",1,"CommentMultiple")
- ;("Request",1,"ConsultAssociatedStopCodes",1,"StopCode")
- ;("Request",1,"ConsultCanEditPid")
- ;("Request",1,"ConsultClinicIndicatedDate")
- ;("Request",1,"ConsultCovidPriority")
- ;("Request",1,"ConsultDateReleasedFromCPRS")
- ;("Request",1,"ConsultProhibitedClinicFlag")
- ;("Request",1,"ConsultRequestType")
- ;("Request",1,"ConsultServiceRenderedAs")
- ;("Request",1,"ConsultToService")
- ;("Request",1,"ConsultUrgencyOrEarliestDate")
- ;("Request",1,"CPRSOrderID")=""
- ;("Request",1,"CPRSTimeSensitive")=""
- ;("Request",1,"CPRSPreRequisites",1)=""
- ;("Request",1,"CreateDate")
- ;("Request",1,"DateLinkedApptMade")
- ;("Request",1,"DateTimeEntered")
- ;("Request",1,"DispositionReason")
- ;("Request",1,"DispositionedBy")
- ;("Request",1,"DispositionedDate")
- ;("Request",1,"EASTrackingNumber")
- ;("Request",1,"EnrollmentPriorityGroup")
- ;("Request",1,"EnteredByIEN")
- ;("Request",1,"EnteredByName")
- ;("Request",1,"InstitutionIEN")
- ;("Request",1,"InstitutionName")
- ;("Request",1,"LinkedApptType")
- ;("Request",1,"LinkedApptClinic")
- ;("Request",1,"LinkedApptCreditStopCode")
- ;("Request",1,"LinkedApptEnteredBy")
- ;("Request",1,"LinkedApptInstitutionNumber")
- ;("Request",1,"LinkedApptStatus")
- ;("Request",1,"LinkedApptStopCode")
- ;("Request",1,"LinkedApptInstitutionName")
- ;("Request",1,"MRTC",1,"ChildRequestIEN")
- ;("Request",1,"MRTC",1,"LinkedAppointmentIEN")
- ;("Request",1,"MRTC",1,"PatientIndicatedDate")
- ;("Request",1,"MRTCDaysBetweenAppts")
- ;("Request",1,"MRTCHowManyNeeded")
- ;("Request",1,"MRTCNeeded")
- ;("Request",1,"MRTCTotal")
- ;("Request",1,"ParentRequest")
- ;("Request",1,"PatientComment",1,"Comment")
- ;("Request",1,"PatientContact",1,"Action")
- ;("Request",1,"PatientContact",1,"DateEntered")
- ;("Request",1,"PatientContact",1,"EnteredByIEN")
- ;("Request",1,"PatientContact",1,"EnteredByName")
- ;("Request",1,"PatientContact",1,"PatientPhone")
- ;("Request",1,"PatientIEN")
- ;("Request",1,"PatientIndicatedDate")
- ;("Request",1,"PatientName")
- ;("Request",1,"PatientStatus")
- ;("Request",1,"PIDChangeAllowed")
- ;("Request",1,"Priority")
- ;("Request",1,"ProviderIEN")
- ;("Request",1,"ProviderName")
- ;("Request",1,"ProviderSecID")
- ;("Request",1,"RecallAccessionNumber")
- ;("Request",1,"RecallAppointmentLength")
- ;("Request",1,"RecallAppointmentType")
- ;("Request",1,"RecallClinicStopCodeIEN")
- ;("Request",1,"RecallClinicStopCodeAMIS")
- ;("Request",1,"RecallClinicStopCodeName")
- ;("Request",1,"RecallClinicSecondaryStopCodeIEN")
- ;("Request",1,"RecallClinicSecondaryStopCodeAMIS")
- ;("Request",1,"RecallClinicSecondaryStopCodeName")
- ;("Request",1,"RecallComment")
- ;("Request",1,"RecallDateReminderSent")
- ;("Request",1,"RecallEnteredBySecID")
- ;("Request",1,"RecallFastingNonFasting")
- ;("Request",1,"RecallGAFScore")
- ;("Request",1,"RecallPatientSensitiveRecordAccessChecks")
- ;("Request",1,"RecallProviderIEN")
- ;("Request",1,"RecallProviderIndicatedDate")
- ;("Request",1,"RecallProviderName")
- ;("Request",1,"RecallProviderNewPersonIEN")
- ;("Request",1,"RecallProviderSecID")
- ;("Request",1,"RecallSecondPrint")
- ;("Request",1,"RecallSimilarPatientData")
- ;("Request",1,"RequestComments")
- ;("Request",1,"RequestIEN")
- ;("Request",1,"RequestSubType")
- ;("Request",1,"ScheduledDateOfAppt")
- ;("Request",1,"SdecContactDateOfLastLetterSent")
- ;("Request",1,"SdecContactNumberOfCalls")
- ;("Request",1,"SdecContactNumberOfContacts")
- ;("Request",1,"SdecContactNumberOfEmailContact")
- ;("Request",1,"SdecContactNumberOfLetters")
- ;("Request",1,"SdecContactNumberOfSecureMessage")
- ;("Request",1,"SdecContactNumberOfTextContact")
- ;("Request",1,"ServiceConnectedPriority")
- ;("Request",1,"Status")
- ;("Request",1,"Type")
- ;
- Q
- ;
- GETREQLISTBYDFN(JSONRETURN,DFN,EAS) ;
- ;
- N ISDFNVALID,ISEASVALID,RETURN,ERRORS,REQUESTIEN,REQUEST,CONSULTIEN,CPRSSTATUS,IFCROLE,RECALLIEN
- ;
- S ISDFNVALID=$$VALIDATEDFN(.ERRORS,$G(DFN))
- S ISEASVALID=$$VALIDATEEAS(.ERRORS,$G(EAS))
- I $D(ERRORS) S ERRORS("Request",1)="" M RETURN=ERRORS D BUILDJSON(.JSONRETURN,.RETURN) Q
- ;
- S REQUESTIEN=0
- F S REQUESTIEN=$O(^SDEC(409.85,"B",DFN,REQUESTIEN)) Q:'REQUESTIEN D
- .I $$GET1^DIQ(409.85,REQUESTIEN,23,"I")="C" Q
- .D GETREQUEST^SDESGETAPPTREQ(.REQUEST,REQUESTIEN)
- ;
- S RECALLIEN=0
- F S RECALLIEN=$O(^SD(403.5,"B",DFN,RECALLIEN)) Q:RECALLIEN="" D
- .S DFN=$$GET1^DIQ(403.5,RECALLIEN,.01,"I")
- .D GETRECALL^SDESGETRECALL(.REQUEST,RECALLIEN,DFN)
- ;
- S CONSULTIEN=0
- F S CONSULTIEN=$O(^GMR(123,"F",DFN,CONSULTIEN)) Q:'CONSULTIEN D
- .S CPRSSTATUS=$$GET1^DIQ(123,CONSULTIEN,8,"E"),IFCROLE=$$GET1^DIQ(123,CONSULTIEN,.125,"E")
- .I CPRSSTATUS'="PENDING",CPRSSTATUS'="ACTIVE" Q
- .I IFCROLE="PLACER" Q
- .D GETCONSULT^SDESGETCONSULTS(.REQUEST,CONSULTIEN)
- ;
- I '$D(REQUEST) S REQUEST("Request",1)=""
- M RETURN=REQUEST
- D BUILDJSON(.JSONRETURN,.RETURN)
- Q
- ;
- VALIDATEDFN(ERRORS,DFN) ;
- I DFN="" D ERRLOG^SDESJSON(.ERRORS,1) Q 0
- I DFN'="",'$D(^DPT(DFN,0)) D ERRLOG^SDESJSON(.ERRORS,2) Q 0
- Q 1
- ;
- VALIDATEEAS(ERRORS,EAS) ;
- I $L(EAS) S EAS=$$EASVALIDATE^SDESUTIL($G(EAS))
- I $P($G(EAS),U)=-1 D ERRLOG^SDESJSON(.ERRORS,142) Q 0
- Q 1
- ;
- BUILDJSON(JSONRETURN,RETURN) ;
- D ENCODE^XLFJSON("RETURN","JSONRETURN","ERR")
- Q
- ;
- APPTREQUEST(REQUEST,NUM) ;
- ;
- S REQUEST("Request",NUM,"ChildRequestSequenceNumber")=""
- S REQUEST("Request",NUM,"InstitutionIEN")=""
- S REQUEST("Request",NUM,"InstitutionName")=""
- S REQUEST("Request",NUM,"RequestType")=""
- S REQUEST("Request",NUM,"ClinicStopCodeIEN")=""
- S REQUEST("Request",NUM,"ClinicStopCodeName")=""
- S REQUEST("Request",NUM,"LinkedAppointmentType")=""
- S REQUEST("Request",NUM,"DateTimeEntered")=""
- S REQUEST("Request",NUM,"Priority")=""
- S REQUEST("Request",NUM,"EnrollmentPriorityGroup")=""
- S REQUEST("Request",NUM,"ByPatientOrProvider")=""
- S REQUEST("Request",NUM,"DateLinkedApptMade")=""
- S REQUEST("Request",NUM,"LinkedApptClinic")=""
- S REQUEST("Request",NUM,"LinkedInstitution")=""
- S REQUEST("Request",NUM,"LinkedApptStopCode")=""
- S REQUEST("Request",NUM,"LinkedApptCreditStopCode")=""
- S REQUEST("Request",NUM,"LinkedApptStationNumber")=""
- S REQUEST("Request",NUM,"LinkedApptEnteredBy")=""
- S REQUEST("Request",NUM,"LinkedApptStatus")=""
- S REQUEST("Request",NUM,"MRTCNeeded")=""
- S REQUEST("Request",NUM,"MRTCDaysBetweenAppts")=""
- S REQUEST("Request",NUM,"MRTCHowManyNeeded")=""
- I '$D(REQUEST("Request",NUM,"EASTrackingNumber")) S REQUEST("Request",NUM,"EASTrackingNumber")=""
- S REQUEST("Request",NUM,"DispositionedDate")=""
- S REQUEST("Request",NUM,"DispositionedBy")=""
- S REQUEST("Request",NUM,"DispositionReason")=""
- S REQUEST("Request",NUM,"ServiceConnectedPriority")=""
- S REQUEST("Request",NUM,"PatientStatus")=""
- S REQUEST("Request",NUM,"ParentRequestIEN")=""
- S REQUEST("Request",NUM,"PatientContact",1)=""
- S REQUEST("Request",NUM,"Status")=""
- S REQUEST("Request",NUM,"MRTC",1)=""
- S REQUEST("Request",NUM,"PatientComment",1)=""
- S REQUEST("Request",NUM,"ScheduledDateOfAppt")=""
- S REQUEST("Request",NUM,"CPRSOrderID")=""
- S REQUEST("Request",NUM,"CPRSTimeSensitive")=""
- S REQUEST("Request",NUM,"CPRSPreRequisites",1)=""
- S REQUEST("Request",NUM,"ClinicSecondaryStopCodeAMIS")=""
- S REQUEST("Request",NUM,"ClinicStopCodeAMIS")=""
- S REQUEST("Request",NUM,"CommentMultiple",1)=""
- S REQUEST("Request",NUM,"RequestComments")=""
- S REQUEST("Request",NUM,"ServiceConnectedPercentage")=""
- S REQUEST("Request",NUM,"PIDChangeAllowed")=""
- Q
- ;
- SDECONTACT(REQUEST,NUM) ;
- S REQUEST("Request",NUM,"SdecContactNumberOfCalls")=""
- S REQUEST("Request",NUM,"SdecContactNumberOfEmailContact")=""
- S REQUEST("Request",NUM,"SdecContactNumberOfTextContact")=""
- S REQUEST("Request",NUM,"SdecContactNumberOfSecureMessage")=""
- S REQUEST("Request",NUM,"SdecContactDateOfLastLetterSent")=""
- S REQUEST("Request",NUM,"SdecContactNumberOfContacts")=0
- Q
- ;
- RECALL(REQUEST,NUM) ;
- ;
- S REQUEST("Request",NUM,"RecallAccessionNumber")=""
- S REQUEST("Request",NUM,"RecallComment")=""
- S REQUEST("Request",NUM,"RecallFastingNonFasting")=""
- S REQUEST("Request",NUM,"RecallProviderIEN")=""
- S REQUEST("Request",NUM,"RecallProviderName")=""
- S REQUEST("Request",NUM,"RecallAppointmentLength")=""
- S REQUEST("Request",NUM,"RecallProviderIndicatedDate")=""
- S REQUEST("Request",NUM,"RecallDateReminderSent")=""
- S REQUEST("Request",NUM,"RecallSecondPrint")=""
- S REQUEST("Request",NUM,"RecallGAFScore")=""
- S REQUEST("Request",NUM,"RecallPatientSensitiveRecordAccessChecks")=""
- S REQUEST("Request",NUM,"RecallSimilarPatientData")=""
- S REQUEST("Request",NUM,"RecallAppointmentType")=""
- S REQUEST("Request",NUM,"RecallProviderNewPersonIEN")=""
- S REQUEST("Request",NUM,"RecallProviderSecID")=""
- S REQUEST("Request",NUM,"RecallClinicStopCodeIEN")=""
- S REQUEST("Request",NUM,"RecallClinicStopCodeAMIS")=""
- S REQUEST("Request",NUM,"RecallClinicStopCodeName")=""
- S REQUEST("Request",NUM,"RecallClinicSecondaryStopCodeIEN")=""
- S REQUEST("Request",NUM,"RecallClinicSecondaryStopCodeAMIS")=""
- S REQUEST("Request",NUM,"RecallClinicSecondaryStopCodeName")=""
- S REQUEST("Request",NUM,"RecallEnteredBySecID")=""
- I '$D(REQUEST("Request",NUM,"EASTrackingNumber")) S REQUEST("Request",NUM,"EASTrackingNumber")=""
- Q
- ;
- CONSULT(REQUEST,NUM) ;
- ;
- S REQUEST("Request",NUM,"ConsultAssociatedStopCodes",1)=""
- S REQUEST("Request",NUM,"ConsultRequestType")=""
- S REQUEST("Request",NUM,"ConsultToService")=""
- S REQUEST("Request",NUM,"ConsultCovidPriority")=""
- S REQUEST("Request",NUM,"ConsultDateReleasedFromCPRS")="" ; check
- S REQUEST("Request",NUM,"ConsultUrgencyOrEarliestDate")=""
- S REQUEST("Request",NUM,"ConsultServiceRenderedAs")=""
- S REQUEST("Request",NUM,"ConsultProhibitedClinicFlag")=""
- S REQUEST("Request",NUM,"ConsultClinicIndicatedDate")=""
- S REQUEST("Request",NUM,"ConsultCanEditPid")=""
- I '$D(REQUEST("Request",NUM,"EASTrackingNumber")) S REQUEST("Request",NUM,"EASTrackingNumber")=""
- Q
- ;
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDESGETREQWRAPPR 10537 printed Feb 19, 2025@00:23:37 Page 2
- 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
- +2 ;;Per VHA Directive 6402, this routine should not be modified
- +3 ;
- +4 ;
- +5 ; Return
- +6 ;("Request",1,"ByPatientOrProvider")
- +7 ;("Request",1,"ClinicIEN")
- +8 ;("Request",1,"ClinicName")
- +9 ;("Request",1,"ClinicSecondaryStopCodeAMIS")
- +10 ;("Request",1,"ClinicStopCodeAMIS")
- +11 ;("Request",1,"ClinicStopCodeIEN")
- +12 ;("Request",1,"ClinicStopCodeName")
- +13 ;("Request",1,"CommentMultiple")
- +14 ;("Request",1,"ConsultAssociatedStopCodes",1,"StopCode")
- +15 ;("Request",1,"ConsultCanEditPid")
- +16 ;("Request",1,"ConsultClinicIndicatedDate")
- +17 ;("Request",1,"ConsultCovidPriority")
- +18 ;("Request",1,"ConsultDateReleasedFromCPRS")
- +19 ;("Request",1,"ConsultProhibitedClinicFlag")
- +20 ;("Request",1,"ConsultRequestType")
- +21 ;("Request",1,"ConsultServiceRenderedAs")
- +22 ;("Request",1,"ConsultToService")
- +23 ;("Request",1,"ConsultUrgencyOrEarliestDate")
- +24 ;("Request",1,"CPRSOrderID")=""
- +25 ;("Request",1,"CPRSTimeSensitive")=""
- +26 ;("Request",1,"CPRSPreRequisites",1)=""
- +27 ;("Request",1,"CreateDate")
- +28 ;("Request",1,"DateLinkedApptMade")
- +29 ;("Request",1,"DateTimeEntered")
- +30 ;("Request",1,"DispositionReason")
- +31 ;("Request",1,"DispositionedBy")
- +32 ;("Request",1,"DispositionedDate")
- +33 ;("Request",1,"EASTrackingNumber")
- +34 ;("Request",1,"EnrollmentPriorityGroup")
- +35 ;("Request",1,"EnteredByIEN")
- +36 ;("Request",1,"EnteredByName")
- +37 ;("Request",1,"InstitutionIEN")
- +38 ;("Request",1,"InstitutionName")
- +39 ;("Request",1,"LinkedApptType")
- +40 ;("Request",1,"LinkedApptClinic")
- +41 ;("Request",1,"LinkedApptCreditStopCode")
- +42 ;("Request",1,"LinkedApptEnteredBy")
- +43 ;("Request",1,"LinkedApptInstitutionNumber")
- +44 ;("Request",1,"LinkedApptStatus")
- +45 ;("Request",1,"LinkedApptStopCode")
- +46 ;("Request",1,"LinkedApptInstitutionName")
- +47 ;("Request",1,"MRTC",1,"ChildRequestIEN")
- +48 ;("Request",1,"MRTC",1,"LinkedAppointmentIEN")
- +49 ;("Request",1,"MRTC",1,"PatientIndicatedDate")
- +50 ;("Request",1,"MRTCDaysBetweenAppts")
- +51 ;("Request",1,"MRTCHowManyNeeded")
- +52 ;("Request",1,"MRTCNeeded")
- +53 ;("Request",1,"MRTCTotal")
- +54 ;("Request",1,"ParentRequest")
- +55 ;("Request",1,"PatientComment",1,"Comment")
- +56 ;("Request",1,"PatientContact",1,"Action")
- +57 ;("Request",1,"PatientContact",1,"DateEntered")
- +58 ;("Request",1,"PatientContact",1,"EnteredByIEN")
- +59 ;("Request",1,"PatientContact",1,"EnteredByName")
- +60 ;("Request",1,"PatientContact",1,"PatientPhone")
- +61 ;("Request",1,"PatientIEN")
- +62 ;("Request",1,"PatientIndicatedDate")
- +63 ;("Request",1,"PatientName")
- +64 ;("Request",1,"PatientStatus")
- +65 ;("Request",1,"PIDChangeAllowed")
- +66 ;("Request",1,"Priority")
- +67 ;("Request",1,"ProviderIEN")
- +68 ;("Request",1,"ProviderName")
- +69 ;("Request",1,"ProviderSecID")
- +70 ;("Request",1,"RecallAccessionNumber")
- +71 ;("Request",1,"RecallAppointmentLength")
- +72 ;("Request",1,"RecallAppointmentType")
- +73 ;("Request",1,"RecallClinicStopCodeIEN")
- +74 ;("Request",1,"RecallClinicStopCodeAMIS")
- +75 ;("Request",1,"RecallClinicStopCodeName")
- +76 ;("Request",1,"RecallClinicSecondaryStopCodeIEN")
- +77 ;("Request",1,"RecallClinicSecondaryStopCodeAMIS")
- +78 ;("Request",1,"RecallClinicSecondaryStopCodeName")
- +79 ;("Request",1,"RecallComment")
- +80 ;("Request",1,"RecallDateReminderSent")
- +81 ;("Request",1,"RecallEnteredBySecID")
- +82 ;("Request",1,"RecallFastingNonFasting")
- +83 ;("Request",1,"RecallGAFScore")
- +84 ;("Request",1,"RecallPatientSensitiveRecordAccessChecks")
- +85 ;("Request",1,"RecallProviderIEN")
- +86 ;("Request",1,"RecallProviderIndicatedDate")
- +87 ;("Request",1,"RecallProviderName")
- +88 ;("Request",1,"RecallProviderNewPersonIEN")
- +89 ;("Request",1,"RecallProviderSecID")
- +90 ;("Request",1,"RecallSecondPrint")
- +91 ;("Request",1,"RecallSimilarPatientData")
- +92 ;("Request",1,"RequestComments")
- +93 ;("Request",1,"RequestIEN")
- +94 ;("Request",1,"RequestSubType")
- +95 ;("Request",1,"ScheduledDateOfAppt")
- +96 ;("Request",1,"SdecContactDateOfLastLetterSent")
- +97 ;("Request",1,"SdecContactNumberOfCalls")
- +98 ;("Request",1,"SdecContactNumberOfContacts")
- +99 ;("Request",1,"SdecContactNumberOfEmailContact")
- +100 ;("Request",1,"SdecContactNumberOfLetters")
- +101 ;("Request",1,"SdecContactNumberOfSecureMessage")
- +102 ;("Request",1,"SdecContactNumberOfTextContact")
- +103 ;("Request",1,"ServiceConnectedPriority")
- +104 ;("Request",1,"Status")
- +105 ;("Request",1,"Type")
- +106 ;
- +107 QUIT
- +108 ;
- GETREQLISTBYDFN(JSONRETURN,DFN,EAS) ;
- +1 ;
- +2 NEW ISDFNVALID,ISEASVALID,RETURN,ERRORS,REQUESTIEN,REQUEST,CONSULTIEN,CPRSSTATUS,IFCROLE,RECALLIEN
- +3 ;
- +4 SET ISDFNVALID=$$VALIDATEDFN(.ERRORS,$GET(DFN))
- +5 SET ISEASVALID=$$VALIDATEEAS(.ERRORS,$GET(EAS))
- +6 IF $DATA(ERRORS)
- SET ERRORS("Request",1)=""
- MERGE RETURN=ERRORS
- DO BUILDJSON(.JSONRETURN,.RETURN)
- QUIT
- +7 ;
- +8 SET REQUESTIEN=0
- +9 FOR
- SET REQUESTIEN=$ORDER(^SDEC(409.85,"B",DFN,REQUESTIEN))
- if 'REQUESTIEN
- QUIT
- Begin DoDot:1
- +10 IF $$GET1^DIQ(409.85,REQUESTIEN,23,"I")="C"
- QUIT
- +11 DO GETREQUEST^SDESGETAPPTREQ(.REQUEST,REQUESTIEN)
- End DoDot:1
- +12 ;
- +13 SET RECALLIEN=0
- +14 FOR
- SET RECALLIEN=$ORDER(^SD(403.5,"B",DFN,RECALLIEN))
- if RECALLIEN=""
- QUIT
- Begin DoDot:1
- +15 SET DFN=$$GET1^DIQ(403.5,RECALLIEN,.01,"I")
- +16 DO GETRECALL^SDESGETRECALL(.REQUEST,RECALLIEN,DFN)
- End DoDot:1
- +17 ;
- +18 SET CONSULTIEN=0
- +19 FOR
- SET CONSULTIEN=$ORDER(^GMR(123,"F",DFN,CONSULTIEN))
- if 'CONSULTIEN
- QUIT
- Begin DoDot:1
- +20 SET CPRSSTATUS=$$GET1^DIQ(123,CONSULTIEN,8,"E")
- SET IFCROLE=$$GET1^DIQ(123,CONSULTIEN,.125,"E")
- +21 IF CPRSSTATUS'="PENDING"
- IF CPRSSTATUS'="ACTIVE"
- QUIT
- +22 IF IFCROLE="PLACER"
- QUIT
- +23 DO GETCONSULT^SDESGETCONSULTS(.REQUEST,CONSULTIEN)
- End DoDot:1
- +24 ;
- +25 IF '$DATA(REQUEST)
- SET REQUEST("Request",1)=""
- +26 MERGE RETURN=REQUEST
- +27 DO BUILDJSON(.JSONRETURN,.RETURN)
- +28 QUIT
- +29 ;
- VALIDATEDFN(ERRORS,DFN) ;
- +1 IF DFN=""
- DO ERRLOG^SDESJSON(.ERRORS,1)
- QUIT 0
- +2 IF DFN'=""
- IF '$DATA(^DPT(DFN,0))
- DO ERRLOG^SDESJSON(.ERRORS,2)
- QUIT 0
- +3 QUIT 1
- +4 ;
- VALIDATEEAS(ERRORS,EAS) ;
- +1 IF $LENGTH(EAS)
- SET EAS=$$EASVALIDATE^SDESUTIL($GET(EAS))
- +2 IF $PIECE($GET(EAS),U)=-1
- DO ERRLOG^SDESJSON(.ERRORS,142)
- QUIT 0
- +3 QUIT 1
- +4 ;
- BUILDJSON(JSONRETURN,RETURN) ;
- +1 DO ENCODE^XLFJSON("RETURN","JSONRETURN","ERR")
- +2 QUIT
- +3 ;
- APPTREQUEST(REQUEST,NUM) ;
- +1 ;
- +2 SET REQUEST("Request",NUM,"ChildRequestSequenceNumber")=""
- +3 SET REQUEST("Request",NUM,"InstitutionIEN")=""
- +4 SET REQUEST("Request",NUM,"InstitutionName")=""
- +5 SET REQUEST("Request",NUM,"RequestType")=""
- +6 SET REQUEST("Request",NUM,"ClinicStopCodeIEN")=""
- +7 SET REQUEST("Request",NUM,"ClinicStopCodeName")=""
- +8 SET REQUEST("Request",NUM,"LinkedAppointmentType")=""
- +9 SET REQUEST("Request",NUM,"DateTimeEntered")=""
- +10 SET REQUEST("Request",NUM,"Priority")=""
- +11 SET REQUEST("Request",NUM,"EnrollmentPriorityGroup")=""
- +12 SET REQUEST("Request",NUM,"ByPatientOrProvider")=""
- +13 SET REQUEST("Request",NUM,"DateLinkedApptMade")=""
- +14 SET REQUEST("Request",NUM,"LinkedApptClinic")=""
- +15 SET REQUEST("Request",NUM,"LinkedInstitution")=""
- +16 SET REQUEST("Request",NUM,"LinkedApptStopCode")=""
- +17 SET REQUEST("Request",NUM,"LinkedApptCreditStopCode")=""
- +18 SET REQUEST("Request",NUM,"LinkedApptStationNumber")=""
- +19 SET REQUEST("Request",NUM,"LinkedApptEnteredBy")=""
- +20 SET REQUEST("Request",NUM,"LinkedApptStatus")=""
- +21 SET REQUEST("Request",NUM,"MRTCNeeded")=""
- +22 SET REQUEST("Request",NUM,"MRTCDaysBetweenAppts")=""
- +23 SET REQUEST("Request",NUM,"MRTCHowManyNeeded")=""
- +24 IF '$DATA(REQUEST("Request",NUM,"EASTrackingNumber"))
- SET REQUEST("Request",NUM,"EASTrackingNumber")=""
- +25 SET REQUEST("Request",NUM,"DispositionedDate")=""
- +26 SET REQUEST("Request",NUM,"DispositionedBy")=""
- +27 SET REQUEST("Request",NUM,"DispositionReason")=""
- +28 SET REQUEST("Request",NUM,"ServiceConnectedPriority")=""
- +29 SET REQUEST("Request",NUM,"PatientStatus")=""
- +30 SET REQUEST("Request",NUM,"ParentRequestIEN")=""
- +31 SET REQUEST("Request",NUM,"PatientContact",1)=""
- +32 SET REQUEST("Request",NUM,"Status")=""
- +33 SET REQUEST("Request",NUM,"MRTC",1)=""
- +34 SET REQUEST("Request",NUM,"PatientComment",1)=""
- +35 SET REQUEST("Request",NUM,"ScheduledDateOfAppt")=""
- +36 SET REQUEST("Request",NUM,"CPRSOrderID")=""
- +37 SET REQUEST("Request",NUM,"CPRSTimeSensitive")=""
- +38 SET REQUEST("Request",NUM,"CPRSPreRequisites",1)=""
- +39 SET REQUEST("Request",NUM,"ClinicSecondaryStopCodeAMIS")=""
- +40 SET REQUEST("Request",NUM,"ClinicStopCodeAMIS")=""
- +41 SET REQUEST("Request",NUM,"CommentMultiple",1)=""
- +42 SET REQUEST("Request",NUM,"RequestComments")=""
- +43 SET REQUEST("Request",NUM,"ServiceConnectedPercentage")=""
- +44 SET REQUEST("Request",NUM,"PIDChangeAllowed")=""
- +45 QUIT
- +46 ;
- SDECONTACT(REQUEST,NUM) ;
- +1 SET REQUEST("Request",NUM,"SdecContactNumberOfCalls")=""
- +2 SET REQUEST("Request",NUM,"SdecContactNumberOfEmailContact")=""
- +3 SET REQUEST("Request",NUM,"SdecContactNumberOfTextContact")=""
- +4 SET REQUEST("Request",NUM,"SdecContactNumberOfSecureMessage")=""
- +5 SET REQUEST("Request",NUM,"SdecContactDateOfLastLetterSent")=""
- +6 SET REQUEST("Request",NUM,"SdecContactNumberOfContacts")=0
- +7 QUIT
- +8 ;
- RECALL(REQUEST,NUM) ;
- +1 ;
- +2 SET REQUEST("Request",NUM,"RecallAccessionNumber")=""
- +3 SET REQUEST("Request",NUM,"RecallComment")=""
- +4 SET REQUEST("Request",NUM,"RecallFastingNonFasting")=""
- +5 SET REQUEST("Request",NUM,"RecallProviderIEN")=""
- +6 SET REQUEST("Request",NUM,"RecallProviderName")=""
- +7 SET REQUEST("Request",NUM,"RecallAppointmentLength")=""
- +8 SET REQUEST("Request",NUM,"RecallProviderIndicatedDate")=""
- +9 SET REQUEST("Request",NUM,"RecallDateReminderSent")=""
- +10 SET REQUEST("Request",NUM,"RecallSecondPrint")=""
- +11 SET REQUEST("Request",NUM,"RecallGAFScore")=""
- +12 SET REQUEST("Request",NUM,"RecallPatientSensitiveRecordAccessChecks")=""
- +13 SET REQUEST("Request",NUM,"RecallSimilarPatientData")=""
- +14 SET REQUEST("Request",NUM,"RecallAppointmentType")=""
- +15 SET REQUEST("Request",NUM,"RecallProviderNewPersonIEN")=""
- +16 SET REQUEST("Request",NUM,"RecallProviderSecID")=""
- +17 SET REQUEST("Request",NUM,"RecallClinicStopCodeIEN")=""
- +18 SET REQUEST("Request",NUM,"RecallClinicStopCodeAMIS")=""
- +19 SET REQUEST("Request",NUM,"RecallClinicStopCodeName")=""
- +20 SET REQUEST("Request",NUM,"RecallClinicSecondaryStopCodeIEN")=""
- +21 SET REQUEST("Request",NUM,"RecallClinicSecondaryStopCodeAMIS")=""
- +22 SET REQUEST("Request",NUM,"RecallClinicSecondaryStopCodeName")=""
- +23 SET REQUEST("Request",NUM,"RecallEnteredBySecID")=""
- +24 IF '$DATA(REQUEST("Request",NUM,"EASTrackingNumber"))
- SET REQUEST("Request",NUM,"EASTrackingNumber")=""
- +25 QUIT
- +26 ;
- CONSULT(REQUEST,NUM) ;
- +1 ;
- +2 SET REQUEST("Request",NUM,"ConsultAssociatedStopCodes",1)=""
- +3 SET REQUEST("Request",NUM,"ConsultRequestType")=""
- +4 SET REQUEST("Request",NUM,"ConsultToService")=""
- +5 SET REQUEST("Request",NUM,"ConsultCovidPriority")=""
- +6 ; check
- SET REQUEST("Request",NUM,"ConsultDateReleasedFromCPRS")=""
- +7 SET REQUEST("Request",NUM,"ConsultUrgencyOrEarliestDate")=""
- +8 SET REQUEST("Request",NUM,"ConsultServiceRenderedAs")=""
- +9 SET REQUEST("Request",NUM,"ConsultProhibitedClinicFlag")=""
- +10 SET REQUEST("Request",NUM,"ConsultClinicIndicatedDate")=""
- +11 SET REQUEST("Request",NUM,"ConsultCanEditPid")=""
- +12 IF '$DATA(REQUEST("Request",NUM,"EASTrackingNumber"))
- SET REQUEST("Request",NUM,"EASTrackingNumber")=""
- +13 QUIT
- +14 ;