Exemplo n.º 1
0
def _get_columns(key, hierarchy):
    columns = []
    for section in hierarchy.get_root().get_descendants():
        columns += QuestionColumn.all(hierarchy, section, key)
        columns += PrescriptionColumn.all(hierarchy, section, key)
        columns += VirtualPatientColumn.all(hierarchy, section, key)
    return columns
Exemplo n.º 2
0
def _get_columns(key, hierarchy):
    columns = []
    for section in hierarchy.get_root().get_descendants():
        columns += QuestionColumn.all(hierarchy, section, key)
        columns += PrescriptionColumn.all(hierarchy, section, key)
        columns += VirtualPatientColumn.all(hierarchy, section, key)
    return columns
Exemplo n.º 3
0
    def test_all_single(self):
        self.create_block(self.section, "Bupropion")
        columns = PrescriptionColumn.all(self.hierarchy, self.section, True)
        self.assertEquals(len(columns), 4)
        self.assertEquals(columns[0].field, "dosage")
        self.assertEquals(columns[0].medication.name, "Bupropion")
        self.assertEquals(columns[0].hierarchy.name, "main")

        self.assertEquals(columns[1].field, "disp")
        self.assertEquals(columns[2].field, "sig")
        self.assertEquals(columns[3].field, "refills")
Exemplo n.º 4
0
    def test_all_single(self):
        self.create_block(self.section, "Bupropion")
        columns = PrescriptionColumn.all(self.hierarchy, self.section, True)
        self.assertEquals(len(columns), 4)
        self.assertEquals(columns[0].field, "dosage")
        self.assertEquals(columns[0].medication.name, "Bupropion")
        self.assertEquals(columns[0].hierarchy.name, "main")

        self.assertEquals(columns[1].field, "disp")
        self.assertEquals(columns[2].field, "sig")
        self.assertEquals(columns[3].field, "refills")
Exemplo n.º 5
0
    def test_all_double(self):
        self.create_block(self.section, "Varenicline")
        columns = PrescriptionColumn.all(self.hierarchy, self.section, True)
        self.assertEquals(len(columns), 8)
        self.assertEquals(columns[0].field, "dosage")
        self.assertEquals(columns[0].medication.name, "Varenicline")
        self.assertEquals(columns[0].hierarchy.name, "main")

        self.assertEquals(columns[1].field, "disp")
        self.assertEquals(columns[2].field, "sig")
        self.assertEquals(columns[3].field, "refills")

        self.assertEquals(columns[4].field, "dosage_2")
        self.assertEquals(columns[5].field, "disp_2")
        self.assertEquals(columns[6].field, "sig_2")
        self.assertEquals(columns[7].field, "refills_2")
Exemplo n.º 6
0
    def test_all_double(self):
        self.create_block(self.section, "Varenicline")
        columns = PrescriptionColumn.all(self.hierarchy, self.section, True)
        self.assertEquals(len(columns), 8)
        self.assertEquals(columns[0].field, "dosage")
        self.assertEquals(columns[0].medication.name, "Varenicline")
        self.assertEquals(columns[0].hierarchy.name, "main")

        self.assertEquals(columns[1].field, "disp")
        self.assertEquals(columns[2].field, "sig")
        self.assertEquals(columns[3].field, "refills")

        self.assertEquals(columns[4].field, "dosage_2")
        self.assertEquals(columns[5].field, "disp_2")
        self.assertEquals(columns[6].field, "sig_2")
        self.assertEquals(columns[7].field, "refills_2")