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); }