1. Add address_district to gnuhealth_du.xml 2. Improve get_du_address function 3. Add .hgignore file 4. Slight update death_certificate.fodt
# HG changeset patch # User Feng Shu <tuma...@163.com> # Date 1688516865 -28800 # Wed Jul 05 08:27:45 2023 +0800 # Node ID 08c1a0e6e52557f8c96a3513a4d57eab5772fd3f # Parent 35a5cdaac4d0e715277c29c87b25bf96fef9b2db Add .hgignore file diff -r 35a5cdaac4d0 -r 08c1a0e6e525 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Wed Jul 05 08:27:45 2023 +0800 @@ -0,0 +1,2 @@ +.pyc +.patch \ No newline at end of file # HG changeset patch # User Feng Shu <tuma...@163.com> # Date 1688607129 -28800 # Thu Jul 06 09:32:09 2023 +0800 # Node ID 05cdc25d917d948fcea75e583e196b83738d1e90 # Parent 08c1a0e6e52557f8c96a3513a4d57eab5772fd3f Update tryton/health/report/death_certificate.fodt diff -r 08c1a0e6e525 -r 05cdc25d917d tryton/health/report/death_certificate.fodt --- a/tryton/health/report/death_certificate.fodt Wed Jul 05 08:27:45 2023 +0800 +++ b/tryton/health/report/death_certificate.fodt Thu Jul 06 09:32:09 2023 +0800 @@ -1,24 +1,24 @@ <?xml version="1.0" encoding="UTF-8"?> <office:document xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text"> - <office:meta><meta:creation-date>2023-06-05T22:10:09.100073222</meta:creation-date><meta:editing-duration>P0D</meta:editing-duration><meta:editing-cycles>1</meta:editing-cycles><meta:generator>LibreOffice/7.4.5.1$Linux_X86_64 LibreOffice_project/40$Build-1</meta:generator><meta:document-statistic meta:table-count="5" meta:image-count="0" meta:object-count="0" meta:page-count="2" meta:paragraph-count="66" meta:word-count="136" meta:character-count="1825" meta:non-whitespace-character-count="1755"/></office:meta> + <office:meta><meta:creation-date>2023-06-05T22:10:09.100073222</meta:creation-date><meta:editing-duration>P0D</meta:editing-duration><meta:editing-cycles>1</meta:editing-cycles><meta:generator>LibreOffice/7.4.5.1$Linux_X86_64 LibreOffice_project/40$Build-1</meta:generator><meta:document-statistic meta:table-count="5" meta:image-count="0" meta:object-count="0" meta:page-count="3" meta:paragraph-count="66" meta:word-count="146" meta:character-count="1950" meta:non-whitespace-character-count="1870"/></office:meta> <office:settings> <config:config-item-set config:name="ooo:view-settings"> - <config:config-item config:name="ViewAreaTop" config:type="long">32597</config:config-item> + <config:config-item config:name="ViewAreaTop" config:type="long">27305</config:config-item> <config:config-item config:name="ViewAreaLeft" config:type="long">0</config:config-item> <config:config-item config:name="ViewAreaWidth" config:type="long">40192</config:config-item> - <config:config-item config:name="ViewAreaHeight" config:type="long">22571</config:config-item> + <config:config-item config:name="ViewAreaHeight" config:type="long">21512</config:config-item> <config:config-item config:name="ShowRedlineChanges" config:type="boolean">true</config:config-item> <config:config-item config:name="InBrowseMode" config:type="boolean">false</config:config-item> <config:config-item-map-indexed config:name="Views"> <config:config-item-map-entry> <config:config-item config:name="ViewId" config:type="string">view2</config:config-item> - <config:config-item config:name="ViewLeft" config:type="long">13781</config:config-item> - <config:config-item config:name="ViewTop" config:type="long">53349</config:config-item> + <config:config-item config:name="ViewLeft" config:type="long">23259</config:config-item> + <config:config-item config:name="ViewTop" config:type="long">48235</config:config-item> <config:config-item config:name="VisibleLeft" config:type="long">0</config:config-item> - <config:config-item config:name="VisibleTop" config:type="long">32597</config:config-item> + <config:config-item config:name="VisibleTop" config:type="long">27305</config:config-item> <config:config-item config:name="VisibleRight" config:type="long">40190</config:config-item> - <config:config-item config:name="VisibleBottom" config:type="long">55166</config:config-item> + <config:config-item config:name="VisibleBottom" config:type="long">48816</config:config-item> <config:config-item config:name="ZoomType" config:type="short">0</config:config-item> <config:config-item config:name="ViewLayoutColumns" config:type="short">0</config:config-item> <config:config-item config:name="ViewLayoutBookMode" config:type="boolean">false</config:config-item> @@ -91,7 +91,7 @@ <config:config-item config:name="ChartAutoUpdate" config:type="boolean">true</config:config-item> <config:config-item config:name="PrinterSetup" config:type="base64Binary"/> <config:config-item config:name="AddParaTableSpacingAtStart" config:type="boolean">true</config:config-item> - <config:config-item config:name="Rsid" config:type="int">4009769</config:config-item> + <config:config-item config:name="Rsid" config:type="int">4033173</config:config-item> <config:config-item config:name="EmbeddedDatabaseName" config:type="string"/> <config:config-item config:name="FieldAutoUpdate" config:type="boolean">true</config:config-item> <config:config-item config:name="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item> @@ -161,7 +161,7 @@ <draw:gradient draw:name="Spotted_20_Gray" draw:display-name="Spotted Gray" draw:style="radial" draw:cx="50%" draw:cy="50%" draw:start-color="#b2b2b2" draw:end-color="#eeeeee" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/> <style:default-style style:family="graphic"> <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/> - <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:font-independent-line-spacing="false"> + <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false"> <style:tab-stops/> </style:paragraph-properties> <style:text-properties style:use-window-font-color="true" loext:opacity="0%" loext:color-lum-mod="100%" loext:color-lum-off="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-name-asian="Source Han Sans CN Regular" style:font-size-asian="12pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/> @@ -1182,22 +1182,12 @@ <style:background-image/> </style:table-cell-properties> </style:style> - <style:style style:name="Table7.9" style:family="table-row"> + <style:style style:name="Table7.11" style:family="table-row"> <style:table-row-properties fo:background-color="#ffffff"> <style:background-image/> </style:table-row-properties> </style:style> - <style:style style:name="Table7.A10" style:family="table-cell"> - <style:table-cell-properties style:vertical-align="middle" fo:background-color="transparent" fo:padding="0cm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="0.5pt solid #000000" fo:border-bottom="0.5pt solid #000000"> - <style:background-image/> - </style:table-cell-properties> - </style:style> - <style:style style:name="Table7.D10" style:family="table-cell"> - <style:table-cell-properties style:vertical-align="middle" fo:background-color="transparent" fo:padding="0cm" fo:border="0.5pt solid #000000"> - <style:background-image/> - </style:table-cell-properties> - </style:style> - <style:style style:name="Table7.B14" style:family="table-cell"> + <style:style style:name="Table7.B17" style:family="table-cell"> <style:table-cell-properties fo:padding="0cm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/> </style:style> <style:style style:name="Table8" style:family="table"> @@ -1537,7 +1527,7 @@ </table:table-row> <table:table-row> <table:table-cell table:style-name="Table7.A5" office:value-type="string"> - <text:p text:style-name="GH-Table-Heading-Center">Usual Address</text:p> + <text:p text:style-name="GH-Table-Heading-Center">Domiciliary Unit</text:p> </table:table-cell> <table:table-cell table:style-name="Table7.A5" office:value-type="string"> <text:p text:style-name="GH-Table-Heading-Center">Citizenship</text:p> @@ -1551,7 +1541,7 @@ </table:table-row> <table:table-row> <table:table-cell table:style-name="Table7.A2" office:value-type="string"> - <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.name.du_address></text:placeholder></text:p> + <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.du and death_cert.du.rec_name></text:placeholder></text:p> </table:table-cell> <table:table-cell table:style-name="Table7.A2" office:value-type="string"> <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.name.citizenship and death_cert.name.citizenship.rec_name></text:placeholder></text:p> @@ -1563,31 +1553,43 @@ <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.name.occupation and death_cert.name.occupation.rec_name></text:placeholder></text:p> </table:table-cell> </table:table-row> - <table:table-row table:style-name="Table7.1"> - <table:table-cell table:style-name="Table7.A5" table:number-columns-spanned="2" office:value-type="string"> - <text:p text:style-name="GH-Table-Heading-Center">Domiciliary Unit</text:p> + <table:table-row> + <table:table-cell table:style-name="Table7.D5" table:number-columns-spanned="4" office:value-type="string"> + <text:p text:style-name="GH-Table-Heading-Center">Usual Address</text:p> + </table:table-cell> + <table:covered-table-cell/> + <table:covered-table-cell/> + <table:covered-table-cell/> + </table:table-row> + <table:table-row> + <table:table-cell table:style-name="Table7.D2" table:number-columns-spanned="4" office:value-type="string"> + <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.name.du_address></text:placeholder></text:p> </table:table-cell> <table:covered-table-cell/> - <table:table-cell table:style-name="Table7.A5" office:value-type="string"> + <table:covered-table-cell/> + <table:covered-table-cell/> + </table:table-row> + <table:table-row table:style-name="Table7.1"> + <table:table-cell table:style-name="Table7.A5" table:number-columns-spanned="2" office:value-type="string"> <text:p text:style-name="GH-Table-Heading-Center">Institution</text:p> </table:table-cell> - <table:table-cell table:style-name="Table7.D5" office:value-type="string"> + <table:covered-table-cell/> + <table:table-cell table:style-name="Table7.D5" table:number-columns-spanned="2" office:value-type="string"> <text:p text:style-name="GH-Table-Heading-Center">Place of Death</text:p> </table:table-cell> + <table:covered-table-cell/> </table:table-row> <table:table-row table:style-name="Table7.1"> <table:table-cell table:style-name="Table7.A2" table:number-columns-spanned="2" office:value-type="string"> - <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.du and death_cert.du.rec_name></text:placeholder></text:p> - </table:table-cell> - <table:covered-table-cell/> - <table:table-cell table:style-name="Table7.A2" office:value-type="string"> <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.institution and death_cert.institution.rec_name></text:placeholder></text:p> </table:table-cell> - <table:table-cell table:style-name="Table7.D2" office:value-type="string"> + <table:covered-table-cell/> + <table:table-cell table:style-name="Table7.D2" table:number-columns-spanned="2" office:value-type="string"> <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.place_of_death_str></text:placeholder></text:p> </table:table-cell> + <table:covered-table-cell/> </table:table-row> - <table:table-row table:style-name="Table7.9"> + <table:table-row table:style-name="Table7.11"> <table:table-cell table:style-name="Table7.D5" table:number-columns-spanned="4" office:value-type="string"> <text:p text:style-name="GH-Table-Heading-Center">Location details</text:p> </table:table-cell> @@ -1595,29 +1597,35 @@ <table:covered-table-cell/> <table:covered-table-cell/> </table:table-row> - <table:table-row table:style-name="Table7.9"> - <table:table-cell table:style-name="Table7.A10" table:number-rows-spanned="2" table:number-columns-spanned="2" office:value-type="string"> + <table:table-row table:style-name="Table7.11"> + <table:table-cell table:style-name="Table7.A1" table:number-columns-spanned="2" office:value-type="string"> + <text:p text:style-name="GH-Table-Heading-Center">Country</text:p> + </table:table-cell> + <table:covered-table-cell/> + <table:table-cell table:style-name="Table7.D1" table:number-columns-spanned="2" office:value-type="string"> + <text:p text:style-name="GH-Table-Heading-Center">Subdivision</text:p> + </table:table-cell> + <table:covered-table-cell/> + </table:table-row> + <table:table-row table:style-name="Table7.11"> + <table:table-cell table:style-name="Table7.A2" table:number-columns-spanned="2" office:value-type="string"> + <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.country and death_cert.country.rec_name></text:placeholder></text:p> + </table:table-cell> + <table:covered-table-cell/> + <table:table-cell table:style-name="Table7.D2" table:number-columns-spanned="2" office:value-type="string"> + <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.country_subdivision and death_cert.country_subdivision.rec_name></text:placeholder></text:p> + </table:table-cell> + <table:covered-table-cell/> + </table:table-row> + <table:table-row table:style-name="Table7.11"> + <table:table-cell table:style-name="Table7.D2" table:number-columns-spanned="4" office:value-type="string"> <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.place_details></text:placeholder></text:p> </table:table-cell> <table:covered-table-cell/> - <table:table-cell table:style-name="Table7.A10" office:value-type="string"> - <text:p text:style-name="GH-Table-Heading-Center">Country</text:p> - </table:table-cell> - <table:table-cell table:style-name="Table7.D10" office:value-type="string"> - <text:p text:style-name="GH-Table-Heading-Center">Subdivision</text:p> - </table:table-cell> + <table:covered-table-cell/> + <table:covered-table-cell/> </table:table-row> - <table:table-row table:style-name="Table7.9"> - <table:covered-table-cell table:style-name="Table7.A10"/> - <table:covered-table-cell/> - <table:table-cell table:style-name="Table7.A2" office:value-type="string"> - <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.country and death_cert.country.rec_name></text:placeholder></text:p> - </table:table-cell> - <table:table-cell table:style-name="Table7.D2" office:value-type="string"> - <text:p text:style-name="GH-Table-Contents-Center"><text:placeholder text:placeholder-type="text"><death_cert.country_subdivision and death_cert.country_subdivision.rec_name></text:placeholder></text:p> - </table:table-cell> - </table:table-row> - <table:table-row table:style-name="Table7.9"> + <table:table-row table:style-name="Table7.11"> <table:table-cell table:style-name="Table7.A5" office:value-type="string"> <text:p text:style-name="GH-Table-Heading-Center">Date / Time of Death</text:p> </table:table-cell> @@ -1643,7 +1651,7 @@ </table:table-row> <table:table-row> <table:covered-table-cell table:style-name="Table7.A2"/> - <table:table-cell table:style-name="Table7.B14" office:value-type="string"> + <table:table-cell table:style-name="Table7.B17" office:value-type="string"> <text:p text:style-name="GH-Table-Contents-Center">Autopsy: <text:placeholder text:placeholder-type="text"><death_cert.autopsy and "YES" or "NO"></text:placeholder></text:p> </table:table-cell> <table:covered-table-cell table:style-name="Table7.D2"/> @@ -1723,7 +1731,7 @@ </table:table-row> </table:table> <text:p text:style-name="Standard"/> - <text:p text:style-name="Standard"><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p> + <text:p text:style-name="Standard"><text:soft-page-break/><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p> </office:text> </office:body> </office:document> \ No newline at end of file # HG changeset patch # User Feng Shu <tuma...@163.com> # Date 1688517077 -28800 # Wed Jul 05 08:31:17 2023 +0800 # Node ID d62b761576f86b41e72aac93066e8dda012a605a # Parent 05cdc25d917d948fcea75e583e196b83738d1e90 Improve get_du_address of DomiciliaryUnit diff -r 05cdc25d917d -r d62b761576f8 tryton/health/health.py --- a/tryton/health/health.py Thu Jul 06 09:32:09 2023 +0800 +++ b/tryton/health/health.py Wed Jul 05 08:31:17 2023 +0800 @@ -92,7 +92,7 @@ def get_parent(self, subdivision): # Recursively get the parent subdivisions if (subdivision.parent): - return str(subdivision.rec_name) + '\n' + \ + return str(subdivision.rec_name) + ', ' + \ str(self.get_parent(subdivision.parent)) else: return subdivision.rec_name @@ -101,24 +101,30 @@ du_addr = '' # Street if (self.address_street): - du_addr = f"{self.address_street} {self.address_street_number} " \ - f"{self.address_street_bis}\n" + du_addr = f"{self.address_street} {self.address_street_number}, \n" \ + f"{self.address_street_bis}, " + + if (self.address_district): + du_addr = f"{du_addr}\n{self.address_district}, " + + if (self.address_municipality): + du_addr = f"{du_addr}{self.address_municipality}, " if (self.address_city): - du_addr = f"{du_addr}{self.address_city}\n" + du_addr = f"{du_addr}{self.address_city}, " # Grab the parent subdivisions if (self.address_subdivision): - du_addr = f"{du_addr}\n" \ + du_addr = f"{du_addr}" \ f"{self.get_parent(subdivision=self.address_subdivision)}" # Zip Code if (self.address_zip): - du_addr = f"{du_addr} - {self.address_zip}" + du_addr = f"{du_addr} - {self.address_zip}, " # Country if (self.address_country): - du_addr = f"{du_addr}\n {self.address_country.rec_name}" + du_addr = f"{du_addr}\n{self.address_country.rec_name}" return du_addr diff -r 05cdc25d917d -r d62b761576f8 tryton/health/view/gnuhealth_du.xml --- a/tryton/health/view/gnuhealth_du.xml Thu Jul 06 09:32:09 2023 +0800 +++ b/tryton/health/view/gnuhealth_du.xml Wed Jul 05 08:31:17 2023 +0800 @@ -22,16 +22,19 @@ <label name="address_street_bis"/> <field name="address_street_bis"/> <newline/> + <label name="address_district"/> + <field name="address_district"/> <label name="address_municipality"/> <field name="address_municipality"/> <label name="address_city"/> <field name="address_city"/> - <label name="address_zip"/> - <field name="address_zip"/> + <newline/> <label name="address_country"/> <field name="address_country"/> <label name="address_subdivision"/> <field name="address_subdivision"/> + <label name="address_zip"/> + <field name="address_zip"/> </group> <group id="du_picture"> <field xfill="0" xexpand="1" name="picture" height="200" width="200" widget="image"/>
--