def __init__(self, patient, chartimage, parent):
        BaseDialog.__init__(self, parent)
        self.pt = patient
        self.chartimage = chartimage

        patient_label = QtWidgets.QLabel(
            "%s<br /><b>%s</b>" % (_("Print the record of"), patient.name_id))

        patient_label.setAlignment(QtCore.Qt.AlignCenter)

        self.web_view = OMWebView(self)
        self.web_view.loadStarted.connect(self.print_start)
        self.web_view.loadFinished.connect(self.print_load_result)

        self.insertWidget(patient_label)
        self.insertWidget(self.web_view)

        self.apply_but.setText("Print")
        self.enableApply()

        html = patientDetails.header(self.pt).replace("center", "left")

        html += '''<hr />
                    <div align="center">
                    <img src="%s" width="80%%" />
                    </div>
                    <hr />''' % self.chartimage
        html += formatted_notes.notes(self.pt.notes_dict)
        self.web_view.setHtml(html)
    def __init__(self, patient, chartimage, parent):
        BaseDialog.__init__(self, parent)
        self.pt = patient
        self.chartimage = chartimage

        patient_label = QtWidgets.QLabel(
            "%s<br /><b>%s</b>" % (_("Print the record of"), patient.name_id))

        patient_label.setAlignment(QtCore.Qt.AlignCenter)

        self.web_view = OMWebView(self)
        self.web_view.loadStarted.connect(self.print_start)
        self.web_view.loadFinished.connect(self.print_load_result)

        self.insertWidget(patient_label)
        self.insertWidget(self.web_view)

        self.apply_but.setText("Print")
        self.enableApply()

        html = patientDetails.header(self.pt).replace("center", "left")

        html += '''<hr />
                    <div align="center">
                    <img src="%s" width="80%%" />
                    </div>
                    <hr />''' % self.chartimage
        html += formatted_notes.notes(self.pt.notes_dict)
        self.web_view.setHtml(html)
 def load(self, serialno):
     db = connect()
     cursor = db.cursor()
     cursor.execute(QUERY.replace("familyno", "serialno"), (serialno,))
     member = cursor.fetchone()
     cursor.close()
     pt = _DuckPatient(member)
     self.browser.setText(patientDetails.header(pt))
    def load_values(self, mes1 = _("Unlink"), mes2=_("from group")):
        self.family_no = self.om_gui.pt.familyno
        self.member_dict = {}

        db = connect()
        cursor = db.cursor()
        cursor.execute(QUERY, (self.family_no,))
        members = cursor.fetchall()
        cursor.close()
        for widget in self.widgets:
            self.frame_layout.removeWidget(widget)
            widget.setParent(None)
        for i, member in enumerate(members):
            pt = _DuckPatient(member)

            browser = QtGui.QTextBrowser()
            browser.setText(patientDetails.header(pt))

            row = (i//4)*2
            column = i%4
            self.frame_layout.addWidget(browser, row, column)
            message = u"%s %s %s"% (mes1, pt.serialno, mes2)
            if mes1 == _("Unlink"):
                icon = QtGui.QIcon(":/eraser.png")
            else:
                icon = QtGui.QIcon(":/logo.png")
            member_but = QtGui.QPushButton(icon, message)
            self.frame_layout.addWidget(member_but, row+1, column)

            self.member_dict[member_but] = pt
            member_but.clicked.connect(self.member_but_clicked)

            self.widgets.append(member_but)
            self.widgets.append(browser)

        if len(members) == 0:
            label = QtGui.QLabel(
                _("This patient does not belong to any family group."))
            label.setAlignment(QtCore.Qt.AlignRight)
            but = QtGui.QPushButton(_("Create a New Family Group"))
            but.clicked.connect(self.new_family_group)

            but2 = QtGui.QPushButton(_("Show similar addresses"))
            but2.clicked.connect(self.show_addresses)

            self.widgets.append(label)
            self.widgets.append(but)
            self.widgets.append(but2)

            self.frame_layout.addWidget(label, 0, 0)
            self.frame_layout.addWidget(but,0, 1)
            self.frame_layout.addWidget(but2,1, 1)
        else:
            self.advanced_widg.setEnabled(True)
Exemple #5
0
    def load_values(self, mes1=_("Unlink"), mes2=_("from group")):
        self.family_no = self.om_gui.pt.familyno
        LOGGER.debug("FamilyManage loading family number %d" % self.family_no)
        self.member_dict = {}
        members = families.get_members(self.family_no)
        for widget in self.widgets:
            self.frame_layout.removeWidget(widget)
            widget.setParent(None)
        for i, member in enumerate(members):
            pt = _DuckPatient(member)

            browser = QtGui.QTextBrowser()
            details = patientDetails.header(pt)
            details = details.replace("<h1>DECEASED</h1>", "<h4>Deceased</h4>")
            browser.setText(details)

            row = (i // 4) * 2
            column = i % 4
            self.frame_layout.addWidget(browser, row, column)
            message = u"%s %s %s" % (mes1, pt.serialno, mes2)
            if mes1 == _("Unlink"):
                icon = QtGui.QIcon(":/eraser.png")
            else:
                icon = QtGui.QIcon(":/logo.png")
            member_but = QtGui.QPushButton(icon, message)
            self.frame_layout.addWidget(member_but, row + 1, column)

            self.member_dict[member_but] = pt
            member_but.clicked.connect(self.member_but_clicked)

            self.widgets.append(member_but)
            self.widgets.append(browser)

        if len(members) == 0:
            label = QtGui.QLabel(
                _("This patient does not belong to any family group."))
            label.setAlignment(QtCore.Qt.AlignRight)
            but = QtGui.QPushButton(_("Create a New Family Group"))
            but.clicked.connect(self.new_family_group)

            but2 = QtGui.QPushButton(_("Show similar addresses"))
            but2.clicked.connect(self.show_addresses)

            self.widgets.append(label)
            self.widgets.append(but)
            self.widgets.append(but2)

            self.frame_layout.addWidget(label, 0, 0)
            self.frame_layout.addWidget(but, 0, 1)
            self.frame_layout.addWidget(but2, 1, 1)
        else:
            self.advanced_widg.setEnabled(True)
    def load_values(self, mes1=_("Unlink"), mes2=_("from group")):
        self.family_no = self.om_gui.pt.familyno
        LOGGER.debug("FamilyManage loading family number %d" % self.family_no)
        self.member_dict = {}
        members = families.get_members(self.family_no)
        for widget in self.widgets:
            self.frame_layout.removeWidget(widget)
            widget.setParent(None)
        for i, member in enumerate(members):
            pt = _DuckPatient(member)

            browser = QtGui.QTextBrowser()
            details = patientDetails.header(pt)
            details = details.replace("<h1>DECEASED</h1>", "<h4>Deceased</h4>")
            browser.setText(details)

            row = (i // 4) * 2
            column = i % 4
            self.frame_layout.addWidget(browser, row, column)
            message = u"%s %s %s" % (mes1, pt.serialno, mes2)
            if mes1 == _("Unlink"):
                icon = QtGui.QIcon(":/eraser.png")
            else:
                icon = QtGui.QIcon(":/logo.png")
            member_but = QtGui.QPushButton(icon, message)
            self.frame_layout.addWidget(member_but, row + 1, column)

            self.member_dict[member_but] = pt
            member_but.clicked.connect(self.member_but_clicked)

            self.widgets.append(member_but)
            self.widgets.append(browser)

        if len(members) == 0:
            label = QtGui.QLabel(
                _("This patient does not belong to any family group."))
            label.setAlignment(QtCore.Qt.AlignRight)
            but = QtGui.QPushButton(_("Create a New Family Group"))
            but.clicked.connect(self.new_family_group)

            but2 = QtGui.QPushButton(_("Show similar addresses"))
            but2.clicked.connect(self.show_addresses)

            self.widgets.append(label)
            self.widgets.append(but)
            self.widgets.append(but2)

            self.frame_layout.addWidget(label, 0, 0)
            self.frame_layout.addWidget(but, 0, 1)
            self.frame_layout.addWidget(but2, 1, 1)
        else:
            self.advanced_widg.setEnabled(True)
Exemple #7
0
    def __init__(self, patient, chartimage, parent):
        BaseDialog.__init__(self, parent)
        self.pt = patient

        self.main_ui = parent
        patient_label = QtGui.QLabel("%s<br /><b>%s</b>" % (
                                     _("Print the record of"), patient.name_id))

        patient_label.setAlignment(QtCore.Qt.AlignCenter)

        self.web_view = QtWebKit.QWebView()

        self.insertWidget(patient_label)
        self.insertWidget(self.web_view)

        html = patientDetails.header(patient).replace("center", "left")

        html += '<img src="%s" height = "120px" /><hr />' % (
            chartimage)
        html += formatted_notes.notes(patient.notes_dict)
        self.web_view.setHtml(html)
        self.apply_but.setText("Print")
        self.enableApply()
Exemple #8
0
 def load(self, serialno):
     member = families.get_patient_details(serialno)
     pt = _DuckPatient(member)
     self.browser.setText(patientDetails.header(pt))
 def load(self, serialno):
     member = families.get_patient_details(serialno)
     pt = _DuckPatient(member)
     self.browser.setText(patientDetails.header(pt))