/// <summary> /// Generate PIX Message /// </summary> private static void GeneratePIX() { Console.WriteLine("\r\n\r\nGenerating PIXv3....\r\n\r\n"); // Create the instance message PRPA_IN201309UV02 message = new PRPA_IN201309UV02( Guid.NewGuid(), // The sample message uses a Guid for message Id, this is a method you can use to do this DateTime.Now, // The time the message was created, PRPA_IN201309UV02.GetInteractionId(), // Specify the interaction we're using ProcessingID.Training, // Operating in training mode "T", // Transactional AcknowledgementCondition.Always, // Always acknowledge new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Receiver( new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Device( new SET<II>(new II("1.2.840.114350.1.13.99999.4567")) // Identifier of the receiver device ) { // We can use initializer to construct extra properties Telecom = new BAG<TEL>( new TEL[] { "http://example.org/PIXQuery" } // The telecommunications address of the receiver ) } ), new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Sender( // The device that is sending the instance new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Device( new SET<II>(new II("1.2.840.114350.1.13.99997.2.7788")) ) ), new MARC.Everest.RMIM.UV.NE2008.QUQI_MT021001UV01.ControlActProcess<MARC.Everest.RMIM.UV.NE2008.PRPA_MT201307UV02.QueryByParameter>() ); // shortcut for control act process var cactProcess = message.controlActProcess; // Tell the receiver what trigger event we're executing cactProcess.Code = new CD<string>(PRPA_IN201309UV02.GetTriggerEvent().Code); // Set the author or performer var author = new MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.AuthorOrPerformer( "AUT" ); // Set the participant author.SetParticipationChoice(new MARC.Everest.RMIM.UV.NE2008.COCT_MT090100UV01.AssignedPerson() // Type of participant is an assigned entity { Id = new SET<II>( // Set the identifier of the user new II("1.2.840.114350.1.13.99997.2.7766", "USR5568") ) } ); // Set the query parameter cactProcess.queryByParameter = new MARC.Everest.RMIM.UV.NE2008.PRPA_MT201307UV02.QueryByParameter( new II("1.2.840.114350.1.13.99999.4567.34", "33452"), // The unique id for the query "new", // The status code of the query new MARC.Everest.RMIM.UV.NE2008.PRPA_MT201307UV02.ParameterList() ) { ResponsePriorityCode = "I" }; // Query by patient identifier cactProcess.queryByParameter.ParameterList.PatientIdentifier.Add( new MARC.Everest.RMIM.UV.NE2008.PRPA_MT201307UV02.PatientIdentifier( new SET<II>( new II("1.2.840.114350.1.13.99997.2.3412", "38273N237") ), "Patient.Id" ) ); FormatInstance(message); }
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_MT700701UV01.AuthorOrPerformer instance = new MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.AuthorOrPerformer();; 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("typeCode") != null) instance.TypeCode = (MARC.Everest.DataTypes.CS<System.String>)MARC.Everest.Connectors.Util.FromWireFormat(s.GetAttribute("typeCode"), typeof(MARC.Everest.DataTypes.CS<System.String>)); if(s.GetAttribute("contextControlCode") != null) instance.ContextControlCode = (MARC.Everest.DataTypes.CS<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ContextControl1>)MARC.Everest.Connectors.Util.FromWireFormat(s.GetAttribute("contextControlCode"), typeof(MARC.Everest.DataTypes.CS<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ContextControl1>)); 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 == "noteText" ) { object d818f02caf3c44491a84316ffe52df50b = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.ED), currentInteractionType, resultContext); instance.NoteText = d818f02caf3c44491a84316ffe52df50b is MARC.Everest.DataTypes.ED ? d818f02caf3c44491a84316ffe52df50b as MARC.Everest.DataTypes.ED : (MARC.Everest.DataTypes.ED)MARC.Everest.Connectors.Util.FromWireFormat(d818f02caf3c44491a84316ffe52df50b, typeof(MARC.Everest.DataTypes.ED)); } else if(s.LocalName == "time" ) { object d68ecdb5ea1164a7792d040a39de2ec58 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.TS>), currentInteractionType, resultContext); instance.Time = d68ecdb5ea1164a7792d040a39de2ec58 is MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.TS> ? d68ecdb5ea1164a7792d040a39de2ec58 as MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.TS> : (MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.TS>)MARC.Everest.Connectors.Util.FromWireFormat(d68ecdb5ea1164a7792d040a39de2ec58, typeof(MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.TS>)); } else if(s.LocalName == "modeCode" ) { object d2ad5e146649547bead96c3e93bf1e0a5 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.CE<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ParticipationMode>), currentInteractionType, resultContext); instance.ModeCode = d2ad5e146649547bead96c3e93bf1e0a5 is MARC.Everest.DataTypes.CE<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ParticipationMode> ? d2ad5e146649547bead96c3e93bf1e0a5 as MARC.Everest.DataTypes.CE<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ParticipationMode> : (MARC.Everest.DataTypes.CE<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ParticipationMode>)MARC.Everest.Connectors.Util.FromWireFormat(d2ad5e146649547bead96c3e93bf1e0a5, typeof(MARC.Everest.DataTypes.CE<MARC.Everest.RMIM.UV.NE2008.Vocabulary.ParticipationMode>)); } else if(s.LocalName == "signatureCode" ) { object da2f1ac082ddb4ddda2722f1fa20e2ed4 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.CE<System.String>), currentInteractionType, resultContext); instance.SignatureCode = da2f1ac082ddb4ddda2722f1fa20e2ed4 is MARC.Everest.DataTypes.CE<System.String> ? da2f1ac082ddb4ddda2722f1fa20e2ed4 as MARC.Everest.DataTypes.CE<System.String> : (MARC.Everest.DataTypes.CE<System.String>)MARC.Everest.Connectors.Util.FromWireFormat(da2f1ac082ddb4ddda2722f1fa20e2ed4, typeof(MARC.Everest.DataTypes.CE<System.String>)); } else if(s.LocalName == "signatureText" ) { object d56a949e30a4d46a9a991048d55e138e5 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.ED), currentInteractionType, resultContext); instance.SignatureText = d56a949e30a4d46a9a991048d55e138e5 is MARC.Everest.DataTypes.ED ? d56a949e30a4d46a9a991048d55e138e5 as MARC.Everest.DataTypes.ED : (MARC.Everest.DataTypes.ED)MARC.Everest.Connectors.Util.FromWireFormat(d56a949e30a4d46a9a991048d55e138e5, typeof(MARC.Everest.DataTypes.ED)); } else if(s.LocalName == "assignedDevice" ) { object db535e3b9890f492fa3e6a6b0eb5d26c3 = Host.ParseObject(s, typeof(MARC.Everest.RMIM.UV.NE2008.COCT_MT090300UV01.AssignedDevice), currentInteractionType, resultContext); instance.ParticipationChoice = db535e3b9890f492fa3e6a6b0eb5d26c3 is MARC.Everest.RMIM.UV.NE2008.COCT_MT090300UV01.AssignedDevice ? db535e3b9890f492fa3e6a6b0eb5d26c3 as MARC.Everest.RMIM.UV.NE2008.COCT_MT090300UV01.AssignedDevice : (MARC.Everest.RMIM.UV.NE2008.COCT_MT090300UV01.AssignedDevice)MARC.Everest.Connectors.Util.FromWireFormat(db535e3b9890f492fa3e6a6b0eb5d26c3, typeof(MARC.Everest.RMIM.UV.NE2008.COCT_MT090300UV01.AssignedDevice)); } else if(s.LocalName == "assignedPerson" ) { object dab58a82ca8fd4f38a2943eb4ac952937 = Host.ParseObject(s, typeof(MARC.Everest.RMIM.UV.NE2008.COCT_MT090100UV01.AssignedPerson), currentInteractionType, resultContext); instance.ParticipationChoice = dab58a82ca8fd4f38a2943eb4ac952937 is MARC.Everest.RMIM.UV.NE2008.COCT_MT090100UV01.AssignedPerson ? dab58a82ca8fd4f38a2943eb4ac952937 as MARC.Everest.RMIM.UV.NE2008.COCT_MT090100UV01.AssignedPerson : (MARC.Everest.RMIM.UV.NE2008.COCT_MT090100UV01.AssignedPerson)MARC.Everest.Connectors.Util.FromWireFormat(dab58a82ca8fd4f38a2943eb4ac952937, typeof(MARC.Everest.RMIM.UV.NE2008.COCT_MT090100UV01.AssignedPerson)); } else if(s.LocalName == "realmCode" ) { object d612ee37f89ee4f55872be9e3a93c9fe5 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>), currentInteractionType, resultContext); instance.RealmCode = d612ee37f89ee4f55872be9e3a93c9fe5 is MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>> ? d612ee37f89ee4f55872be9e3a93c9fe5 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(d612ee37f89ee4f55872be9e3a93c9fe5, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>)); } else if(s.LocalName == "typeId" ) { object d6673e735e495477fb3420479fdfe6130 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.II), currentInteractionType, resultContext); instance.TypeId = d6673e735e495477fb3420479fdfe6130 is MARC.Everest.DataTypes.II ? d6673e735e495477fb3420479fdfe6130 as MARC.Everest.DataTypes.II : (MARC.Everest.DataTypes.II)MARC.Everest.Connectors.Util.FromWireFormat(d6673e735e495477fb3420479fdfe6130, typeof(MARC.Everest.DataTypes.II)); } else if(s.LocalName == "templateId" ) { object dd574430598c149b1b4687ae54675c15b = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>), currentInteractionType, resultContext); instance.TemplateId = dd574430598c149b1b4687ae54675c15b is MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II> ? dd574430598c149b1b4687ae54675c15b as MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II> : (MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>)MARC.Everest.Connectors.Util.FromWireFormat(dd574430598c149b1b4687ae54675c15b, 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; }
/// <summary> /// Generate PIX Message /// </summary> private static void GeneratePIX() { Console.WriteLine("\r\n\r\nGenerating PIXv3....\r\n\r\n"); // Create the instance message PRPA_IN201309UV02 message = new PRPA_IN201309UV02( Guid.NewGuid(), // The sample message uses a Guid for message Id, this is a method you can use to do this DateTime.Now, // The time the message was created, PRPA_IN201309UV02.GetInteractionId(), // Specify the interaction we're using ProcessingID.Training, // Operating in training mode "T", // Transactional AcknowledgementCondition.Always, // Always acknowledge new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Receiver( new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Device( new SET <II>(new II("1.2.840.114350.1.13.99999.4567")) // Identifier of the receiver device ) { // We can use initializer to construct extra properties Telecom = new BAG <TEL>( new TEL[] { "http://example.org/PIXQuery" } // The telecommunications address of the receiver ) } ), new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Sender( // The device that is sending the instance new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Device( new SET <II>(new II("1.2.840.114350.1.13.99997.2.7788")) ) ), new MARC.Everest.RMIM.UV.NE2008.QUQI_MT021001UV01.ControlActProcess <MARC.Everest.RMIM.UV.NE2008.PRPA_MT201307UV02.QueryByParameter>() ); // shortcut for control act process var cactProcess = message.controlActProcess; // Tell the receiver what trigger event we're executing cactProcess.Code = new CD <string>(PRPA_IN201309UV02.GetTriggerEvent().Code); // Set the author or performer var author = new MARC.Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.AuthorOrPerformer( "AUT" ); // Set the participant author.SetParticipationChoice(new MARC.Everest.RMIM.UV.NE2008.COCT_MT090100UV01.AssignedPerson() // Type of participant is an assigned entity { Id = new SET <II>( // Set the identifier of the user new II("1.2.840.114350.1.13.99997.2.7766", "USR5568") ) } ); // Set the query parameter cactProcess.queryByParameter = new MARC.Everest.RMIM.UV.NE2008.PRPA_MT201307UV02.QueryByParameter( new II("1.2.840.114350.1.13.99999.4567.34", "33452"), // The unique id for the query "new", // The status code of the query new MARC.Everest.RMIM.UV.NE2008.PRPA_MT201307UV02.ParameterList() ) { ResponsePriorityCode = "I" }; // Query by patient identifier cactProcess.queryByParameter.ParameterList.PatientIdentifier.Add( new MARC.Everest.RMIM.UV.NE2008.PRPA_MT201307UV02.PatientIdentifier( new SET <II>( new II("1.2.840.114350.1.13.99997.2.3412", "38273N237") ), "Patient.Id" ) ); FormatInstance(message); }