/// <summary> /// Create the registration event /// </summary> internal MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.RegistrationEvent <MARC.Everest.RMIM.UV.NE2008.PRPA_MT201304UV02.Patient, object> CreateRegistrationEventDetail(Core.ComponentModel.RegistrationEvent res, List <MARC.Everest.Connectors.IResultDetail> details) { // Patient var patient = res.FindComponent(SVC.Core.ComponentModel.HealthServiceRecordSiteRoleType.SubjectOf) as Person; if (patient == null) { return new MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.RegistrationEvent <MARC.Everest.RMIM.UV.NE2008.PRPA_MT201304UV02.Patient, object>() { NullFlavor = NullFlavor.NoInformation } } ; var scoper = patient.FindComponent(HealthServiceRecordSiteRoleType.PlaceOfEntry | HealthServiceRecordSiteRoleType.InformantTo) as HealthcareParticipant; // Return status var retVal = new MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.RegistrationEvent <MARC.Everest.RMIM.UV.NE2008.PRPA_MT201304UV02.Patient, object>( ActStatus.Active, new MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.Subject2 <MARC.Everest.RMIM.UV.NE2008.PRPA_MT201304UV02.Patient>( new MARC.Everest.RMIM.UV.NE2008.PRPA_MT201304UV02.Patient( CreateIISet(patient.AlternateIdentifiers, details), ConvertStatus(patient.Status, details), null, null //CreateOrganization(scoper, details) ) ) ); retVal.Subject1.registeredRole.SetPatientEntityChoiceSubject(CreatePerson(patient, details)); return(retVal); }
/// <summary> /// Convert the specified patient record to a registration event /// </summary> internal MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.RegistrationEvent <MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Patient, object> CreateRegistrationEvent(RegistrationEvent res, List <IResultDetail> details) { // Patient var patient = res.FindComponent(SVC.Core.ComponentModel.HealthServiceRecordSiteRoleType.SubjectOf) as Person; if (patient == null) { return new MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.RegistrationEvent <MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Patient, object>() { NullFlavor = NullFlavor.NoInformation } } ; var scoper = patient.FindComponent(HealthServiceRecordSiteRoleType.PlaceOfEntry | HealthServiceRecordSiteRoleType.InformantTo) as HealthcareParticipant; var queryParameter = patient.FindComponent(HealthServiceRecordSiteRoleType.CommentOn | HealthServiceRecordSiteRoleType.ComponentOf) as QueryParameters; var mask = patient.FindComponent(HealthServiceRecordSiteRoleType.FilterOf) as MaskingIndicator; var myOidData = this.m_configService.OidRegistrar.GetOid("CR_CID"); // Return status var retVal = new MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.RegistrationEvent <MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Patient, object>( ActStatus.Active, new MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.Subject2 <MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Patient>( new MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Patient( CreateIISet(patient.AlternateIdentifiers, details), ConvertStatus(patient.Status, details), null, new MARC.Everest.RMIM.UV.NE2008.COCT_MT150003UV03.Organization( SET <II> .CreateSET(new II(myOidData.Oid, null)), null, BAG <ON> .CreateBAG(ON.CreateON(null, new ENXP(myOidData.Attributes.Find(o => o.Key == "CustodialOrgName").Value ?? myOidData.Description))), new MARC.Everest.RMIM.UV.NE2008.COCT_MT150003UV03.ContactParty() { NullFlavor = NullFlavor.NoInformation } ), null ) ) ); // Custodian retVal.Custodian = new MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Custodian( new MARC.Everest.RMIM.UV.NE2008.COCT_MT090003UV01.AssignedEntity( SET <II> .CreateSET(new II(this.m_configService.Custodianship.Id.Domain)) ) { RepresentedOrganization = new MARC.Everest.RMIM.UV.NE2008.COCT_MT150003UV03.Organization( SET <II> .CreateSET(new II(this.m_configService.Custodianship.Id.Domain, null)), null, BAG <ON> .CreateBAG(ON.CreateON(null, new ENXP(this.m_configService.Custodianship.Name))), new MARC.Everest.RMIM.UV.NE2008.COCT_MT150003UV03.ContactParty() { NullFlavor = NullFlavor.NoInformation } ) } ); retVal.Subject1.registeredRole.SetPatientEntityChoiceSubject(CreatePersonDetail(patient, details)); // Mask if (mask != null) { retVal.Subject1.registeredRole.ConfidentialityCode = new SET <CE <string> >( CreateCD <String>(mask.MaskingCode, details) ); } if (patient.VipCode != null) { retVal.Subject1.registeredRole.VeryImportantPersonCode = CreateCD <String>(patient.VipCode, details); } // Query observation if (queryParameter != null) { retVal.Subject1.registeredRole.SubjectOf1.Add(new MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Subject( new MARC.Everest.RMIM.UV.NE2008.PRPA_MT202310UV02.QueryMatchObservation( new CD <string>(queryParameter.MatchingAlgorithm == MatchAlgorithm.Soundex ? "PHCM" : "PTNM", "2.16.840.1.113883.2.20.5.2"), new INT((int)(queryParameter.Confidence * 100)) ) )); } return(retVal); }
public virtual object Parse(System.Xml.XmlReader s, System.Type useType, System.Type currentInteractionType, MARC.Everest.Formatters.XML.ITS1.XmlIts1FormatterParseResult resultContext) { System.String nil = s.GetAttribute("nil", MARC.Everest.Formatters.XML.ITS1.XmlIts1Formatter.NS_XSI); if(!System.String.IsNullOrEmpty(nil) && System.Convert.ToBoolean(nil)) return null;; MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.RegistrationEvent<MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Patient,System.Object> instance = new MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.RegistrationEvent<MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Patient,System.Object>();; if(s.NodeType != System.Xml.XmlNodeType.Element) throw new System.InvalidOperationException(System.String.Format("Expected node type of Element, actual node type is '{0}'", s.NodeType)); if(s.GetAttribute("classCode") != null){ if(!"REG".Equals(s.GetAttribute("classCode"))) resultContext.AddResultDetail(new MARC.Everest.Connectors.FixedValueMisMatchedResultDetail(s.GetAttribute("classCode"), "REG", false, s.ToString())); instance.ClassCode = (MARC.Everest.DataTypes.CS<System.String>)MARC.Everest.Connectors.Util.FromWireFormat(s.GetAttribute("classCode"), typeof(MARC.Everest.DataTypes.CS<System.String>)); } if(s.GetAttribute("moodCode") != null){ if(!"EVN".Equals(s.GetAttribute("moodCode"))) resultContext.AddResultDetail(new MARC.Everest.Connectors.FixedValueMisMatchedResultDetail(s.GetAttribute("moodCode"), "EVN", false, s.ToString())); instance.MoodCode = (MARC.Everest.DataTypes.CS<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ActMood>)MARC.Everest.Connectors.Util.FromWireFormat(s.GetAttribute("moodCode"), typeof(MARC.Everest.DataTypes.CS<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ActMood>)); } if(s.GetAttribute("nullFlavor") != null) instance.NullFlavor = (MARC.Everest.DataTypes.CS<MARC.Everest.DataTypes.NullFlavor>)MARC.Everest.Connectors.Util.FromWireFormat(s.GetAttribute("nullFlavor"), typeof(MARC.Everest.DataTypes.CS<MARC.Everest.DataTypes.NullFlavor>)); if(s.IsEmptyElement) return instance; string sName = s.Name; int sDepth = s.Depth; s.Read(); while(!(s.NodeType == System.Xml.XmlNodeType.EndElement && s.Name == sName && s.Depth == sDepth)) { string oldName = s.LocalName; try { if(s.NodeType == System.Xml.XmlNodeType.Element) { if(s.LocalName == "id" ) { object d01c88579d62945699008d91fad3fadf8 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.II>), currentInteractionType, resultContext); instance.Id = d01c88579d62945699008d91fad3fadf8 is MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.II> ? d01c88579d62945699008d91fad3fadf8 as MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.II> : (MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.II>)MARC.Everest.Connectors.Util.FromWireFormat(d01c88579d62945699008d91fad3fadf8, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.II>)); } else if(s.LocalName == "statusCode" ) { object dd85eb8cc561845b68e73fd3170c18083 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.CS<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ActStatus>), currentInteractionType, resultContext); instance.StatusCode = dd85eb8cc561845b68e73fd3170c18083 is MARC.Everest.DataTypes.CS<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ActStatus> ? dd85eb8cc561845b68e73fd3170c18083 as MARC.Everest.DataTypes.CS<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ActStatus> : (MARC.Everest.DataTypes.CS<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ActStatus>)MARC.Everest.Connectors.Util.FromWireFormat(dd85eb8cc561845b68e73fd3170c18083, typeof(MARC.Everest.DataTypes.CS<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ActStatus>)); } else if(s.LocalName == "effectiveTime" ) { object dec92bbe1818945a4acade19c8c4affb5 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.TS>), currentInteractionType, resultContext); instance.EffectiveTime = dec92bbe1818945a4acade19c8c4affb5 is MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.TS> ? dec92bbe1818945a4acade19c8c4affb5 as MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.TS> : (MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.TS>)MARC.Everest.Connectors.Util.FromWireFormat(dec92bbe1818945a4acade19c8c4affb5, typeof(MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.TS>)); } else if(s.LocalName == "subject1" ) { object daf22f6f9ea5f4ba4aecfa3cce325f8a3 = Host.ParseObject(s, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.Subject2<MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Patient>), currentInteractionType, resultContext); instance.Subject1 = daf22f6f9ea5f4ba4aecfa3cce325f8a3 is MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.Subject2<MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Patient> ? daf22f6f9ea5f4ba4aecfa3cce325f8a3 as MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.Subject2<MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Patient> : (MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.Subject2<MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Patient>)MARC.Everest.Connectors.Util.FromWireFormat(daf22f6f9ea5f4ba4aecfa3cce325f8a3, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700711UV01.Subject2<MARC.Everest.RMIM.UV.NE2008.PRPA_MT201310UV02.Patient>)); } else if(s.LocalName == "author" ) { object d12bfaa13aa3b4fa2b084e5ae81ec6ac7 = Host.ParseObject(s, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Author2), currentInteractionType, resultContext); instance.Author = d12bfaa13aa3b4fa2b084e5ae81ec6ac7 is MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Author2 ? d12bfaa13aa3b4fa2b084e5ae81ec6ac7 as MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Author2 : (MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Author2)MARC.Everest.Connectors.Util.FromWireFormat(d12bfaa13aa3b4fa2b084e5ae81ec6ac7, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Author2)); } else if(s.LocalName == "custodian" ) { object d734e61a97b764249b4f17454ef54439b = Host.ParseObject(s, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Custodian), currentInteractionType, resultContext); instance.Custodian = d734e61a97b764249b4f17454ef54439b is MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Custodian ? d734e61a97b764249b4f17454ef54439b as MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Custodian : (MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Custodian)MARC.Everest.Connectors.Util.FromWireFormat(d734e61a97b764249b4f17454ef54439b, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Custodian)); } else if(s.LocalName == "inFulfillmentOf" ) { object dd5c083561a5845d4b3a42c74625d4aab = Host.ParseObject(s, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.InFulfillmentOf), currentInteractionType, resultContext); instance.InFulfillmentOf.Add(dd5c083561a5845d4b3a42c74625d4aab is MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.InFulfillmentOf ? (MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.InFulfillmentOf)dd5c083561a5845d4b3a42c74625d4aab : (MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.InFulfillmentOf)MARC.Everest.Connectors.Util.FromWireFormat(dd5c083561a5845d4b3a42c74625d4aab, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.InFulfillmentOf))); } else if(s.LocalName == "definition" ) { object d05f2d22a9e0b47b89932c0b622761e86 = Host.ParseObject(s, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Definition), currentInteractionType, resultContext); instance.Definition.Add(d05f2d22a9e0b47b89932c0b622761e86 is MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Definition ? (MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Definition)d05f2d22a9e0b47b89932c0b622761e86 : (MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Definition)MARC.Everest.Connectors.Util.FromWireFormat(d05f2d22a9e0b47b89932c0b622761e86, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Definition))); } else if(s.LocalName == "replacementOf" ) { object de074ca1eb49d417993c3d5c308f47032 = Host.ParseObject(s, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.ReplacementOf), currentInteractionType, resultContext); instance.ReplacementOf.Add(de074ca1eb49d417993c3d5c308f47032 is MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.ReplacementOf ? (MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.ReplacementOf)de074ca1eb49d417993c3d5c308f47032 : (MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.ReplacementOf)MARC.Everest.Connectors.Util.FromWireFormat(de074ca1eb49d417993c3d5c308f47032, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.ReplacementOf))); } else if(s.LocalName == "subject2" ) { object d4e23d30ed5404dbbb6efad4a53b92407 = Host.ParseObject(s, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Subject5<System.Object>), currentInteractionType, resultContext); instance.Subject2 = d4e23d30ed5404dbbb6efad4a53b92407 is MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Subject5<System.Object> ? d4e23d30ed5404dbbb6efad4a53b92407 as MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Subject5<System.Object> : (MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Subject5<System.Object>)MARC.Everest.Connectors.Util.FromWireFormat(d4e23d30ed5404dbbb6efad4a53b92407, typeof(MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Subject5<System.Object>)); } else if(s.LocalName == "realmCode" ) { object d9d98cb9fbb384f7da149bfe3c6e0bc3a = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>), currentInteractionType, resultContext); instance.RealmCode = d9d98cb9fbb384f7da149bfe3c6e0bc3a is MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>> ? d9d98cb9fbb384f7da149bfe3c6e0bc3a as MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>> : (MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>)MARC.Everest.Connectors.Util.FromWireFormat(d9d98cb9fbb384f7da149bfe3c6e0bc3a, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>)); } else if(s.LocalName == "typeId" ) { object dc9f5ac159df942059bb98a94eb5665ba = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.II), currentInteractionType, resultContext); instance.TypeId = dc9f5ac159df942059bb98a94eb5665ba is MARC.Everest.DataTypes.II ? dc9f5ac159df942059bb98a94eb5665ba as MARC.Everest.DataTypes.II : (MARC.Everest.DataTypes.II)MARC.Everest.Connectors.Util.FromWireFormat(dc9f5ac159df942059bb98a94eb5665ba, typeof(MARC.Everest.DataTypes.II)); } else if(s.LocalName == "templateId" ) { object da4467d71a0034ade8cccd5016f239180 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>), currentInteractionType, resultContext); instance.TemplateId = da4467d71a0034ade8cccd5016f239180 is MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II> ? da4467d71a0034ade8cccd5016f239180 as MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II> : (MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>)MARC.Everest.Connectors.Util.FromWireFormat(da4467d71a0034ade8cccd5016f239180, typeof(MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>)); } else { resultContext.AddResultDetail(new MARC.Everest.Connectors.NotImplementedElementResultDetail(MARC.Everest.Connectors.ResultDetailType.Warning, s.LocalName, s.NamespaceURI, s.ToString(), null)); } } } catch (System.Exception e) { resultContext.AddResultDetail(new MARC.Everest.Connectors.ResultDetail(MARC.Everest.Connectors.ResultDetailType.Error, e.Message, s.ToString(), e)); } finally { if(oldName.Equals(s.LocalName)) s.Read(); } } return instance; }