-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calculate accountability end date #265
Conversation
|
||
|
||
def calculate_date(delivery_date: str, product_accountability_period: int) -> str: | ||
delivery_datetime = datetime.strptime(delivery_date, "%Y-%m-%dT%H:%M:%S.%fZ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peterMuriuki is this date format assumption correct? or should we make this a parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that looks correct, The format is YYYY, YYYY-MM, YYYY-MM-DD or YYYY-MM-DDThh:mm:ss+zz:zz,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peterMuriuki I was thinking more inline of the csv. Since those are not necessarily coming from the server
Unless someone exports the resources.
I'll create a separate issue to extend this just in case
importer/importer/builder.py
Outdated
if ( | ||
character["code"]["coding"][0]["display"] | ||
== "Accountability period (in months)" | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably better to use the code.coding.system
and code.coding.code
, since those are less likely to be moving targets.
export const smartRegisterCodeSystem = 'http://smartregister.org/codes';
export const accountabilityCharacteristicCode = '67869606';
export const accountabilityCharacteristicCoding = {
system: smartRegisterCodeSystem,
code: accountabilityCharacteristicCode,
display: 'Accountability period (in months)',
};
df9d438
to
aa07769
Compare
Add functionality to calculate the accountability date using the product's accountability period
IMPORTANT: Where possible all PRs must be linked to a Github issue
Fixes #264
Engineer Checklist
./gradlew spotlessApply
to check my code follows the project's style guide