public static void Execute(IHL7MessageAdapter hl7) { var AccessionNumber = hl7.getImageServiceRequest()?.AccessionNumber; if (string.IsNullOrEmpty(AccessionNumber)) { AccessionNumber = UniqueIdProvider.NewUnique16BytesId(); } var AdmissionID = hl7.getVisit()?.AdmissionID; if (string.IsNullOrEmpty(AdmissionID)) { AdmissionID = UniqueIdProvider.NewUnique16BytesId(); } if (null != hl7.getVisit()) { hl7.getVisit().AdmissionID = AdmissionID; } if (null != hl7.getImageServiceRequest()) { hl7.getImageServiceRequest().AccessionNumber = AccessionNumber; } if (null != hl7.getProcedure()) { hl7.getProcedure().RequestedProcedureID = AccessionNumber; } if (null != hl7.getProcedureStep()) { hl7.getProcedureStep().ScheduledProcedureStepID = AccessionNumber; } }
private static IMWLCommand AddCommand(IHL7MessageAdapter hl7, bool pps) { var patient = new AddPatient(hl7.getPatient()); var image = new AddImageServiceRequest(hl7.getPatient(), hl7.getImageServiceRequest()); var visit = new AddVisit(hl7.getVisit()); var procedure = new AddRequestedProcedure(hl7.getImageServiceRequest(), hl7.getProcedure()); var scheduled = new AddScheduledProcedureStep(hl7.getImageServiceRequest(), hl7.getProcedure(), hl7.getProcedureStep()); var cmd = (new TransactionCommand()).Add(patient).Add(image).Add(visit).Add(procedure).Add(scheduled); if (pps) { var addpps = new AddPPSInformation(hl7.getPPS()); cmd.Add(addpps); } return(cmd.Add(new ResolveLinks())); }
private static IMWLCommand DeleteCommand(IHL7MessageAdapter hl7, bool pps) { var patient = new DeletePatient(hl7.getPatient()); var image = new DeleteImageServiceRequest(hl7.getPatient(), hl7.getImageServiceRequest()); var visit = new DeleteVisit(hl7.getVisit()); var procedure = new DeleteRequestedProcedure(hl7.getImageServiceRequest(), hl7.getProcedure()); var scheduled = new DeleteScheduledProcedureStep(hl7.getProcedure(), hl7.getProcedureStep()); var cmd = (new CompositeCommand()).Add(patient).Add(image).Add(scheduled).Add(procedure).Add(visit); if (pps) { var addpps = new DeletePPSInformation(hl7.getPPS()); cmd.Add(addpps); } ResolveLinks.Execute(hl7); return(cmd); }