PatientDelegate.as 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. package com.imt.intimamedia.business
  2. {
  3. import com.adobe.cairngorm.business.ServiceLocator;
  4. import com.imt.intimamedia.vo.AppointmentVo;
  5. import com.imt.intimamedia.vo.AtsVo;
  6. import com.imt.intimamedia.vo.CvExaminatorVo;
  7. import com.imt.intimamedia.vo.FamilyHistoryVo;
  8. import com.imt.intimamedia.vo.PatientVo;
  9. import com.imt.intimamedia.vo.PersonalHistoryVo;
  10. import com.imt.intimamedia.vo.TobaccoVo;
  11. import mx.collections.ArrayCollection;
  12. import mx.rpc.AbstractService;
  13. import mx.rpc.AsyncToken;
  14. import mx.rpc.IResponder;
  15. /**
  16. * Delegate de la gestion des patients
  17. */
  18. public class PatientDelegate
  19. {
  20. private var _responder : IResponder;
  21. private var _service : AbstractService;
  22. /**
  23. * Constructeur
  24. */
  25. public function PatientDelegate( responder : IResponder )
  26. {
  27. _service = ServiceLocator.getInstance().getRemoteObject( "patientService" );
  28. _responder = responder;
  29. }
  30. /**
  31. * Appel du service de création
  32. *
  33. * @param patient PatientVo
  34. * @param appointment AppointmentVo
  35. * @param session int
  36. * @return void
  37. */
  38. public function createPatient( patient : PatientVo, appointment : AppointmentVo, person : int, session : int ) : void
  39. {
  40. var token : AsyncToken = _service.createPatient( patient, appointment, person, session );
  41. token.addResponder ( _responder );
  42. }
  43. /**
  44. * Appel du service de mise à jour
  45. *
  46. * @param appointment PatientVo
  47. * @param session int
  48. * @return void
  49. */
  50. public function updatePatient( patient : PatientVo, session : int ) : void
  51. {
  52. var token : AsyncToken = _service.updatePatient( patient, session );
  53. token.addResponder ( _responder );
  54. }
  55. /**
  56. * Appel du service de mise à jour
  57. *
  58. * @param appointment AppointmentVo
  59. * @param session int
  60. * @return void
  61. */
  62. public function updateAppointment( appointment : AppointmentVo, patientUid : String, session : int ) : void
  63. {
  64. var token : AsyncToken = _service.updateAppointment( appointment, patientUid, session );
  65. token.addResponder ( _responder );
  66. }
  67. /**
  68. * Appel du service de recherche d'un patient
  69. *
  70. * @param criteria String
  71. * @param session int
  72. * @return void
  73. */
  74. public function searchPatient( criteria : String, organizationId : String, session : int ) : void
  75. {
  76. var token : AsyncToken = _service.searchPatient( criteria, organizationId, session );
  77. token.addResponder ( _responder );
  78. }
  79. /**
  80. * Appel du service de recherche des RDV pour un patient
  81. *
  82. * @param criteria String
  83. * @param session int
  84. * @return void
  85. */
  86. public function searchAppointments( criteria : String, session : int ) : void
  87. {
  88. var token : AsyncToken = _service.searchAppointments( criteria, session );
  89. token.addResponder ( _responder );
  90. }
  91. /**
  92. * Appel du service de creation d'un RDV
  93. *
  94. * @param appointmentVo AppointmentVo
  95. * @param session int
  96. * @return void
  97. */
  98. public function createAppointment( appointmentVo : AppointmentVo, patientUid : String, session : int ) : void
  99. {
  100. var token : AsyncToken = _service.createAppointment( appointmentVo, patientUid, session );
  101. token.addResponder ( _responder );
  102. }
  103. /**
  104. * Appel du service d'ajout des ATS
  105. *
  106. * @param atsVo AtsVo
  107. * @param tobaccoVo TobaccoVo
  108. * @param session int
  109. * @return void
  110. */
  111. public function addATSRiskToAnAppointment( atsVo : AtsVo, tobaccoVo : TobaccoVo, id : int, session : int ) : void
  112. {
  113. var token : AsyncToken = _service.addATSRiskToAnAppointment( atsVo, tobaccoVo, id, session );
  114. token.addResponder ( _responder );
  115. }
  116. /**
  117. * Appel du service d'ajout des antécédents
  118. *
  119. * @param personalHistoryVo PersonalHistoryVo
  120. * @param session int
  121. * @return void
  122. */
  123. public function addPersonalHistoryToAnAppointment( personalHistoryVo : PersonalHistoryVo, id : int, session : int ) : void
  124. {
  125. var token : AsyncToken = _service.addPersonalHistoryToAnAppointment( personalHistoryVo, id, session );
  126. token.addResponder ( _responder );
  127. }
  128. /**
  129. * Appel du service d'ajout des antécédents familiaux
  130. *
  131. * @param familyHistoryVo FamilyHistoryVo
  132. * @param session int
  133. * @return void
  134. */
  135. public function addFamilyHistoryToAnAppointment( familyHistoryVo : FamilyHistoryVo, id : int, session : int ) : void
  136. {
  137. var token : AsyncToken = _service.addFamilyHistoryToAnAppointment( familyHistoryVo, id, session );
  138. token.addResponder ( _responder );
  139. }
  140. /**
  141. * Appel du service d'ajout de l'examen cardio vasculaire
  142. *
  143. * @param cvExaminatorVo CvExaminatorVo
  144. * @param session int
  145. * @return void
  146. */
  147. public function addCardiovascularExaminatorToAnAppointment( cvExaminatorVo : CvExaminatorVo, id : int, session : int ) : void
  148. {
  149. var token : AsyncToken = _service.addCardiovascularExaminatorToAnAppointment( cvExaminatorVo, id, session );
  150. token.addResponder ( _responder );
  151. }
  152. /**
  153. * Appel du service d'ajout des traitements
  154. *
  155. * @param list Array
  156. * @param session int
  157. * @return void
  158. */
  159. public function addTreatmentsToAnAppointment( list : Array, id : int, session : int ) : void
  160. {
  161. var token : AsyncToken = _service.addTreatmentsToAnAppointment( list, id, session );
  162. token.addResponder ( _responder );
  163. }
  164. }
  165. }