| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- import com.adobe.ac.mxeffects.DistortionConstants;
- import com.adobe.ac.mxeffects.Flip;
- import com.imt.intimamedia.events.acquire.GetImagesEvent;
- import com.imt.intimamedia.events.acquire.GetMarkersEvent;
- import com.imt.intimamedia.events.measures.GetMeasuresEvent;
- import com.imt.intimamedia.events.measures.GetCTPAEvent;
- import com.imt.intimamedia.helpers.HelpUtils;
- import com.imt.intimamedia.model.ApplicationModelLocator;
- import com.imt.intimamedia.views.physician.acquire.LoadingPopUp;
- import com.imt.intimamedia.vo.DragAndDropVo;
- import com.imt.intimamedia.vo.MeasuresVo;
- import mx.collections.ArrayCollection;
- import mx.controls.Alert;
- import mx.controls.listClasses.TileListItemRenderer;
- import mx.managers.CursorManager;
- import mx.managers.PopUpManager;
- import mx.resources.ResourceManager;
- public var loadingPopUp : LoadingPopUp;
- private var _model : ApplicationModelLocator = ApplicationModelLocator.getInstance();
- public var collectionImagesCarotidLeft : ArrayCollection = new ArrayCollection();
- public var collectionImagesCarotidRight : ArrayCollection = new ArrayCollection();
- public var collectionImagesBody : ArrayCollection = new ArrayCollection();
- public var collectionImagesArmLeft : ArrayCollection = new ArrayCollection();
- public var collectionImagesArmRight : ArrayCollection = new ArrayCollection();
- public var collectionImagesLegLeft : ArrayCollection = new ArrayCollection();
- public var collectionImagesLegRight : ArrayCollection = new ArrayCollection();
- public var collectionDisplay : ArrayCollection = new ArrayCollection();
- public var collectionOfMarkers : ArrayCollection = new ArrayCollection();
- private var _measuresArray : ArrayCollection = new ArrayCollection();
- private var _zoneSelected : String = "";
- private function showView() : void
- {
- // to do : uncomment line below asap
- if ( _model.viewPatient /* && _model.measuresList.length == 0 */)
- {
- loadingPopUp = new LoadingPopUp();
-
- PopUpManager.addPopUp( loadingPopUp, this, true );
- PopUpManager.centerPopUp( loadingPopUp );
-
- loadingPopUp.title = ResourceManager.getInstance().getString('labels', 'acquire.loadingAcquisitionDownloadTitle')
- loadingPopUp.message = ResourceManager.getInstance().getString( 'labels', 'acquire.popUp.get.images' );
- loadingPopUp.progress.setProgress( 15, 100 );
-
- new GetImagesEvent( _model.appointmentSelected.id, this ).dispatch();
- }
- else
- {
- if (_model.currentThumbnailIndex <= 0)
- {
- measures.listImages.selectedIndex = 0;
- measures.imageSelection(_model.measuresList.getItemAt(0) as DragAndDropVo);
- }
- }
-
- // load help if needed
- if (ApplicationModelLocator.getInstance().connectedUser.help)
- {
- HelpUtils.loadHelp(HelpUtils.buildMeasuresHelpPages(), 0);
- }
-
- _zoneSelected = '';
- }
- public function getMeasuresArray () : ArrayCollection
- {
- return _measuresArray;
- }
- public function setMeasuresArray ( value : ArrayCollection ) : void
- {
- _measuresArray = value;
- }
- public function setImagesLoaded( type : String ) : void
- {
- this.loadingPopUp.closeHandler();
-
- var idsArray : Array = new Array;
- for each( var item : DragAndDropVo in _model.measuresList )
- {
- idsArray.push(item.id);
- }
-
- // get measures
- new GetMeasuresEvent(idsArray, this ).dispatch();
-
- // Alert.show("Appel de l'évenement GETCTPA " + _model.appointmentNumber.toString());
-
- // CJ 170915 : CTPA
- new GetCTPAEvent( _model.appointmentSelected.id, this).dispatch();
- }
- public function getMarkers( ) : void
- {
- _model.listMarkers.removeAll();
- new GetMarkersEvent( _model.appointmentSelected.id, this ).dispatch();
- }
- /***************************************/
- // be sure to remove scale cursor when exiting measure page
- private function exitView() : void
- {
- CursorManager.removeAllCursors();
-
- if (_zoneSelected == 'results')
- {
- _zoneSelected = '';
- flipToMeasures();
- }
- }
- public function setMeasures( list : Array ) : void
- {
- if (list)
- {
- _measuresArray.removeAll();
-
- for each( var measuresVo : MeasuresVo in list)
- _measuresArray.addItem(measuresVo);
- }
-
- displayFirstImage();
- }
- public function setCTPA( value : Number ) : void
- {
- _model.CTPA = value;
-
- // Alert.show("Passage dans (generalMeasureView) setCTPA : " + _model.CTPA.toString());
- }
- public function displayFirstImage() : void
- {
- if (_model.currentThumbnailIndex <= 0)
- {
- measures.listImages.selectedIndex = 0;
- measures.imageSelection(_model.measuresList.getItemAt(0) as DragAndDropVo);
- }
- }
- /**
- * Changement d'affichage
- */
- public function selectZone( zone : String ) : void
- {
- switch( zone )
- {
- case "results":
- flipToResults();
- _zoneSelected = zone;
- break;
- case "measures":
- flipToMeasures();
- break;
- }
- }
- /**
- * Affichage des mesures
- */
- private function flipToResults() : void
- {
- var flip : Flip = new Flip(measures);
- flip.siblings = [ results ];
- flip.direction = DistortionConstants.RIGHT;
- flip.duration = 750;
- flip.play();
- }
- /**
- * Affichage du tableau
- */
- private function flipToMeasures() : void
- {
- results.createCollection();
-
- var flip : Flip = new Flip(results);
- flip.siblings = [ measures ];
- flip.direction = DistortionConstants.LEFT;
- flip.duration = 750;
- flip.play();
- }
|