static TypeInfo TypeFactory(UIB interchangeHeader, UIH messageHeader) { if (messageHeader.MESSAGEIDENTIFIER_01.MessageVersionNumber_02 == "010" && messageHeader.MESSAGEIDENTIFIER_01.MessageReleaseNumber_03 == "006") { if (messageHeader.MESSAGEIDENTIFIER_01.MessageFunction_04 == "NEWRX") { return(typeof(TSNEWRX).GetTypeInfo()); } } throw new Exception("Message is not supported."); }
/// <summary> /// Build UIB /// </summary> /// <returns></returns> public static UIB BuildInterchangeHeader(string refNumber = "1234567", string senderId = "SENDER1", string senderQalifier = "Q1", string senderPass = "******", string receiverId = "RECEIVER2", string receiverQalifier = "Q2") { var result = new UIB { SYNTAXIDENTIFIER_01 = new S001 { // Syntax Identifier SyntaxIdentifier_01 = "UNOA", // Syntax Version Number SyntaxVersionNumber_02 = "0" }, TRANSACTIONREFERENCE_03 = new S303 { TransactionControlReference_01 = refNumber }, INTERCHANGESENDER_06 = new S002 { // Interchange sender identification SenderIdentification_01 = senderId, // Identification code qualifier IdentificationCodeQualifier_02 = senderQalifier, // Interchange sender password SenderIdentification_03 = senderPass }, INTERCHANGERECIPIENT_07 = new S003 { // Interchange recipient identification RecipientIdentification_01 = receiverId, // Identification code qualifier IdentificationCodeQualifier_02 = receiverQalifier }, DATEANDTIME_08 = new S300 { // Date Date_01 = DateTime.Now.Date.ToString("yyyyMMdd"), // Time Time_02 = DateTime.Now.TimeOfDay.ToString("hhmmss") } }; return(result); }
private static void ProcessPrescriptionRequest(UIB uib, TSNEWRX prescriptionRequest) { // Do something with the prescription request }
private static void ProcessPrescriptionChange(UIB uib, TSCHGRES prescriptionChange) { // Do something with the prescription change }