public HospitalLocationTO(HospitalLocation mdo) { if (mdo == null) { return; } this.id = mdo.Id; this.name = mdo.Name; this.department = new TaggedText(mdo.Department); this.service = new TaggedText(mdo.Service); this.specialty = new TaggedText(mdo.Specialty); this.stopCode = new TaggedText(mdo.StopCode); if (mdo.Facility != null) { this.facility = new SiteTO(mdo.Facility); } this.building = mdo.Building; this.floor = mdo.Floor; this.room = mdo.Room; this.bed = mdo.Bed; this.status = mdo.Status; this.phone = mdo.Phone; this.appointmentTimestamp = mdo.AppointmentTimestamp; this.type = mdo.Type; this.physicalLocation = mdo.PhysicalLocation; this.askForCheckIn = mdo.AskForCheckIn; this.appointmentLength = mdo.AppointmentLength; this.clinicDisplayStartTime = mdo.ClinicDisplayStartTime; this.displayIncrements = mdo.DisplayIncrements; this.availability = new TimeSlotArray(mdo.Availability); }
public VisitTO(Visit mdo) { if (mdo == null) { return; } this.id = mdo.Id; this.type = mdo.Type; if (mdo.Patient != null) { this.patient = new PatientTO(mdo.Patient); } if (mdo.Attending != null) { this.attending = new UserTO(mdo.Attending); } if (mdo.Provider != null) { this.provider = new UserTO(mdo.Provider); } this.service = mdo.Service; if (mdo.Location != null) { this.location = new HospitalLocationTO(mdo.Location); } this.patientType = mdo.PatientType; this.visitId = mdo.VisitId; this.timestamp = mdo.Timestamp; this.status = mdo.Status; if (mdo.Facility != null) { facility = new SiteTO(new Site(mdo.Facility.Id, mdo.Facility.Name)); } }
public HospitalLocationTO(HospitalLocation mdo) { if (mdo == null) { return; } this.id = mdo.Id; this.name = mdo.Name; this.department = new TaggedText(mdo.Department); this.service = new TaggedText(mdo.Service); this.specialty = new TaggedText(mdo.Specialty); if (mdo.Facility != null) { this.facility = new SiteTO(mdo.Facility); } this.building = mdo.Building; this.floor = mdo.Floor; this.room = mdo.Room; this.bed = mdo.Bed; this.status = mdo.Status; this.phone = mdo.Phone; this.appointmentTimestamp = mdo.AppointmentTimestamp; this.type = mdo.Type; this.physicalLocation = mdo.PhysicalLocation; }
public LabReportTO(LabReport report) { if (report == null) { return; } this.panel = new LabPanelTO(report.Panel); //if (report.Tests != null && report.Tests.Count > 0) //{ // tests = new LabTestArray(report.Tests); //} if (report.Result != null) { result = new LabResultTO(report.Result); } author = new AuthorTO(report.Author); caseNumber = report.CaseNumber; comment = report.Comment; if (report.Facility != null) { facility = new SiteTO(new mdo.Site(report.Facility.Id, report.Facility.Name)); } id = report.Id; //Specimen = new LabSpecimenTO(report.Specimen); timestamp = report.Timestamp; title = report.Title; type = report.Type; text = report.Text; if (report.Specimen != null) { specimen = new LabSpecimenTO(report.Specimen); } }
public LabReportTO(LabReport report) { Author = new AuthorTO(report.Author); CaseNumber = report.CaseNumber; Comment = report.Comment; if (report.Facility != null) { Facility = new SiteTO(new mdo.Site(report.Facility.Id, report.Facility.Name)); } Id = report.Id; Specimen = new LabSpecimenTO(report.Specimen); Timestamp = report.Timestamp; Title = report.Title; }
public ClinicalProcedureTO(ClinicalProcedure mdo) { if (mdo == null) { return; } this.name = mdo.Name; this.timestamp = mdo.Timestamp; this.id = mdo.Id; if (mdo.Facility != null) { this.facility = new SiteTO(mdo.Facility); } if (mdo.Note != null) { this.note = new NoteTO(mdo.Note); } report = mdo.Report; }
public ClosestFacilityTO(ClosestFacility mdo) { this.visn = mdo.RegionId; this.city = mdo.City; this.state = mdo.State; this.county = mdo.County; this.zip = mdo.Zipcode; this.longitude = mdo.Longitude; this.latitude = mdo.Latitude; this.fips = mdo.Fips; this.msa = mdo.Msa; this.urb = mdo.Urb; if (mdo.NearestFacility != null) { this.nearestFacility = new SiteTO(mdo.NearestFacility); this.nearestFacilityDistance = mdo.NearestFacilityDistance; this.nearestFacilityMsa = mdo.NearestFacilityMsa; this.nearestFacilityUrb = mdo.NearestFacilityUrb; } if (mdo.NearestMedicalCenter != null) { this.nearestMedicalCenter = new SiteTO(mdo.NearestMedicalCenter); this.nearestMedicalCenterDistance = mdo.NearestMedicalCenterDistance; this.nearestMedicalCenterMsa = mdo.NearestMedicalCenterMsa; this.nearestMedicalCenterUrb = mdo.NearestMedicalCenterUrb; } if (mdo.NearestFacilityInRegion != null) { this.nearestFacilityInRegion = new SiteTO(mdo.NearestFacilityInRegion); this.nearestFacilityInRegionDistance = mdo.NearestFacilityInRegionDistance; this.nearestFacilityInRegionMsa = mdo.NearestFacilityInRegionMsa; this.nearestFacilityInRegionUrb = mdo.NearestFacilityInRegionUrb; } if (mdo.NearestMedicalCenterInRegion != null) { this.nearestMedicalCenterInRegion = new SiteTO(mdo.NearestMedicalCenterInRegion); this.nearestMedicalCenterInRegionDistance = mdo.NearestMedicalCenterInRegionDistance; this.nearestMedicalCenterInRegionMsa = mdo.NearestMedicalCenterInRegionMsa; this.nearestMedicalCenterInRegionUrb = mdo.NearestMedicalCenterInRegionUrb; } }
public SiteTO patientVisit(string pwd, string sitecode, string mpiPid) { SiteTO result = new SiteTO(); if (mySession == null || mySession.SiteTable == null) { result.fault = new FaultTO("No session has been started"); } else if (sitecode == "") { result.fault = new FaultTO("No sitecode"); } else if (mySession.SiteTable.getSite(sitecode) == null) { result.fault = new FaultTO("No site " + sitecode + " in the site table"); } else if (mySession.ConnectionSet != null && mySession.ConnectionSet.Count > 0 && mySession.ConnectionSet.HasConnection(sitecode)) { result.fault = new FaultTO("Site " + sitecode + " already connected"); } else if (mySession.ConnectionSet != null && mySession.ConnectionSet.Count > 0) { result.fault = new FaultTO("This session has pre-existing connections and this method should be the base connection.", "Do a disconnect?"); } else if (mpiPid == "") { result.fault = new FaultTO("No MPI PID"); } if (result.fault != null) { return result; } SiteArray sa = patientVisit(pwd, sitecode, mpiPid, false); if (sa.fault == null) { result.fault = sa.fault; } else if (sa.sites.Length == 0) { result.fault = new FaultTO("Unable to connect to site " + sitecode); } else { result = sa.sites[0]; } return result; }
public SiteTO addSite(string id, string name, string datasource, string port, string modality, string protocol, string region) { SiteTO result = new SiteTO(); Site site = new Site(); DataSource source = new DataSource(); int iPort = 0; int iRegion = 0; if (!mySession.MdwsConfiguration.IsProduction) { result.fault = new FaultTO("You may not add data sources to non-production MDWS installations"); } else if (String.IsNullOrEmpty(id) || String.IsNullOrEmpty(name) || String.IsNullOrEmpty(datasource) || String.IsNullOrEmpty(port) || String.IsNullOrEmpty(modality) || String.IsNullOrEmpty(protocol) || String.IsNullOrEmpty(region)) { result.fault = new FaultTO("Must supply all parameters"); } else if (mySession.SiteTable.Sites.ContainsKey(id)) { result.fault = new FaultTO("That site id is in use", "Choose a different site id"); } else if (!Int32.TryParse(port, out iPort)) { result.fault = new FaultTO("Non-numeric port", "Provide a numeric value for the port"); } else if (!Int32.TryParse(region, out iRegion)) { result.fault = new FaultTO("Non-numeric region", "Provide a numeric value for the region"); } else if (modality != "HIS") { result.fault = new FaultTO("Only HIS modality currently supported", "Use 'HIS' as your modality"); } else if (protocol != "VISTA") { result.fault = new FaultTO("Only VISTA protocol currently supported", "Use 'VISTA' as your protocol"); } if(result.fault != null) { return result; } source.Port = iPort; source.Modality = modality; source.Protocol = protocol; source.Provider = datasource; source.SiteId = new SiteId(id, name); site.Sources = new DataSource[1]; site.Sources[0] = source; site.RegionId = region; site.Name = name; site.Id = id; if(!mySession.SiteTable.Regions.ContainsKey(iRegion)) { Region r = new Region(); r.Id = iRegion; r.Name = "Region " + region; r.Sites = new ArrayList(); mySession.SiteTable.Regions.Add(iRegion, r); } ((Region)mySession.SiteTable.Regions[iRegion]).Sites.Add(site); mySession.SiteTable.Sites.Add(id, site); mySession.SiteTable.Sources.Add(site.Sources[0]); result = new SiteTO(site); return result; }
public SiteTO getSite(string sitecode) { SiteTO result = new SiteTO(); if (sitecode == "") { result.fault = new FaultTO("No sitecode!"); } else if (sitecode.Length != 3 || !StringUtils.isNumeric(sitecode)) { result.fault = new FaultTO("Invalid sitecode"); } if (result.fault != null) { return result; } Site s = mySession.SiteTable.getSite(sitecode); if (s == null) { result.fault = new FaultTO("No such site!"); return result; } return new SiteTO(s); }