public POCD_MT000040InformationRecipient[] ToPocdRecipient() { List <POCD_MT000040InformationRecipient> returnList = new List <POCD_MT000040InformationRecipient>(); POCD_MT000040InformationRecipient pocdRecip = new POCD_MT000040InformationRecipient(); pocdRecip.templateId = new II[] { new II() { root = "1.3.6.1.4.1.19376.1.3.3.1.4" } }; pocdRecip.intendedRecipient = new POCD_MT000040IntendedRecipient(); // *** Add Organization *** if (!string.IsNullOrWhiteSpace(this.Organization)) { pocdRecip.intendedRecipient.receivedOrganization = new POCD_MT000040Organization(); pocdRecip.intendedRecipient.receivedOrganization.name = new ON[] { new ON { Text = new string[] { this.Organization } } }; pocdRecip.intendedRecipient.receivedOrganization.addr = new AD[] { new AD { nullFlavor = "UNK" } }; pocdRecip.intendedRecipient.receivedOrganization.telecom = new TEL[] { new TEL { nullFlavor = "UNK" } }; } // *** Add Name *** if (!string.IsNullOrWhiteSpace(this.LastName)) { //POCD_MT000040IntendedRecipient CdaName tempName = new CdaName() { First = this.FirstName, Last = this.LastName }; pocdRecip.intendedRecipient.informationRecipient = new POCD_MT000040Person(); pocdRecip.intendedRecipient.informationRecipient.name = new PN[] { tempName.ToPN() }; } returnList.Add(pocdRecip); return(returnList.ToArray()); }
public override POCD_MT000040Component3 ToPocdComponent() { POCD_MT000040Component3 returnVal = base.ToPocdComponent(); // *** Skip unless we have a pediatrician name *** if (!string.IsNullOrWhiteSpace(this.PediatricianName)) { // *** Create encounter containing pediatrician name *** POCD_MT000040Encounter enc = new POCD_MT000040Encounter(); // *** Set Class, Mood *** enc.classCode = "ENC"; enc.moodCode = x_DocumentEncounterMood.PRP; // *** Set Template Ids *** CdaTemplateIdList templateIds = new CdaTemplateIdList("1.3.6.1.4.1.19376.1.5.3.1.4.14", "2.16.840.1.113883.10.20.1.21", "2.16.840.1.113883.10.20.1.25"); enc.templateId = templateIds.ToPocd(); // *** Add Id *** enc.id = new II[] { new II() { root = Guid.NewGuid().ToString() } }; // *** Code *** enc.code = new CD() { code = "Ambulatory", codeSystem = "2.16.840.1.113883.5.4", codeSystemName = "ActEncounterCode" }; // *** Add name as performer *** CdaName cdaName = new CdaName() { Last = this.PediatricianName }; enc.performer = new POCD_MT000040Performer2[] { new POCD_MT000040Performer2() { typeCode = ParticipationPhysicalPerformer.PRF, typeCodeSpecified = true, assignedEntity = new POCD_MT000040AssignedEntity() { assignedPerson = new POCD_MT000040Person() { name = new PN[] { cdaName.ToPN() } } } } }; // *** Add encounter to list of entries *** List <POCD_MT000040Entry> entryList = new List <POCD_MT000040Entry>(returnVal.section.entry); entryList.Add(new POCD_MT000040Entry() { Item = enc }); returnVal.section.entry = entryList.ToArray(); // *** Add pediatrician to human-readable *** List <object> items = new List <object>(returnVal.section.text.Items); // *** Create a new paragraph *** StrucDocParagraph para = new StrucDocParagraph(); para.Text = new[] { string.Format("Pediatrician: {0}", this.PediatricianName) }; // *** Add it to list *** items.Add(para); // *** Add list to document *** returnVal.section.text.Items = items.ToArray(); } return(returnVal); }