[1227] | 1 | /* LoadMissedOpReportCommand.as */
|
---|
| 2 |
|
---|
| 3 | package gov.va.med.edp.command.reports
|
---|
| 4 | {
|
---|
| 5 | import com.adobe.cairngorm.commands.ICommand;
|
---|
| 6 | import com.adobe.cairngorm.control.CairngormEvent;
|
---|
| 7 |
|
---|
| 8 | import gov.va.med.edp.business.reports.ReportDelegate;
|
---|
| 9 | import gov.va.med.edp.command.AbstractResponderCommand;
|
---|
| 10 | import gov.va.med.edp.control.reports.ReportEvent;
|
---|
| 11 | import gov.va.med.edp.factory.ReportFactory;
|
---|
| 12 | import gov.va.med.edp.model.TrackingModelLocator;
|
---|
| 13 |
|
---|
| 14 | import mx.rpc.IResponder;
|
---|
| 15 | import mx.rpc.events.FaultEvent;
|
---|
| 16 | import mx.rpc.events.ResultEvent;
|
---|
| 17 |
|
---|
| 18 | public class LoadExposureReportCommand extends AbstractResponderCommand implements ICommand, IResponder
|
---|
| 19 | {
|
---|
| 20 |
|
---|
| 21 | protected var model:TrackingModelLocator = TrackingModelLocator.getInstance();
|
---|
| 22 |
|
---|
| 23 | public function execute(event:CairngormEvent):void
|
---|
| 24 | {
|
---|
| 25 | var delegate: ReportDelegate = new ReportDelegate(this);
|
---|
| 26 | var reportEvent: ReportEvent = ReportEvent(event);
|
---|
| 27 | delegate.loadReport(reportEvent);
|
---|
| 28 | model.reports.exposureReport.id = reportEvent.reportParams.id;
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | public override function result(data:Object):void
|
---|
| 32 | {
|
---|
| 33 | var xml:XML = ResultEvent(data).result as XML;
|
---|
| 34 | // process the xml
|
---|
| 35 |
|
---|
| 36 | //Point to the correct factory methods to process XML..
|
---|
| 37 | model.reports.exposureReport.contagiousPtRoomList = ReportFactory.buildPatientExposureVOListFromXML(xml.patient.row);
|
---|
| 38 | model.reports.exposureReport.ptsExposedinTreatmentRoomList = ReportFactory.buildPatientExposureVOListFromXML(xml.treatmentRoom.row);
|
---|
| 39 | model.reports.exposureReport.allOtherPatientsList = ReportFactory.buildPatientExposureVOListFromXML(xml.otherPatients.row);
|
---|
| 40 |
|
---|
| 41 | model.reports.exposureReport.exposedMDsList = ReportFactory.buildEDStaffVOListFromXML(xml.onDutyStaff.doctors.md);
|
---|
| 42 | model.reports.exposureReport.exposedNursesList = ReportFactory.buildEDStaffVOListFromXML(xml.onDutyStaff.nurses.rn);
|
---|
| 43 | model.reports.exposureReport.exposedResidentsList = ReportFactory.buildEDStaffVOListFromXML(xml.onDutyStaff.residents.md);
|
---|
| 44 |
|
---|
| 45 | //fire the binding..
|
---|
| 46 | model.reports.reportType = "";
|
---|
| 47 | model.reports.reportType = ReportEvent.EVENT_EXPOSURE_REPORT;
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | protected override function getFaultMessage(faultEvent:FaultEvent):String {
|
---|
| 51 | return "Error Loading Report: " + super.getFaultMessage(faultEvent);
|
---|
| 52 | }
|
---|
| 53 | }
|
---|
| 54 | }
|
---|