Ejemplo n.º 1
0
        public void DeleteVisit(string admissionID)
        {
            WCFVisit visit = new WCFVisit()
            {
                AdmissionID = admissionID
            };

            Guard.ArgumentNotNullOrEmpty(admissionID, "AdmissionID");
            using (MWLDataset ds = DB.DataAccess.Find(visit))
            {
                if (ds != null && ds.Visit.Rows.Count > 0)
                {
                    ds.Visit.Rows[0].Delete();
                    if (ds.ReferencedPatientSequence.Rows.Count > 0)
                    {
                        ds.ReferencedPatientSequence.Rows[0].Delete();
                    }
                    DB.DataAccess.UpdateMWL(ds);
                }
                else
                {
                    throw new Exception("Visit not found");
                }
            }
        }
Ejemplo n.º 2
0
        public void UpdateVisit(string admissionID, WCFVisit visit)
        {
            WCFVisit visitLookup = new WCFVisit()
            {
                AdmissionID = admissionID
            };

            Guard.ArgumentNotNullOrEmpty(admissionID, "AdmissionID");
            Guard.ArgumentNotNullOrEmpty(visit.AdmissionID, "AdmissionID");
            if (visit.ReferencedPatientSequence != null)
            {
                Guard.ArgumentNotNullOrEmpty(visit.ReferencedPatientSequence.ReferencedSOPClassUID, "ReferencedSOPClassUID");
                Guard.ArgumentNotNullOrEmpty(visit.ReferencedPatientSequence.ReferencedSOPInstanceUID, "ReferencedSOPInstanceUID");
            }

            using (MWLDataset ds = DB.DataAccess.Find(visitLookup))
            {
                if (ds != null && ds.Visit.Rows.Count > 0)
                {
                    MWLDataset.VisitRow row = ds.Visit.Rows[0] as MWLDataset.VisitRow;

                    row.Update(visit);
                    DB.DataAccess.UpdateMWL(ds);
                }
                else
                {
                    throw new Exception("Visit not found");
                }
            }
        }
Ejemplo n.º 3
0
        public void AddVisit(WCFVisit visit, MWLDataset ds)
        {
            Guard.ArgumentNotNullOrEmpty(visit.AdmissionID, "AdmissionID");
            if (visit.ReferencedPatientSequence != null)
            {
                Guard.ArgumentNotNullOrEmpty(visit.ReferencedPatientSequence.ReferencedSOPClassUID, "ReferencedSOPClassUID");
                Guard.ArgumentNotNullOrEmpty(visit.ReferencedPatientSequence.ReferencedSOPInstanceUID, "ReferencedSOPInstanceUID");
            }

            ds.AddVisit(visit);
        }
Ejemplo n.º 4
0
        public WCFVisit getVisit()
        {
            if (_visit == null)
            {
                _visit = new WCFVisit();

                _visit.AdmissionID = _adapter.PV1?.Visit_Number.Read();
                _visit.ReferencedPatientSequence = null;
                _visit.CurrentPatientLocation    = _adapter.PV1?.Assigned_Patient_Location.Read();

                DefaultValuesProvider.Visit(_visit);
            }

            return(_visit);
        }
Ejemplo n.º 5
0
        public void AddVisit(WCFVisit visit)
        {
            Guard.ArgumentNotNullOrEmpty(visit.AdmissionID, "AdmissionID");
            if (visit.ReferencedPatientSequence != null)
            {
                Guard.ArgumentNotNullOrEmpty(visit.ReferencedPatientSequence.ReferencedSOPClassUID, "ReferencedSOPClassUID");
                Guard.ArgumentNotNullOrEmpty(visit.ReferencedPatientSequence.ReferencedSOPInstanceUID, "ReferencedSOPInstanceUID");
            }

            using (MWLDataset ds = new MWLDataset())
            {
                ds.AddVisit(visit);
                DB.DataAccess.UpdateMWL(ds);
            }
        }
Ejemplo n.º 6
0
        public WCFVisit FindVisit(string admissionID)
        {
            WCFVisit visit = new WCFVisit()
            {
                AdmissionID = admissionID
            };

            Guard.ArgumentNotNullOrEmpty(admissionID, "AdmissionID");
            using (MWLDataset ds = DB.DataAccess.Find(visit))
            {
                if (ds != null && ds.Visit.Rows.Count > 0)
                {
                    return(ds.ToVisit());
                }
            }

            return(null);
        }
Ejemplo n.º 7
0
        public void DeleteThenAddVisit(WCFVisit visit)
        {
            Guard.ArgumentNotNullOrEmpty(visit.AdmissionID, "AdmissionID");
            if (visit.ReferencedPatientSequence != null)
            {
                Guard.ArgumentNotNullOrEmpty(visit.ReferencedPatientSequence.ReferencedSOPClassUID, "ReferencedSOPClassUID");
                Guard.ArgumentNotNullOrEmpty(visit.ReferencedPatientSequence.ReferencedSOPInstanceUID, "ReferencedSOPInstanceUID");
            }
            try
            {
                DB.DataAccess.DeleteWorklistEntity(visit);
            }
            catch { }//safe to ignore

            using (MWLDataset ds = new MWLDataset())
            {
                ds.AddVisit(visit);
                DB.DataAccess.UpdateMWL(ds);
            }
        }
Ejemplo n.º 8
0
 public DeleteVisit(WCFVisit visit)
 {
     _visit = visit;
 }
Ejemplo n.º 9
0
 public UpdateVisit(WCFVisit visit)
 {
     _visit = visit;
 }
Ejemplo n.º 10
0
 public AddVisit(WCFVisit visit)
 {
     _visit = visit;
 }