Exemplo n.º 1
0
        public override POCD_MT000040Author ToPocdAuthor()
        {
            POCD_MT000040Author returnVal = new POCD_MT000040Author();

            POCD_MT000040AuthoringDevice authoringDevice = new POCD_MT000040AuthoringDevice();

            authoringDevice.manufacturerModelName = new SC()
            {
                Text = new string[] { this.AssignedAuthoringDevice.ManufacturerModelName }
            };
            authoringDevice.softwareName = new SC()
            {
                Text = new string[] { this.AssignedAuthoringDevice.SoftwareName }
            };

            returnVal.assignedAuthor = new POCD_MT000040AssignedAuthor();

            returnVal.assignedAuthor.Item = authoringDevice;

            returnVal.time = new TS()
            {
                value = DateTime.Now.ToString(RawCdaDocument.CdaDateFormat)
            };

            return(returnVal);
        }
        public override POCD_MT000040Author ToPocdAuthor()
        {
            POCD_MT000040Author returnAuthor = new POCD_MT000040Author();

            returnAuthor.assignedAuthor = this.AssignedPerson.ToPocdAssignedAuthor();

            returnAuthor.time = new TS()
            {
                value = this.Time.ToString(RawCdaDocument.CdaDateFormat)
            };

            return(returnAuthor);
        }
Exemplo n.º 3
0
        //public abstract string ToCdaXml();

        protected POCD_MT000040ClinicalDocument AddRawDocumentData(POCD_MT000040ClinicalDocument rawDoc)
        {
            // *** Set the realm to US ***
            //rawDoc.realmCode = new List<CS>();
            //rawDoc.realmCode.Add(new CS() { code = "US" });

            // *** All documents will have this type ***
            rawDoc.typeId = new POCD_MT000040InfrastructureRoottypeId()
            {
                root = "2.16.840.1.113883.1.3", extension = "POCD_HD000040"
            };

            // *** Date/Time of Creation ***
            //<effectiveTime value='20000407130000+0500'/>
            rawDoc.effectiveTime = new TS()
            {
                value = DateTime.Now.ToString(RawCdaDocument.CdaDateFormat)
            };

            // *** Confidentiality ***
            //<confidentialityCode code='N' codeSystem='2.16.840.1.113883.5.25'/>
            rawDoc.confidentialityCode = new CE()
            {
                code = "N", codeSystem = "2.16.840.1.113883.5.25"
            };

            // *** Language ***
            //<languageCode code='en-US'/>
            rawDoc.languageCode = new CS()
            {
                code = "en-US"
            };

            // *** Set id ***
            rawDoc.id = new II()
            {
                root = this.DocumentId
            };

            // *** Record Target ***
            POCD_MT000040RecordTarget rt = this.RecordTarget.ToPocdRecordTarget();

            rawDoc.recordTarget = new POCD_MT000040RecordTarget[] { rt };

            // *** Information Recipient ***
            rawDoc.informationRecipient = this.Recipient.ToPocdRecipient();

            // *** Participants ***
            rawDoc.participant = this.Participants.ToPocdParticpantArray();

            // *** Authors ***
            List <POCD_MT000040Author> authorList = new List <POCD_MT000040Author>();

            // *** Device Author ***
            if (!this.DeviceAuthor.IsEmpty)
            {
                POCD_MT000040Author pocdDevAuthor = this.DeviceAuthor.ToPocdAuthor();
                authorList.Add(pocdDevAuthor);
            }

            // *** Author - Current User ***
            POCD_MT000040Author pocdAuthor = this.Author.ToPocdAuthor();

            authorList.Add(pocdAuthor);

            rawDoc.author = authorList.ToArray();

            // *** Custodian ***
            rawDoc.custodian = this.Custodian.ToPocdCustodian();

            // *** Documentation Of ***
            rawDoc.documentationOf = new POCD_MT000040DocumentationOf[] { this.DocumentationOf.ToPocdDocumentationOf() };

            // *** Document Body ***
            rawDoc.component = new POCD_MT000040Component2();
            POCD_MT000040StructuredBody body = new POCD_MT000040StructuredBody();

            // *** Create list of component/sections ***
            List <POCD_MT000040Component3> componentList = new List <POCD_MT000040Component3>();

            // *** Add allergy section ***
            POCD_MT000040Component3 allergySection = this.Allergies.ToPocdComponent();

            if (allergySection != null)
            {
                componentList.Add(allergySection);
            }

            // TODO: Add additional sections here...

            // *** Add the sections/component to body ***
            body.component = componentList.ToArray();

            // *** Add body ***
            rawDoc.component.Item = body;

            return(rawDoc);
        }