Here is a code example of creating a TEP object, wrapping it in a DE, and writing to disk.
EDXLDE DEObj;
      TEP tep;
      if (!Directory.Exists(".\\REAGAN"))
      {
        Directory.CreateDirectory(".\\REAGAN");
      }

      GeoOASISWhere where;
      GMLPoint point;
      StreamWriter sw;
        DEObj = new EDXLDE();
        DEObj.CombinedConfidentiality = "Unclass";
        DEObj.DateTimeSent = DateTime.Now;
        DEObj.DistributionID = "MITRE IC.NET Test Message";
        DEObj.DistributionStatus = StatusValue.Test;
        DEObj.DistributionType = TypeValue.Report;
        DEObj.Language = "en-US";
        DEObj.SenderID = "admin@icnet.mitre.org";

        tep = new TEP();

        tep.ProviderInfo = new ProviderInfoType();
        tep.ProviderInfo.AgencyHospitalNumber = "3320";
        tep.ProviderInfo.AgencyHospitalState = "NY";
        tep.ProviderInfo.HospitalName = "Greater Baldwinsville Ambulance Corps";
        tep.ProviderInfo.ProviderType.Add(new ValueList("testURN", new string[] { "EMT-P" }.ToList()));
        tep.ProviderInfo.PersonnelIDNumber = "123456";
        tep.ProviderInfo.PersonnelLevelofCertification = "Paramedic";
        tep.ProviderInfo.PersonnelState = "NY";

        tep.TreatmentInfo = new TreatmentInfoType();
        tep.TreatmentInfo.ChiefComplaint = "Chest Pain";
        tep.TreatmentInfo.CurrentDisposition = "Treatment Sector";
        tep.TreatmentInfo.EncounterDateTime = DateTime.Now;
        tep.TreatmentInfo.EncounterID = Guid.NewGuid().ToString();
        tep.TreatmentInfo.FieldTraumaCriteria = new string[] { "Fall > 20 ft." }.ToList();
        tep.TreatmentInfo.HazardInfo = "Methyl-Ethyl Bad Stuff";
        tep.TreatmentInfo.MedicationsAdministered = new string[] { "Morphine Sulfate, Versed" }.ToList();
        tep.TreatmentInfo.ProcedurePerformed = new string[] { "Spinal Immobilization, Endotrachael Intubation, IV" }.ToList();
        tep.TreatmentInfo.TreatmentDateTime = DateTime.Now;
        tep.TreatmentInfo.TreatmentLocation = new GeoOASISWhere();
        point = new GeoOASISWhereLib.GMLPoint();
        VitalSignsType VitalSigns = new VitalSignsType();
        VitalSigns.BloodGlucoseLevel = 92;
        VitalSigns.CardiacMonitorRhythm = "S-TACH";
        VitalSigns.CO2Level = 1;
        VitalSigns.DiastolicBP = 53;
        VitalSigns.PulseOxymetry = 96;
        VitalSigns.PulseRate = 164;
        VitalSigns.RespiratoryRate = 22;
        VitalSigns.SystolicBP = 72;
        VitalSigns.Temperature = 37.1;
        VitalSigns.TotalGCS = 6;
        VitalSigns.TwelveLeadECGInterprepation = "No STEMI Noted";

        tep.TreatmentInfo.VitalSigns.Add(VitalSigns);

        tep.Ageunits = AgeUnitsType.Year;
        tep.IncidentID = "Operation Golden Phoenix";
        tep.MessageID = "Message" + i.ToString();
        tep.PatientAge = 43;
        tep.PatientGender = GenderType.Male;
        tep.PatientUID = Guid.NewGuid().ToString();
        tep.ProviderUID = Guid.NewGuid().ToString();
        tep.ReportTime = DateTime.Now;
        tep.TriageStatus = TriageStatusType.Priority1;


        where = new GeoOASISWhereLib.GeoOASISWhere();
            point = new GeoOASISWhereLib.GMLPoint();
            point.AddPositions(new double[] { 42, -124.2102 });
            where.Location = point;
        tep.Location = where;
        tep.TreatmentInfo.TreatmentLocation = where;
        DEObj.ContentObjects.Add(EDXLDEUtils.Box(tep));
        sw = new StreamWriter(".\\REAGAN\\TEP_REAGAN.xml");
        DEObj.WriteXML(sw.BaseStream);
        sw.Flush();
        sw.Close();

Last edited Jun 1, 2011 at 1:01 PM by dmcgarry, version 1

Comments

No comments yet.