diff --git a/bin/filter/filter_suppliervax.py b/bin/filter/filter_suppliervax.py new file mode 100644 index 000000000..89e6835cb --- /dev/null +++ b/bin/filter/filter_suppliervax.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +"filter for contract-data.csv and verification-data.csv" + +import csv +import sys + +REMOVE_COLUMNS = [ + 'record_created', + 'record_modified', + 'user_modified', +] + +def main(): + reader = csv.DictReader(sys.stdin) + outnames = [f for f in reader.fieldnames if f not in REMOVE_COLUMNS] + writer = csv.DictWriter(sys.stdout, outnames) + writer.writeheader() + for row in reader: + try: + for rem in REMOVE_COLUMNS: + del row[rem] + writer.writerow(row) + except ValueError: + pass + +main() diff --git a/bin/pd/Makefile b/bin/pd/Makefile index 57990556a..f242b88bc 100644 --- a/bin/pd/Makefile +++ b/bin/pd/Makefile @@ -1,5 +1,5 @@ targets := ati briefingt qpnotes contracts contractsa dac experiment grants hospitalityq inventory \ - nap reclassification service travela travelq wrongdoing + nap reclassification service travela travelq wrongdoing suppliervax csv_files := \ ati.csv ati-nil.csv \ briefingt.csv \ @@ -17,7 +17,8 @@ csv_files := \ service.csv service-std.csv \ travela.csv \ travelq.csv travelq-nil.csv \ - wrongdoing.csv + wrongdoing.csv \ + contract-data.csv verification-data.csv fdir := $(PD_FILTER_SCRIPT_DIRECTORY) paster := $(REGISTRY_PASTER_COMMAND) registry_python := $(REGISTRY_PYTHON_COMMAND) @@ -636,5 +637,35 @@ $(workdir)/wrongdoing.csv: $(workdir)/filtered/wrongdoing.csv: $(workdir)/wrongdoing.csv $(fdir)/filter_wrongdoing.py < $< > $@ +### +### Supplier Vaccination +### +.PHONY: suppliervax +suppliervax: upload-suppliervax rebuild-suppliervax + +.PHONY: upload-suppliervax +upload-suppliervax: $(workdir)/filtered/contract-data.csv #$(workdir)/filtered/verification-data.csv + @echo Uploading Supplier Vaccination... + @$(ckanapi) action resource_patch -c $(registry_ini) \ + id=5334e05b-5c48-4cba-b5e3-cf755ef43dd3 upload@"$(workdir)/filtered/contract-data.csv" \ + > /dev/null +# @$(ckanapi) action resource_patch -c $(registry_ini) \ +# id=0d10f492-fcc3-467e-bd22-98492226569e upload@"$(workdir)/filtered/verification-data.csv" \ +# > /dev/null + +.PHONY: rebuild-suppliervax +rebuild-suppliervax: $(workdir)/filtered/contracts.csv #$(workdir)/filtered/contracts-nil.csv + # no search for suppliervax + +$(workdir)/contract-data.csv: + $(paster) $(combine) contract-data -d $(workdir) -c $(registry_ini) + +#$(workdir)/verification-data.csv: +# $(paster) $(combine) verification-data -d $(workdir) -c $(registry_ini) + +$(workdir)/filtered/contract-data.csv: $(workdir)/contract-data.csv + $(fdir)/filter_suppliervax.py < $< > $@ +#$(workdir)/filtered/verification-data.csv: $(workdir)/verification-data.csv +# $(fdir)/filter_suppliervax.py < $< > $@ endif diff --git a/ckanext/canada/internal/static/internal.css b/ckanext/canada/internal/static/internal.css index 1803c5591..1a83c0962 100644 --- a/ckanext/canada/internal/static/internal.css +++ b/ckanext/canada/internal/static/internal.css @@ -551,6 +551,10 @@ ul#brf-pkg { padding-left: 0; } #mn-pd { border-left: solid 6px #44a; } #pd i { color: #44a; } +#ql-suppliervax { border-left: solid 3px #7e0c33; border-top: solid 1px #ddd; } +#ql-suppliervax i { color: #7e0c33; margin-right: 10px; } +#mn-suppliervax { border-left: solid 6px #7e0c33; } + .label.dataset-private { display: none; } #quick-links .fa-question-circle-o { diff --git a/ckanext/canada/plugins.py b/ckanext/canada/plugins.py index 721d8829b..65c01e2c6 100755 --- a/ckanext/canada/plugins.py +++ b/ckanext/canada/plugins.py @@ -309,6 +309,7 @@ def update_config(self, config): ckanext.canada:tables/dac.yaml ckanext.canada:tables/nap.yaml ckanext.canada:tables/experiment.yaml +ckanext.canada:tables/suppliervax.yaml """ config['ckan.search.show_all_types'] = True config['search.facets.limit'] = 200 # because org list @@ -322,6 +323,7 @@ def update_config(self, config): ckanext.canada:schemas/info.yaml ckanext.canada:schemas/prop.yaml """ + config['scheming.organization_schemas'] = 'ckanext.canada:schemas/organization.yaml' # Enable our custom DCAT profile. config['ckanext.dcat.rdf.profile'] = 'canada_dcat' diff --git a/ckanext/canada/tables/suppliervax.yaml b/ckanext/canada/tables/suppliervax.yaml new file mode 100644 index 000000000..c02372518 --- /dev/null +++ b/ckanext/canada/tables/suppliervax.yaml @@ -0,0 +1,493 @@ +dataset_type: suppliervax +target_dataset: suppliervax + +title: Reporting on COVID-19 Vaccination Requirement for Supplier Personnel +notes: Access, upload and modify the COVID-19 Vaccination Requirement for Supplier Personnel reporting for your organization + +upload_warn: + en: "placeholder if required" + fr: "placeholder if required" + +template_version: 3 + +portal_type: info +collection: pd + +resources: +- title: Contract Data - Reporting on COVID-19 Vaccination Requirement for Supplier Personnel + resource_name: contract-data + create_form: true + edit_form: true + fields: + + # 3.1 + - datastore_id: report_date + label: + en: Report Date + fr: Numéro de suivi + description: + en: | + This is the date of the report + + The timelines for reporting on ongoing contracts as of November 15, 2021 are + a. An initial report to be submitted by November 26, 2021 on information collected as of November 15, 2021 + b. A 2nd updated report to be submitted by December 15, 2021 on information collected as of November 30, 2021. + c. A 3rd updated report to be submitted by January 15, 2022 on information collected as of December 31, 2021. + d. A 4th updated report to be submitted by February 15, 2022 with updated information as of January 31, 2022. + e. If the previous report includes one or more contracts where the supplier certification status is pending, a monthly update is required until all pending contracts are accounted for. + + Note For columns E, F and G, departments are not required to report on contracts that require the inclusion of a vaccination certification requirement prior to contract award. + + fr: text + obligation: Mandatory + excel_required: true + form_required: true + format_type: Date (Please format the data as YYYY-MM-DD) + validation: This field must not be empty + visible_to_public: Yes + occurrence: Single + datastore_type: date + excel_column_width: 15 + form_snippet: scheming/form_snippets/date.html + + # 3.2 + - datastore_id: total + label: + en: Total number of contracts + fr: text + description: + en: Total number of contracts. + fr: text + obligation: Mandatory + excel_required: true + form_required: true + format_type: Numeric only + validation: This field must not be empty + visible_to_public: Yes + occurrence: Single + datastore_type: int + excel_column_width: 28 + form_attrs: + size: 60 + + # 3.3 + - datastore_id: refused + label: + en: Total number of contracts where the supplier was unable/refused to certify + fr: text + excel_heading: + en: | + Total number of contracts where + the supplier was unable/refused to certify + fr: | + placeholder text + description: + en: | + Total number of contracts where the supplier was unable/refused to certify. + fr: text + obligation: Mandatory + excel_required: true + form_required: true + format_type: Numeric only + validation: This field must not be empty + visible_to_public: Yes + occurrence: Single + datastore_type: int + excel_column_width: 35 + form_attrs: + size: 60 + + # 3.4 + - datastore_id: accommodations + label: + en: Total number of contracts where accommodations were made in accordance with the Policy + fr: text + excel_heading: + en: | + Total number of contracts + where accommodations were + made in accordance with the + Policy + fr: | + placeholder text + description: + en: Total number of contracts where accommodations were made in accordance with the Policy. + fr: text + obligation: Mandatory + excel_required: true + form_required: true + format_type: Numeric only + validation: This field must not be empty + visible_to_public: Yes + occurrence: Single + datastore_type: int + excel_column_width: 28 + form_attrs: + size: 60 + + # 3.5 + - datastore_id: pending + label: + en: Total number of contracts where the supplier certification status is pending + fr: text + excel_heading: + en: | + Total number of contracts + where the supplier certification + status is pending + fr: | + placeholder text + description: + en: Total number of contracts where the supplier certification status is pending + fr: text + obligation: Mandatory + excel_required: true + form_required: true + format_type: Numeric only + validation: This field must not be empty + visible_to_public: Yes + occurrence: Single + datastore_type: int + excel_column_width: 28 + form_attrs: + size: 60 + + # 3.6 + - datastore_id: additional_information_en + label: + en: Additional Information (English) + fr: Renseignements supplémentaires (en anglais) + description: + en: This field will display any additional information/comments, in English. + fr: Ce champ affichera de plus amples renseignements/commentaires, en anglais. + obligation: Optional + excel_required: false + format_type: Free text + validation: None + visible_to_public: Yes + occurrence: Single + datastore_type: text + excel_column_width: 35 + form_snippet: scheming/form_snippets/textarea.html + form_attrs: + style: "width: 100%; display: block" + + # 3.7 + - datastore_id: additional_information_fr + label: + en: Additional Information (French) + fr: Renseignements supplémentaires (en français) + description: + en: This field will display any additional information/comments, in French. + fr: Ce champ affichera de plus amples renseignements/commentaires, en français. + obligation: Optional + excel_required: false + format_type: Free text + validation: None + visible_to_public: Yes + occurrence: Single + datastore_type: text + excel_column_width: 35 + form_snippet: scheming/form_snippets/textarea.html + form_attrs: + style: "width: 100%; display: block" + + + - datastore_id: record_created + label: Record Creation Time + import_template_include: false + visible_to_public: false + datastore_type: timestamp + preview_class: bg-info + + - datastore_id: record_modified + label: Last Record Modification Time + import_template_include: false + visible_to_public: false + datastore_type: timestamp + preview_class: bg-info + + - datastore_id: user_modified + label: User Last Modified Record + import_template_include: false + visible_to_public: false + datastore_type: text + preview_class: bg-info + + datastore_primary_key: report_date + datastore_indexes: "" + + default_preview_sort: report_date + + excel_example_height: 32 + excel_data_height: 32 + excel_data_num_rows: 500 + + triggers: + - contract-data_trigger: | + DECLARE + errors text[][] := '{{}}'; + crval RECORD; + BEGIN + errors := errors || required_error(NEW.report_date, 'report_date'); + errors := errors || required_error(NEW.total, 'total'); + errors := errors || required_error(NEW.refused, 'refused'); + errors := errors || required_error(NEW.accommodations, 'accommodations'); + errors := errors || required_error(NEW.pending, 'pending'); + IF errors = '{{}}' THEN + RETURN NEW; + END IF; + RAISE EXCEPTION E'TAB-DELIMITED\t%', array_to_string(errors, E'\t'); + END; + - update_record_modified_created_trigger + + examples: + record: + report_date: "2021-11-26" + total: 19 + refused: 2 + accommodations: 1 + pending: 3 + additional_information_en: "optional additional information goes here" + additional_information_fr: "text" + filters: + report_date: "2021-11-26" + filter_one: + report_date: "2021-11-26" + sort: report_date desc + +#- title: Verification Data - Reporting on COVID-19 Vaccination Requirement for Supplier Personnel +# resource_name: verification-data +# create_form: true +# edit_form: true +# fields: +# +# # 3.8 +# - datastore_id: report_date +# label: +# en: Report Date +# fr: Numéro de suivi +# description: +# en: | +# This is the date of the report +# +# The timelines for reporting on the verification data are +# a.An initial report to be submitted by December 15, 2021 with information as of November 30, 2021. +# b.A monthly update of the report is to be provided within 15 calendar days after the end of the month. +# c.A close-out report with an updated total of the data elements is required within 30 calendar days after the policy is rescinded. +# +# Note Departments are to indicate “0” in the report if any of the data elements is “0” by the reporting timelines specified in 3.1.8. +# +# fr: text +# obligation: Mandatory +# excel_required: true +# form_required: true +# format_type: Date (Please format the data as YYYY-MM-DD) +# validation: This field must not be empty +# visible_to_public: Yes +# occurrence: Single +# datastore_type: date +# excel_column_width: 15 +# form_snippet: scheming/form_snippets/date.html +# +# # 3.9 +# - datastore_id: total +# label: +# en: Total number of contracts with verifications undertaken +# fr: text +# excel_heading: +# en: | +# Total number of contracts with +# verifications undertaken +# fr: | +# placeholder text +# description: +# en: | +# Total number of contracts with verifications undertaken +# fr: text +# obligation: Mandatory +# excel_required: true +# form_required: true +# format_type: Numeric only +# validation: This field must not be empty +# visible_to_public: Yes +# occurrence: Single +# datastore_type: int +# excel_column_width: 28 +# form_attrs: +# size: 60 +# +# +# # 3.10 +# - datastore_id: admin_action +# label: +# en: Total number of contracts that require further administrative action due to non-compliance with Policy following verification +# fr: text +# excel_heading: +# en: | +# Total number of contracts that +# require further administrative +# action due to non-compliance +# with Policy following +# verification +# fr: | +# placeholder text +# description: +# en: Total number of contracts that require further administrative action due to non-compliance with Policy following verification +# fr: text +# obligation: Mandatory +# excel_required: true +# form_required: true +# format_type: Numeric only +# validation: This field must not be empty +# visible_to_public: Yes +# occurrence: Single +# datastore_type: int +# excel_column_width: 28 +# form_attrs: +# size: 60 +# +# # 3.11 +# - datastore_id: enforcement_action +# label: +# en: Total number of contracts that require contract enforcement action due to non-compliance with Policy following verification +# fr: text +# excel_heading: +# en: | +# Total number of contracts that +# require contract enforcement +# action due to non-compliance +# with Policy following +# verification +# fr: | +# placeholder text +# description: +# en: Total number of contracts that require contract enforcement action due to non-compliance with Policy following verification +# fr: text +# obligation: Mandatory +# excel_required: true +# form_required: true +# format_type: Numeric only +# validation: This field must not be empty +# visible_to_public: Yes +# occurrence: Single +# datastore_type: int +# excel_column_width: 28 +# form_attrs: +# size: 60 +# +# # 3.12 +# - datastore_id: additional_information_en +# label: +# en: Additional Information (English) +# fr: Renseignements supplémentaires (en anglais) +# description: +# en: This field will display any additional information/comments, in English. +# fr: Ce champ affichera de plus amples renseignements/commentaires, en anglais. +# obligation: Optional +# excel_required: false +# format_type: Free text +# validation: None +# visible_to_public: Yes +# occurrence: Single +# datastore_type: text +# excel_column_width: 35 +# form_snippet: scheming/form_snippets/textarea.html +# form_attrs: +# style: "width: 100%; display: block" +# +# # 3.13 +# - datastore_id: additional_information_fr +# label: +# en: Additional Information (French) +# fr: Renseignements supplémentaires (en français) +# description: +# en: This field will display any additional information/comments, in French. +# fr: Ce champ affichera de plus amples renseignements/commentaires, en français. +# obligation: Optional +# excel_required: false +# format_type: Free text +# validation: None +# visible_to_public: Yes +# occurrence: Single +# datastore_type: text +# excel_column_width: 35 +# form_snippet: scheming/form_snippets/textarea.html +# form_attrs: +# style: "width: 100%; display: block" +# +# +# +# - datastore_id: record_created +# label: Record Creation Time +# import_template_include: false +# visible_to_public: false +# datastore_type: timestamp +# preview_class: bg-info +# +# - datastore_id: record_modified +# label: Last Record Modification Time +# import_template_include: false +# visible_to_public: false +# datastore_type: timestamp +# preview_class: bg-info +# +# - datastore_id: user_modified +# label: User Last Modified Record +# import_template_include: false +# visible_to_public: false +# datastore_type: text +# preview_class: bg-info +# +# datastore_primary_key: report_date +# datastore_indexes: "" +# +# default_preview_sort: report_date +# +# excel_example_height: 32 +# excel_data_height: 32 +# excel_data_num_rows: 500 +# +# triggers: +# - verification-data_trigger: | +# DECLARE +# errors text[][] := '{{}}'; +# crval RECORD; +# BEGIN +# errors := errors || required_error(NEW.report_date, 'report_date'); +# errors := errors || required_error(NEW.total, 'total'); +# errors := errors || required_error(NEW.admin_action, 'admin_action'); +# errors := errors || required_error(NEW.enforcement_action, 'enforcement_action'); +# IF errors = '{{}}' THEN +# RETURN NEW; +# END IF; +# RAISE EXCEPTION E'TAB-DELIMITED\t%', array_to_string(errors, E'\t'); +# END; +# - update_record_modified_created_trigger +# +# examples: +# record: +# report_date: "2022-02-14" +# total: 19 +# admin_action: 3 +# enforcement_action: 1 +# additional_information_en: "optional additional information goes here" +# additional_information_fr: "text" +# filters: +# report_date: "2022-02-14" +# filter_one: +# report_date: "2022-02-14" +# sort: report_date desc + +excel_edge_style: + PatternFill: + fgColor: FF3d4647 + patternType: solid +excel_header_style: + PatternFill: + patternType: solid + fgColor: FF4ad7f0 +excel_column_heading_style: + PatternFill: + patternType: solid + fgColor: FF4ad7f0 diff --git a/ckanext/canada/templates/internal/home/quick_links.html b/ckanext/canada/templates/internal/home/quick_links.html index afbe5f3f5..f4374b237 100644 --- a/ckanext/canada/templates/internal/home/quick_links.html +++ b/ckanext/canada/templates/internal/home/quick_links.html @@ -206,6 +206,18 @@

{{ _('Proactive Disclosure') }}

  • +
    +

    {{ _('Supplier COVID-19 Vaccination') }}

    + +
    {% endif %}