コード例 #1
0
    def action_default(self):
        """Present currently selected set of pending clinical item orders"""
        patientId = int(self.requestData["sim_patient_id"])
        simTime = int(self.requestData["sim_time"])
        loadActive = isTrueStr(self.requestData["loadActive"])
        if not loadActive:
            self.requestData["activeCompleted"] = "Completed"
            self.requestData["activeOrderButtonClass"] = ""
            self.requestData["completedOrderButtonClass"] = "buttonSelected"
            self.requestData["historyTime"] = "Time"

        manager = SimManager()
        patientOrders = manager.loadPatientOrders(patientId,
                                                  simTime,
                                                  loadActive=loadActive)

        lastPatientOrder = None
        htmlLines = list()
        # Choose appropriate line template according to whether recommender enabled
        LINE_TEMPLATE = LINE_TEMPLATE_BY_ACTIVE if self.requestData[
            "enableRecommender"] == "True" else LINE_TEMPLATE_BY_ACTIVE_RECOMMENDER_DISABLED
        for patientOrder in patientOrders:
            self.formatPatientOrder(patientOrder, lastPatientOrder)
            htmlLines.append(LINE_TEMPLATE[loadActive] % patientOrder)
            lastPatientOrder = patientOrder
        self.requestData["detailTable"] = str.join("\n", htmlLines)
コード例 #2
0
ファイル: ActiveOrders.py プロジェクト: sxu11/CDSS_UMich
    def action_default(self):
        """Present currently selected set of pending clinical item orders"""
        patientId = int(self.requestData["sim_patient_id"])
        simTime = int(self.requestData["sim_time"])
        loadActive = isTrueStr(self.requestData["loadActive"])
        if not loadActive:
            self.requestData["activeCompleted"] = "Completed"
            self.requestData["activeOrderButtonClass"] = ""
            self.requestData["completedOrderButtonClass"] = "buttonSelected"
            self.requestData["historyTime"] = "Time"

        manager = SimManager()
        patientOrders = manager.loadPatientOrders(patientId,
                                                  simTime,
                                                  loadActive=loadActive)

        lastPatientOrder = None
        htmlLines = list()
        for patientOrder in patientOrders:
            self.formatPatientOrder(patientOrder, lastPatientOrder)
            htmlLines.append(LINE_TEMPLATE_BY_ACTIVE[loadActive] %
                             patientOrder)
            lastPatientOrder = patientOrder
        self.requestData["detailTable"] = str.join("\n", htmlLines)