source: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/MatchDiagnosesCommand.as@ 1227

Last change on this file since 1227 was 1227, checked in by George Lilly, 13 years ago

initial load of EDIS 1.0

File size: 1.5 KB
Line 
1/* MatchPatientsCommand.as */
2
3package gov.va.med.edp.command
4{
5 import com.adobe.cairngorm.commands.ICommand;
6 import com.adobe.cairngorm.control.CairngormEvent;
7
8 import gov.va.med.edp.business.MatchDiagnosesDelegate;
9 import gov.va.med.edp.control.MatchItemsEvent;
10 import gov.va.med.edp.factory.TrackingFactory;
11 import gov.va.med.edp.model.TrackingModelLocator;
12
13 import mx.rpc.IResponder;
14 import mx.rpc.events.FaultEvent;
15 import mx.rpc.events.ResultEvent;
16
17 public class MatchDiagnosesCommand extends AbstractResponderCommand implements ICommand, IResponder
18 {
19 private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
20
21 public function execute(event:CairngormEvent):void
22 {
23
24 var matchDiagnosesEvent:MatchItemsEvent = MatchItemsEvent(event);
25 if ((matchDiagnosesEvent.partial == null) || (matchDiagnosesEvent.partial.length == 0)) {
26 model.matchingDiagnoses = null;
27 return;
28 }
29
30 var delegate:MatchDiagnosesDelegate= new MatchDiagnosesDelegate(this);
31 delegate.matchDiagnoses(matchDiagnosesEvent.partial);
32 }
33
34 public override function result(data:Object):void
35 {
36 model.matchingDiagnosesLoaded = false;
37 var xml:XML = ResultEvent(data).result as XML;
38 model.matchingDiagnoses =
39 TrackingFactory.buildLookupDiagnosesListFromXML(xml);
40 model.matchingDiagnosesLoaded = true;
41
42 }
43
44 protected override function getFaultMessage(faultEvent:FaultEvent):String {
45 return "Retrieve matching diagnoses failed: " + super.getFaultMessage(faultEvent);
46 }
47
48 }
49}
Note: See TracBrowser for help on using the repository browser.