Commit d9db8e64 authored by Suresh Kadagala's avatar Suresh Kadagala

Inital commit

parents
Pipeline #11 failed with stages
using System;
using System.Collections.Generic;
using System.Text;
namespace HL7 {
public class AddendumSegment:Segment {
#region Private Instance Variables
private Field _ContinuationOfPreviousLogicalRecord = new Field();
#endregion
#region Public Instance Properties
public Field ContinuationOfPreviousLogicalRecord {
get {
return _ContinuationOfPreviousLogicalRecord;
}
private set {
_ContinuationOfPreviousLogicalRecord = value;
}
}
public override List<Field> KnownFields {
get {
return new List<Field>(new Field[] { SegmentTypeID, ContinuationOfPreviousLogicalRecord });
}
}
#endregion
#region Constructors
public AddendumSegment() {
this.SegmentTypeID = new Field("Segment Type ID", "ADD.1", "To identify the segment", RequiredFlags.Optional, 3, string.Empty, SupportedCharacters.AlphaOnly, 0, string.Empty);
this.ContinuationOfPreviousLogicalRecord = new Field("Continuation of Previous Logical Record", "ADD.2", "Continuation of Previous Logical Record", RequiredFlags.Optional, 215, string.Empty, SupportedCharacters.AlphaNumericSpecial, 0, string.Empty);
}
public AddendumSegment(string message, string fieldDelimiter)
: this() {
List<string> fields = new List<string>(message.Split(new string[] { fieldDelimiter }, StringSplitOptions.None));
if (fields.Count < 2) {
throw new ArgumentException("Not enough fields to construct a valid addendum segment (ADD). Expected at least 2, returned " + fields.Count);
}
this.SegmentTypeID.Value = fields[0];
this.ContinuationOfPreviousLogicalRecord.Value = fields[1];
//Any additional segments that we don't know about
//Doesn't handle nested segments
if (fields.Count > 2) {
for (int x = 2; x < fields.Count - 1; x++) {
Field newField = new Field("Additional unknown field", "ADD." + x, "Unknown", RequiredFlags.Unknown, -1, fieldDelimiter, SupportedCharacters.Unknown, -1, fields[x]);
AdditionalFields.Add(newField);
}
}
//Field Delimiter
this.SegmentTypeID.Delimiter = fieldDelimiter;
//Last one is always a newline
this.ContinuationOfPreviousLogicalRecord.Delimiter = System.Environment.NewLine;
}
#endregion
public override string SegmentType {
get {
return "ADD";
}
}
public override string Title {
get {
return "Addendum";
}
}
}
}
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Text;
namespace HL7 {
public class BloodLeadSegment : Segment {
#region Private Instance Variables
private Field _PatientRace = new Field();
private Field _Hispanic = new Field();
private Field _BloodLeadType = new Field();
private Field _BloodLeadPurpose = new Field();
private Field _BloodLeadCountyCodeNumber = new Field();
#endregion
#region Public Instance Properties
public Field PatientRace {
get {
return _PatientRace;
}
private set {
_PatientRace = value;
}
}
public Field Hispanic {
get {
return _Hispanic;
}
private set {
_Hispanic = value;
}
}
public Field BloodLeadType {
get {
return _BloodLeadType;
}
private set {
_BloodLeadType = value;
}
}
public Field BloodLeadPurpose {
get {
return _BloodLeadPurpose;
}
private set {
_BloodLeadPurpose = value;
}
}
public Field BloodLeadCountyCodeNumber {
get {
return _BloodLeadCountyCodeNumber;
}
private set {
_BloodLeadCountyCodeNumber = value;
}
}
public override List<Field> KnownFields {
get {
return new List<Field>(new Field[] { SegmentTypeID, PatientRace, Hispanic, BloodLeadType, BloodLeadPurpose, BloodLeadCountyCodeNumber });
}
}
public override string SegmentType {
get {
return "ZBL";
}
}
public override string Title {
get {
return "Blood Lead";
}
}
#endregion
#region Constructors
public BloodLeadSegment() {
this.SegmentTypeID = new Field("Segment Type ID", "ZBL.1", "To identify the segment", RequiredFlags.AlwaysRequired, 3, string.Empty, SupportedCharacters.AlphaOnly, 0, "ZBL");
this.PatientRace = new Field("Patient Race", "ZBL.2", "Race is required for blood lead testing procedures", RequiredFlags.AlwaysRequired, 1, string.Empty, SupportedCharacters.NumericOnly, 0, string.Empty);
this.Hispanic = new Field("Hispanic", "ZBL.3", "This field is self-identification rather than scientific classification", RequiredFlags.AlwaysRequired, 1, string.Empty, SupportedCharacters.NumericOnly, 0, string.Empty);
this.BloodLeadType = new Field("Blood Lead Type", "ZBL.4", "Indication of how specimen was collected", RequiredFlags.AlwaysRequired, 1, string.Empty, SupportedCharacters.AlphaOnly, 0, string.Empty);
this.BloodLeadPurpose = new Field("Blood Lead Purpose", "ZBL.5", "Indication of reason for testing", RequiredFlags.Optional, 1, string.Empty, SupportedCharacters.AlphaOnly, 0, string.Empty);
this.BloodLeadCountyCodeNumber = new Field("BloodLeadCountyCodeNumber", "ZBL.6", "For state reporting of blood lead results", RequiredFlags.Conditional, 10, string.Empty, SupportedCharacters.NumericOnly, 0, string.Empty);
}
public BloodLeadSegment(string fieldDelimiter)
: this() {
//Field Delimiters
foreach (Field diagnosis in KnownFields) {
diagnosis.Delimiter = fieldDelimiter;
}
//Last one is always a newline
this.BloodLeadCountyCodeNumber.Delimiter = System.Environment.NewLine;
}
public BloodLeadSegment(string message, string fieldDelimiter)
: this(fieldDelimiter) {
List<string> fields = new List<string>(message.Split(new string[] { fieldDelimiter }, StringSplitOptions.None));
if (fields.Count < 6) {
throw new ArgumentException("Not enough fields to construct a valid patient general clinical information segment (ZBL). Expected at least 6, returned " + fields.Count);
}
this.SegmentTypeID.Value = fields[0];
this.PatientRace.Value = fields[1];
this.Hispanic.Value = fields[2];
this.BloodLeadType.Value = fields[3];
this.BloodLeadPurpose.Value = fields[4];
this.BloodLeadCountyCodeNumber.Value = fields[5];
//Any additional segments that we don't know about
//Doesn't handle nested segments
if (fields.Count > 6) {
for (int x = 6; x < fields.Count - 1; x++) {
Field newField = new Field("Additional unknown field", "ZBL." + x, "Unknown", RequiredFlags.Unknown, -1, fieldDelimiter, SupportedCharacters.Unknown, -1, fields[x]);
AdditionalFields.Add(newField);
}
}
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace HL7 {
//So we can use data-binding with value for easy setting/retrivial
public struct CodeDescription {
private char _Code;
private string _Description;
public CodeDescription(char code, string description)
: this() {
_Code = code;
_Description = description == null ? string.Empty : description.Trim().ToUpper();
}
public char Code {
get { return _Code; }
set {
_Code = value;
}
}
public string Description {
get { return _Description.Trim().ToUpper(); }
set {
_Description = value == null ? string.Empty : value.Trim().ToUpper();
}
}
public static bool ContainsCode(char code, List<CodeDescription> list) {
foreach (CodeDescription cd in list) {
if (cd.Code == code) { return true; }
}
return false;
}
public static bool ContainsCode(string code, List<CodeDescription> list) {
char c;
bool parsed = char.TryParse(code, out c);
if (!parsed) {
System.Diagnostics.Debug.WriteLine("CodeDescription - ContainsCode - char.TryParse failed on string: " + code);
return false;
}
return ContainsCode(c, list);
}
}
}
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Text;
namespace HL7 {
public class DiagnosisSegment : Segment {
#region Private Instance Variables
private Field _SequenceNumber = new Field();
private Field _DiagnosisCodingMethod = new Field();
private Field _DiagnosisCode = new Field();
#endregion
#region Public Instance Properties
public Field SequenceNumber {
get {
return _SequenceNumber;
}
private set {
_SequenceNumber = value;
}
}
public Field DiagnosisCodingMethod {
get {
return _DiagnosisCodingMethod;
}
private set {
_DiagnosisCodingMethod = value;
}
}
public Field DiagnosisCode {
get {
return _DiagnosisCode;
}
private set {
_DiagnosisCode = value;
}
}
public override List<Field> KnownFields {
get {
return new List<Field>(new Field[] { SegmentTypeID, SequenceNumber, DiagnosisCodingMethod, DiagnosisCode });
}
}
public override string SegmentType {
get {
return "DG1";
}
}
public override string Title {
get {
return "Diagnosis";
}
}
#endregion
#region Constructors
//Assumes ICD-9 in coding method
public DiagnosisSegment() {
this.SegmentTypeID = new Field("Segment Type ID", "DG1.0", "To identify the segment", RequiredFlags.AlwaysRequired, 3, string.Empty, SupportedCharacters.AlphaNumeric, 0, "DG1");
this.SequenceNumber = new Field("Sequence Number", "DG1.1", "To identify the numbet of DG1 segments contained within the order file", RequiredFlags.AlwaysRequired, 4, string.Empty, SupportedCharacters.NumericOnly, 375, string.Empty);
this.DiagnosisCodingMethod = new Field("Diagnosis Coding Method", "DG1.2", "To indicate a coding method", RequiredFlags.AlwaysRequired, 2, string.Empty, SupportedCharacters.AlphaNumeric, 376, "I9");
this.DiagnosisCode = new Field("Diagnosis Code", "DG1.3", "Physician's indication of patient's diagnosis which is used by some payors to validate the need for ordering laboratory procedures", RequiredFlags.Optional, 8, string.Empty, SupportedCharacters.AlphaNumericSpecial, 377, string.Empty);
}
public DiagnosisSegment(string message, string fieldDelimiter)
: this(fieldDelimiter) {
List<string> fields = new List<string>(message.Split(new string[] { fieldDelimiter }, StringSplitOptions.None));
if (fields.Count < 4) {
throw new ArgumentException("Not enough fields to construct a valid diagnosis segment (DG1). Expected at least 4, returned " + fields.Count);
}
this.SegmentTypeID.Value = fields[0];
this.SequenceNumber.Value = fields[1];
this.DiagnosisCodingMethod.Value = fields[2];
this.DiagnosisCode.Value = fields[3];
//Any additional segments that we don't know about
//Doesn't handle nested segments
if (fields.Count > 4) {
for (int x = 4; x < fields.Count - 1; x++) {
Field newField = new Field("Additional unknown field", "DG1." + x, "Unknown", RequiredFlags.Unknown, -1, fieldDelimiter, SupportedCharacters.Unknown, -1, fields[x]);
AdditionalFields.Add(newField);
}
}
}
public DiagnosisSegment(uint sequenceNumber, string fieldDelimiter)
: this(fieldDelimiter) {
this.SequenceNumber.Value = sequenceNumber.ToString();
}
public DiagnosisSegment(string fieldDelimiter)
: this() {
//Field Delimiters
foreach (Field diagnosis in KnownFields) {
diagnosis.Delimiter = fieldDelimiter;
}
//Last one is always a newline
this.DiagnosisCode.Delimiter = System.Environment.NewLine;
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace HL7 {
//This was implemented for Boswik Labratories.
//They used a differnt numbering scheme for the nmenomic, they start from 0, Labcorp started from 1
public class EmbeddedImageSegment : Segment {
#region Private Instance Variables
private Field _SequenceNumber = new Field();
private Field _Base64Image = new Field();
private Field _ReportStatus = new Field();
#endregion
#region Public Instance Properties
public Field SequenceNumber {
get {
return _SequenceNumber;
}
private set {
_SequenceNumber = value;
}
}
public Field Base64Image {
get {
return _Base64Image;
}
private set {
_Base64Image = value;
}
}
public Field ReportStatus {
get {
return _ReportStatus;
}
private set {
_ReportStatus = value;
}
}
public override List<Field> KnownFields {
get {
return new List<Field>(new Field[] { SegmentTypeID, SequenceNumber, Base64Image, ReportStatus });
}
}
#endregion
#region Constructors
public EmbeddedImageSegment() {
this.SegmentTypeID = new Field("Segment Type ID", "ZEF.0", "To identify the segment", RequiredFlags.Optional, 3, string.Empty, SupportedCharacters.AlphaOnly, 0, SegmentType);
this.SequenceNumber = new Field("Sequence Number", "ZEF.1", "To identify the number of ZEF segments contained within the result file", RequiredFlags.AlwaysRequired, 4, string.Empty, SupportedCharacters.NumericOnly, 1, string.Empty);
this.Base64Image = new Field("Base64 Image", "ZEF.2", "Base64 encrypted message data", RequiredFlags.AlwaysRequired, 99999999, string.Empty, SupportedCharacters.AlphaNumericSpecial, 2, string.Empty);
this.ReportStatus = new Field("Report Status", "ZEF.3", "Report Status", RequiredFlags.AlwaysRequired, 10, string.Empty, SupportedCharacters.AlphaOnly, 3, string.Empty);
}
public EmbeddedImageSegment(string fieldDelimiter) : this() {
//Non-nested field delimiters
foreach (Field field in KnownFields) {
field.Delimiter = fieldDelimiter;
}
}
public EmbeddedImageSegment(string message, string fieldDelimiter)
: this(fieldDelimiter) {
List<string> fields = new List<string>(message.Split(new string[] { fieldDelimiter }, StringSplitOptions.None));
if (fields.Count < 3) {
throw new ArgumentException("Not enough fields to construct a valid embedded image segment (ZEF). Expected at least 3, returned " + fields.Count);
}
this.SegmentTypeID.Value = fields[0];
this.SequenceNumber.Value = fields[1];
this.Base64Image.Value = fields[2];
if (fields.Count == 4) {
this.ReportStatus.Value = fields[3];
}
//Any additional segments that we don't know about
//Doesn't handle nested segments
if (fields.Count > 4) {
for (int x = 2; x < fields.Count - 1; x++) {
Field newField = new Field("Additional unknown field", "ZEF." + x, "Unknown", RequiredFlags.Unknown, -1, fieldDelimiter, SupportedCharacters.Unknown, -1, fields[x]);
AdditionalFields.Add(newField);
}
}
}
#endregion
public override string SegmentType {
get {
return "ZEF";
}
}
public override string Title {
get {
return "Embedded Image";
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace HL7 {
public class Field {
#region Private Instance Variables
private string _Title;
private string _Mnemonic;
private string _Usage;
private RequiredFlags _RequiredFlag = RequiredFlags.Unknown;
private int _MaxLength = -1;
private string _Delimiter;
private SupportedCharacters _SupportedCharacters = SupportedCharacters.Unused;
private int _HL7DataElement = -1;
private string _Value;
#endregion
#region Constructors
public Field(String title, string mnemonic, string usage, RequiredFlags requiredFlag, int maxLength, string fieldDelimiter, SupportedCharacters validCharacters, int hl7DataElement, string value)
: this() {
this.Title = title;
this.Mnemonic = mnemonic;
this.Usage = usage;
this.RequiredFlag = requiredFlag;
this.MaxLength = maxLength;
this.Delimiter = fieldDelimiter;
this._SupportedCharacters = validCharacters;
this.HL7DataElement = hl7DataElement;
this.Value = value;
}
public Field() {//Just to have a New()
this.Value = string.Empty;
}
#endregion
#region Public Instance Properties
public string Title {
get {
return _Title;
}
private set {
_Title = value;
}
}
public string Mnemonic {
get {
return _Mnemonic;
}
private set {
_Mnemonic = value;
}
}
public string Usage {
get {
return _Usage;
}
private set {
_Usage = value;
}
}
public RequiredFlags RequiredFlag {
get {
return _RequiredFlag;
}
private set {
_RequiredFlag = value;
}
}
public int MaxLength {
get {
return _MaxLength;
}
private set {
_MaxLength = value;
}
}
public string Delimiter {
get {
return _Delimiter;
}
set {
_Delimiter = value;
}
}
public string ValidCharacters {
get {
return GetSupportedCharacters(_SupportedCharacters);
}
}
public int HL7DataElement {
get {
return _HL7DataElement;
}
private set {
_HL7DataElement = value;
}
}
public string Value {
get {
return _Value;
}
set {
_Value = value;
}
}
static string GetSupportedCharacters(SupportedCharacters supported) {
switch (supported) {
case SupportedCharacters.AlphaOnly:
return "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
case SupportedCharacters.NumericOnly:
return "0123456789";
case SupportedCharacters.SpecialOnly:
return @"~!@#$%^&*()_+{}|:<>?[]\;',./""";
case SupportedCharacters.AlphaNumeric:
return GetSupportedCharacters(SupportedCharacters.AlphaOnly) + GetSupportedCharacters(SupportedCharacters.NumericOnly);
case SupportedCharacters.AlphaSpecial:
return GetSupportedCharacters(SupportedCharacters.AlphaOnly) + GetSupportedCharacters(SupportedCharacters.SpecialOnly);
case SupportedCharacters.NumericSpecial:
return GetSupportedCharacters(SupportedCharacters.NumericOnly) + GetSupportedCharacters(SupportedCharacters.SpecialOnly);
case SupportedCharacters.AlphaNumericSpecial:
return GetSupportedCharacters(SupportedCharacters.AlphaOnly) + GetSupportedCharacters(SupportedCharacters.NumericOnly) + GetSupportedCharacters(SupportedCharacters.SpecialOnly);
case SupportedCharacters.Unused:
return string.Empty;
}
return string.Empty;
}
public string RightSideDelimitedValue {
get {
return this.Value + this.Delimiter;
}
}
#endregion
#region Public Instance Methods
public override string ToString() {
return this.Value;
}
#endregion
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3658B167-B295-4855-B89F-08A82B170E50}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HL7</RootNamespace>
<AssemblyName>HL7</AssemblyName>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<IsWebBootstrapper>true</IsWebBootstrapper>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<PublishUrl>http://localhost/HL7/</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<UseVSHostingProcess>false</UseVSHostingProcess>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Debug\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AddendumSegment.cs" />
<Compile Include="BethesdaCytologySegment.cs" />
<Compile Include="BloodLeadSegment.cs" />
<Compile Include="CodeDescription.cs" />
<Compile Include="CommonOrderSegment.cs" />
<Compile Include="DiagnosisSegment.cs" />
<Compile Include="EmbeddedImageSegment.cs" />
<Compile Include="Field.cs" />
<Compile Include="GuarantorSegment.cs" />
<Compile Include="HL7Message.cs" />
<Compile Include="InsuranceSegment.cs" />
<Compile Include="LabcorpReportHL7.cs" />
<Compile Include="MessageAcknowledgementSegment.cs" />
<Compile Include="MessageHeaderSegment.cs" />
<Compile Include="NotesAndCommentsSegment.cs" />
<Compile Include="ObservationOrderSegment.cs" />
<Compile Include="ObservationResultSegment.cs" />
<Compile Include="PatientGeneralClinicalInformationSegment.cs" />
<Compile Include="PatientIdentificationSegment.cs" />
<Compile Include="PatientVisitSegment.cs" />
<Compile Include="PlaceOfServiceFacilitySegment.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RelationshipToPatient.cs" />
<Compile Include="RequiredFlags.cs" />
<Compile Include="Segment.cs" />
<Compile Include="SuperAlphaFetaProteinSegment.cs" />
<Compile Include="SupportedCharacters.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SupraClasses\SupraClasses\SupraClasses.csproj">
<Project>{743557EE-BFFB-41A6-A751-1B3EDBD1AECD}</Project>
<Name>SupraClasses</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>
</PublishUrlHistory>
<InstallUrlHistory>
</InstallUrlHistory>
<SupportUrlHistory>
</SupportUrlHistory>
<UpdateUrlHistory>
</UpdateUrlHistory>
<BootstrapperUrlHistory>
</BootstrapperUrlHistory>
<ErrorReportUrlHistory>
</ErrorReportUrlHistory>
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>true</VerifyUploadedFiles>
</PropertyGroup>
</Project>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HL7Objects", "HL7Objects.csproj", "{3658B167-B295-4855-B89F-08A82B170E50}"
EndProject
Global
GlobalSection(SubversionScc) = preSolution
Svn-Managed = True
Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3658B167-B295-4855-B89F-08A82B170E50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3658B167-B295-4855-B89F-08A82B170E50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3658B167-B295-4855-B89F-08A82B170E50}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3658B167-B295-4855-B89F-08A82B170E50}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
File added
This diff is collapsed.
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Text;
namespace HL7 {
//This was implemented for Boswik & Quest Labratories.
//They used a differnt numbering scheme for the nmenomic, they start from 0, Labcorp started from 1
public class MessageAcknowledgementSegment : Segment {
#region Private Instance Variables
private Field _AcknowledgmentCode = new Field();
private Field _MessageControlID = new Field();
private Field _TextMessage = new Field();
private Field _ExpectedSequenceNumber = new Field();
private Field _DelayedAcknowledgementType = new Field();
private Field _ErrorCondition = new Field();
#endregion
#region Public Instance Properties
public Field AcknowledgmentCode {
get {
return _AcknowledgmentCode;
}
private set {
_AcknowledgmentCode = value;
}
}
public Field MessageControlID {
get {
return _MessageControlID;
}
private set {
_MessageControlID = value;
}
}
public Field TextMessage {
get {
return _TextMessage;
}
private set {
_TextMessage = value;
}
}
public Field ExpectedSequenceNumber {
get {
return _ExpectedSequenceNumber;
}
private set {
_ExpectedSequenceNumber = value;
}
}
public Field DelayedAcknowledgementType {
get {
return _DelayedAcknowledgementType;
}
private set {
_DelayedAcknowledgementType = value;
}
}
public Field ErrorCondition {
get {
return _ErrorCondition;
}
private set {
_ErrorCondition = value;
}
}
public override List<Field> KnownFields {
get {
return new List<Field>(new Field[] { SegmentTypeID, AcknowledgmentCode, MessageControlID, TextMessage, ExpectedSequenceNumber, DelayedAcknowledgementType, ErrorCondition });
}
}
#endregion
#region Constructors
public MessageAcknowledgementSegment() {
this.SegmentTypeID = new Field("Segment Type ID", "MSA.0", "To identify the segment", RequiredFlags.Optional, 3, string.Empty, SupportedCharacters.AlphaOnly, 0, this.SegmentType);
this.AcknowledgmentCode = new Field("Acknowledgment Code", "MSA.1", "ACK Code", RequiredFlags.Optional, 2, string.Empty, SupportedCharacters.AlphaOnly, 18, string.Empty);
this.MessageControlID = new Field("Message Control ID", "MSA.2", "Identify the matching order message", RequiredFlags.Optional, 20, string.Empty, SupportedCharacters.AlphaNumeric, 10, string.Empty);
this.TextMessage = new Field("Text Message", "MSA.3", "Not currently used", RequiredFlags.Unused, 80, string.Empty, SupportedCharacters.Unused, 20, string.Empty);
this.ExpectedSequenceNumber = new Field("Expected Sequence Number", "MSA.4", "Not currently used", RequiredFlags.Unused, 15, string.Empty, SupportedCharacters.Unused, 21, string.Empty);
this.DelayedAcknowledgementType = new Field("Delayed Acknowledgement Type", "MSA.5", "Not currently used", RequiredFlags.Unused, 1, string.Empty, SupportedCharacters.Unused, 22, string.Empty);
this.ErrorCondition = new Field("Error Condition", "MSA.6", "Not currently used", RequiredFlags.Unused, 100, string.Empty, SupportedCharacters.Unused, 23, string.Empty);
}
public MessageAcknowledgementSegment(string fieldDelimiter)
: this() {
//Non-nested field delimiters
foreach (Field field in KnownFields) {
field.Delimiter = fieldDelimiter;
}
}
public MessageAcknowledgementSegment(string message, string fieldDelimiter)
: this(fieldDelimiter) {
List<string> fields = new List<string>(message.Split(new string[] { fieldDelimiter }, StringSplitOptions.None));
if (fields.Count < 2) {
throw new ArgumentException("Not enough fields to construct a valid message acknowledgement segment (MSA). Expected at least 3, returned " + fields.Count);
}
this.SegmentTypeID.Value = fields[0];
this.AcknowledgmentCode.Value = fields[1];
this.MessageControlID.Value = fields[2];
if (fields.Count >= 4) { this.TextMessage.Value = fields[3]; }
if (fields.Count >= 5) { this.ExpectedSequenceNumber.Value = fields[4]; }
if (fields.Count >= 6) { this.DelayedAcknowledgementType.Value = fields[5]; }
if (fields.Count >= 7) { this.ErrorCondition.Value = fields[6]; }
//Any additional segments that we don't know about
//Doesn't handle nested segments
if (fields.Count > 7) {
for (int x = 2; x < fields.Count - 1; x++) {
Field newField = new Field("Additional unknown field", "MSA." + x, "Unknown", RequiredFlags.Unknown, -1, fieldDelimiter, SupportedCharacters.Unknown, -1, fields[x]);
AdditionalFields.Add(newField);
}
}
}
#endregion
public override string SegmentType {
get {
return "MSA";
}
}
public override string Title {
get {
return "Acknowledgement";
}
}
}
}
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Text;
namespace HL7 {
public class NotesAndCommentsSegment : Segment {
#region Private Instance Variables
private Field _SequenceNumber = new Field();
private Field _CommentSource = new Field();
private Field _CommentText = new Field();
#endregion
#region Public Instance Properties
public Field SequenceNumber {
get {
return _SequenceNumber;
}
private set {
_SequenceNumber = value;
}
}
public Field CommentSource {
get {
return _CommentSource;
}
private set {
_CommentSource = value;
}
}
public Field CommentText {
get {
return _CommentText;
}
private set {
_CommentText = value;
}
}
public override List<Field> KnownFields {
get {
return new List<Field>(new Field[] { SegmentTypeID, SequenceNumber, CommentSource, CommentText });
}
}
public override string SegmentType {
get {
return "NTE";
}
}
public override string Title {
get {
return "Notes & Comments";
}
}
#endregion
#region Constructors
public NotesAndCommentsSegment() {
this.SegmentTypeID = new Field("Segment Type ID", "NTE.1", "To identify the segment", RequiredFlags.Optional, 3, string.Empty, SupportedCharacters.AlphaOnly, 0, this.SegmentType);
this.SequenceNumber = new Field("Sequence Number", "NTE.2", "To identify the numbet of NTE segments contained within the order file", RequiredFlags.Optional, 4, string.Empty, SupportedCharacters.NumericOnly, 96, string.Empty);
this.CommentSource = new Field("Comment Source", "NTE.3", "To identify the source of the comment", RequiredFlags.Optional, 1, string.Empty, SupportedCharacters.AlphaOnly, 97, string.Empty);
this.CommentText = new Field("Comment Text", "NTE.4", "Actual comment text", RequiredFlags.Optional, 78, string.Empty, SupportedCharacters.AlphaNumericSpecial, 98, string.Empty);
}
public NotesAndCommentsSegment(string fieldDelimiter):this() {
//Field Delimiters
foreach (Field noteAndComment in KnownFields) {
noteAndComment.Delimiter = fieldDelimiter;
}
//Last one is always a newline
this.CommentText.Delimiter = System.Environment.NewLine;
}
public NotesAndCommentsSegment(string message, string fieldDelimiter)
: this(fieldDelimiter) {
List<string> fields = new List<string>(message.Split(new string[] { fieldDelimiter }, StringSplitOptions.None));
if (fields.Count < 3) {
throw new ArgumentException("Not enough fields to construct a valid notes and comments segment (NTE). Expected at least 3, returned " + fields.Count);
}
this.SegmentTypeID.Value = fields[0];
this.SequenceNumber.Value = fields[1];
this.CommentSource.Value = fields[2];
if (fields.Count >= 4) { this.CommentText.Value = fields[3]; }
//Any additional segments that we don't know about
//Doesn't handle nested segments
if (fields.Count > 4) {
for (int x = 4; x < fields.Count - 1; x++) {
Field newField = new Field("Additional unknown field", "NTE." + x, "Unknown", RequiredFlags.Unknown, -1, fieldDelimiter, SupportedCharacters.Unknown, -1, fields[x]);
AdditionalFields.Add(newField);
}
}
}
#endregion
}
}
This diff is collapsed.
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Text;
namespace HL7 {
public class PatientGeneralClinicalInformationSegment : Segment {
#region Private Instance Variables
private Field _Height = new Field();
private Field _WeightValue = new Field();
private Field _WeightUnitOfMeasure = new Field();
private Field _CollectionValue = new Field();
private Field _CollectionUnitOfMeasure = new Field();
private Field _Fasting = new Field();
#endregion
#region Public Instance Properties
public Field Height {
get {
return _Height;
}
private set {
_Height = value;
}
}
public Field WeightValue {
get {
return _WeightValue;
}
private set {
_WeightValue = value;
}
}
public Field WeightUnitOfMeasure {
get {
return _WeightUnitOfMeasure;
}
private set {
_WeightUnitOfMeasure = value;
}
}
public Field CollectionValue {
get {
return _CollectionValue;
}
private set {
_CollectionValue = value;
}
}
public Field CollectionUnitOfMeasure {
get {
return _CollectionUnitOfMeasure;
}
private set {
_CollectionUnitOfMeasure = value;
}
}
public Field Fasting {
get {
return _Fasting;
}
private set {
_Fasting = value;
}
}
public override List<Field> KnownFields {
get {
return new List<Field>(new Field[] { SegmentTypeID, Height, WeightValue, WeightUnitOfMeasure, CollectionValue, CollectionUnitOfMeasure, Fasting });
}
}
public override string SegmentType {
get {
return "ZCI";
}
}
public override string Title {
get {
return "Patient General Clinical Information";
}
}
#endregion
#region Constructors
public PatientGeneralClinicalInformationSegment() {
this.SegmentTypeID = new Field("Segment Type ID", "ZCI.1", "To identify the segment", RequiredFlags.AlwaysRequired, 3, string.Empty, SupportedCharacters.AlphaOnly, 0, "ZCI");
this.Height = new Field("Height", "ZCI.2", "Height", RequiredFlags.Unused, -1, string.Empty, SupportedCharacters.Unused, 0, string.Empty);
this.WeightValue = new Field("Weight Value", "ZCI.3", "In specific testing procedures in calculation of result", RequiredFlags.Conditional, 3, string.Empty, SupportedCharacters.NumericOnly, 0, string.Empty);
this.WeightUnitOfMeasure = new Field("Weight Unit of Measure", "ZCI.3", "Indication of unit of measure", RequiredFlags.Conditional, 10, string.Empty, SupportedCharacters.AlphaNumericSpecial, 0, string.Empty);
this.CollectionValue = new Field("Collection Value", "ZCI.4", "In specific testing procedures in calculation of result", RequiredFlags.Conditional, 4, string.Empty, SupportedCharacters.NumericOnly, 0, string.Empty);
this.CollectionUnitOfMeasure = new Field("Collection Unit of Measure", "ZCI.4", "Indication of unit of measure", RequiredFlags.Conditional, 10, string.Empty, SupportedCharacters.AlphaNumericSpecial, 0, string.Empty);
this.Fasting = new Field("Fasting", "ZCI.5", "In specific testing procedures in calculation of result", RequiredFlags.Conditional, 1, string.Empty, SupportedCharacters.AlphaOnly, 0, string.Empty);
}
public PatientGeneralClinicalInformationSegment(string message,string fieldDelimiter,string componentDelimiter)
: this(fieldDelimiter, componentDelimiter) {
List<string> fields = new List<string>(message.Split(new string[] { fieldDelimiter }, StringSplitOptions.None));
if (fields.Count < 5) {
throw new ArgumentException("Not enough fields to construct a valid patient general clinical information segment (ZCI). Expected at least 5, returned " + fields.Count);
}
this.SegmentTypeID.Value = fields[0];
this.Height.Value = fields[1];
if (fields[2].Contains(componentDelimiter) == false) {
throw new ArgumentException("Missing component delimiter in field 'ZCI.3'");
}
List<string> components = new List<string>(fields[2].Split(new string[] { componentDelimiter }, StringSplitOptions.None));
//A field can have seperate components, essentially nested fields with a differnt delimiter
if (components.Count != 2) {
throw new ArgumentException("Unexpected number of components returned for the field 'ZCI.3'. Expected 2, returned " + components.Count);
}
WeightValue.Value = components[0];
WeightUnitOfMeasure.Value = components[1];
if (fields[3].Contains(componentDelimiter) == false) {
System.Diagnostics.Debug.WriteLine("Warning - Missing component delimiter in field 'ZCI.4'");
CollectionValue.Value = fields[3].Trim();
} else {
components = new List<string>(fields[3].Split(new string[] { componentDelimiter }, StringSplitOptions.None));
//A field can have seperate components, essentially nested fields with a differnt delimiter
CollectionValue.Value = components.Count > 0 ? components[0] : String.Empty;
CollectionUnitOfMeasure.Value = components.Count > 1 ? components[1] : String.Empty;
System.Diagnostics.Debug.WriteLine("Warning - Field 'ZCI.4' returned an execpected number of fields. Expected 2, returned " + components.Count);
}
//Last one non-nested
this.Fasting.Value = fields[4];
//Any additional segments that we don't know about
//Doesn't handle nested segments
if (fields.Count > 5) {
for (int x = 5; x < fields.Count - 1; x++) {
Field newField = new Field("Additional unknown field", "ZCI." + x, "Unknown", RequiredFlags.Unknown, -1, fieldDelimiter, SupportedCharacters.Unknown, -1, fields[x]);
AdditionalFields.Add(newField);
}
}
}
public PatientGeneralClinicalInformationSegment(string fieldDelimiter, string componentDelimiter)
: this() {
//Field Delimiters
foreach (Field patientGeneralClinicalInformation in KnownFields) {
patientGeneralClinicalInformation.Delimiter = fieldDelimiter;
}
foreach (Field patientGeneralClinicalInformation in new Field[] { WeightValue, CollectionValue }) {
patientGeneralClinicalInformation.Delimiter = componentDelimiter;
}
//Last one is always a newline
this.Fasting.Delimiter = System.Environment.NewLine;
}
#endregion
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
10
dir
2713
file:///%5Cadsdc01/Repositories/Opal/Supra%202.0/HL7Objects/Properties
file:///%5Cadsdc01/Repositories/Opal
2008-02-25T22:59:56.671875Z
41
Administrator
d43380b4-9f89-f34e-a9d1-96296dc15dae
AssemblyInfo.cs
file
2008-09-24T22:44:17.735429Z
1df4487d65b281cd8d3c4b12ff1cb481
2009-05-19T16:50:49.297190Z
1905
aheagy
1417
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HL7Objects")]
[assembly: AssemblyDescription("Generic HL7 Object Library")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HL7Objects")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e1efd496-ee67-4d10-98f8-3fb0cb8880d0")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Text;
namespace HL7 {
public enum RelationshipToPatient {
Self = 1,
Spouse = 2,
Other = 3
};
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]
7fda77c9afa8a3f270f8bf5544fff76274636ca5
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment