public override POCD_MT000040Participant1 ToPocdParticipant() { POCD_MT000040Participant1 returnVal = base.ToPocdParticipant(); // *** Add IHE template id's for spouse *** List <II> templateIds = new List <II>(); templateIds.Add(new II() { root = "1.3.6.1.4.1.19376.1.5.3.1.2.4" }); CE code = new CE() { nullFlavor = "UNK" }; if (this.ParticipantType == IheParticipantType.Spouse) { templateIds.Add(new II() { root = "1.3.6.1.4.1.19376.1.5.3.1.2.4.1" }); code = new CE() { codeSystem = "2.16.840.1.113883.5.111", codeSystemName = "HL7RoleCode", code = "SPS", displayName = "Spouse" }; } else if (this.ParticipantType == IheParticipantType.FatherOfFetus) { templateIds.Add(new II() { root = "1.3.6.1.4.1.19376.1.5.3.1.2.4.2" }); code = new CE() { codeSystem = "2.16.840.1.113883.5.111", codeSystemName = "HL7RoleCode", code = "FAMMEMB", displayName = "Family Member" }; } returnVal.templateId = templateIds.ToArray(); CE codedEntry = new CE(); codedEntry.code = this.participantCodes[(int)this.ParticipantType]; codedEntry.displayName = this.participantDisplayNames[(int)this.ParticipantType]; codedEntry.codeSystem = "2.16.840.1.113883.6.96"; codedEntry.codeSystemName = "SNOMED CT"; code.translation = new CD[] { codedEntry }; // *** NOTE: This code adds IHE roles as translation... //returnVal.associatedEntity.code = code; // *** NOTE: This code adds IHE roles as top code... returnVal.associatedEntity.code = codedEntry; return(returnVal); }
public virtual POCD_MT000040Participant1 ToPocdParticipant() { POCD_MT000040Participant1 returnVal = new POCD_MT000040Participant1(); returnVal.typeCode = "IND"; // *** Associated Entity *** returnVal.associatedEntity = new POCD_MT000040AssociatedEntity(); // *** Class of participant *** returnVal.associatedEntity.classCode = this.PocdRoleClass; // *** Name *** if (string.IsNullOrWhiteSpace(this.Name.Last)) { returnVal.associatedEntity.nullFlavor = "UNK"; returnVal.associatedEntity.associatedPerson = new POCD_MT000040Person(); returnVal.associatedEntity.associatedPerson.nullFlavor = "UNK"; returnVal.associatedEntity.addr = new AD[] { new AD { nullFlavor = "UNK" } }; returnVal.associatedEntity.telecom = new TEL[] { new TEL { nullFlavor = "UNK" } }; returnVal.associatedEntity.associatedPerson.name = new PN[] { new PN() { nullFlavor = "UNK" } }; } else { returnVal.associatedEntity.associatedPerson = new POCD_MT000040Person(); returnVal.associatedEntity.associatedPerson.name = new PN[] { this.Name.ToPN() }; // *** Address *** returnVal.associatedEntity.addr = new AD[1]; returnVal.associatedEntity.addr[0] = this.Address.ToAD(); // *** Phone Numbers *** List <TEL> telList = new List <TEL>(); foreach (CdaTelephone tel in this.PhoneNumbers) { telList.Add(tel.ToTEL()); } returnVal.associatedEntity.telecom = telList.ToArray(); } return(returnVal); }