|
| 1 | +// Type: NHapi.Model.V23.Message.ACK |
| 2 | +// Assembly: NHapi.Model.V23, Version=2.4.0.0, Culture=neutral, PublicKeyToken=d0d8ea960a3440eb |
| 3 | +// MVID: C7C4DA77-585C-442A-A512-1978F0E9C9C6 |
| 4 | +// Assembly location: C:\Source\NHapiTools\References\NHapi.Model.V23.dll |
| 5 | + |
| 6 | +using NHapi.Base; |
| 7 | +using NHapi.Base.Log; |
| 8 | +using NHapi.Base.Model; |
| 9 | +using NHapi.Base.Parser; |
| 10 | +using NHapi.Model.V21.Segment; |
| 11 | +using System; |
| 12 | + |
| 13 | +namespace NHapiTools.Base.CustomImplementation.V21.Messages |
| 14 | +{ |
| 15 | + /// <summary> |
| 16 | + /// Represents a ACK message structure (see chapter ). This structure contains the |
| 17 | + /// following elements: |
| 18 | + /// <ol><li>0: MSH (Message header segment) </li><li>1: MSA (Message acknowledgement segment) </li><li>2: ERR (Error segment) optional </li></ol> |
| 19 | + /// </summary> |
| 20 | + [Serializable] |
| 21 | + public class ACK : AbstractMessage |
| 22 | + { |
| 23 | + public override string Version |
| 24 | + { |
| 25 | + get |
| 26 | + { |
| 27 | + return "2.1"; |
| 28 | + } |
| 29 | + } |
| 30 | + |
| 31 | + /// <summary> |
| 32 | + /// Returns MSH (Message header segment) - creates it if necessary |
| 33 | + /// |
| 34 | + /// </summary> |
| 35 | + public MSH MSH |
| 36 | + { |
| 37 | + get |
| 38 | + { |
| 39 | + try |
| 40 | + { |
| 41 | + return (MSH)this.GetStructure("MSH"); |
| 42 | + } |
| 43 | + catch (HL7Exception ex) |
| 44 | + { |
| 45 | + HapiLogFactory.GetHapiLog(this.GetType()).Error((object)"Unexpected error accessing data - this is probably a bug in the source code generator.", (Exception)ex); |
| 46 | + throw new Exception("An unexpected error ocurred", (Exception)ex); |
| 47 | + } |
| 48 | + } |
| 49 | + } |
| 50 | + |
| 51 | + /// <summary> |
| 52 | + /// Returns MSA (Message acknowledgement segment) - creates it if necessary |
| 53 | + /// |
| 54 | + /// </summary> |
| 55 | + public MSA MSA |
| 56 | + { |
| 57 | + get |
| 58 | + { |
| 59 | + try |
| 60 | + { |
| 61 | + return (MSA)this.GetStructure("MSA"); |
| 62 | + } |
| 63 | + catch (HL7Exception ex) |
| 64 | + { |
| 65 | + HapiLogFactory.GetHapiLog(this.GetType()).Error((object)"Unexpected error accessing data - this is probably a bug in the source code generator.", (Exception)ex); |
| 66 | + throw new Exception("An unexpected error ocurred", (Exception)ex); |
| 67 | + } |
| 68 | + } |
| 69 | + } |
| 70 | + |
| 71 | + /// <summary> |
| 72 | + /// Returns ERR (Error segment) - creates it if necessary |
| 73 | + /// |
| 74 | + /// </summary> |
| 75 | + public ERR ERR |
| 76 | + { |
| 77 | + get |
| 78 | + { |
| 79 | + try |
| 80 | + { |
| 81 | + return (ERR)this.GetStructure("ERR"); |
| 82 | + } |
| 83 | + catch (HL7Exception ex) |
| 84 | + { |
| 85 | + HapiLogFactory.GetHapiLog(this.GetType()).Error((object)"Unexpected error accessing data - this is probably a bug in the source code generator.", (Exception)ex); |
| 86 | + throw new Exception("An unexpected error ocurred", (Exception)ex); |
| 87 | + } |
| 88 | + } |
| 89 | + } |
| 90 | + |
| 91 | + /// <summary> |
| 92 | + /// Creates a new ACK Group with custom IModelClassFactory. |
| 93 | + /// |
| 94 | + /// </summary> |
| 95 | + public ACK(IModelClassFactory factory) |
| 96 | + : base(factory) |
| 97 | + { |
| 98 | + this.init(factory); |
| 99 | + } |
| 100 | + |
| 101 | + /// <summary> |
| 102 | + /// Creates a new ACK Group with DefaultModelClassFactory. |
| 103 | + /// |
| 104 | + /// </summary> |
| 105 | + public ACK() |
| 106 | + : base((IModelClassFactory)new DefaultModelClassFactory()) |
| 107 | + { |
| 108 | + this.init((IModelClassFactory)new DefaultModelClassFactory()); |
| 109 | + } |
| 110 | + |
| 111 | + /// <summary> |
| 112 | + /// initalize method for ACK. This does the segment setup for the message. |
| 113 | + /// |
| 114 | + /// </summary> |
| 115 | + private void init(IModelClassFactory factory) |
| 116 | + { |
| 117 | + try |
| 118 | + { |
| 119 | + this.add(typeof(MSH), true, false); |
| 120 | + this.add(typeof(MSA), true, false); |
| 121 | + this.add(typeof(ERR), false, false); |
| 122 | + } |
| 123 | + catch (HL7Exception ex) |
| 124 | + { |
| 125 | + HapiLogFactory.GetHapiLog(this.GetType()).Error((object)"Unexpected error creating ACK - this is probably a bug in the source code generator.", (Exception)ex); |
| 126 | + } |
| 127 | + } |
| 128 | + } |
| 129 | +} |
0 commit comments