-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
priority:highAddress soonAddress soonscope:gatewayGateway API (.NET backend)Gateway API (.NET backend)scope:pdfPDF parsing and extractionPDF parsing and extractiontype:featureNew feature or enhancementNew feature or enhancement
Description
Note for implementers: The design outlined here is a guideline, not a strict specification. Feel free to pivot from the suggested approach if you discover a better solution during implementation. Update the issue with your rationale when deviating significantly.
Summary
Implement PDF form stamping using iText7 to fill prior authorization form templates.
Context
The current PdfFormStamper returns an empty byte array. Production implementation must:
- Load procedure-specific PA form template
- Map
PAFormData.FieldMappingsto AcroForm fields - Fill and flatten the form
- Return stamped PDF bytes
Dependencies
| Issue | Relationship |
|---|---|
| #5 | Blocked by - need form template |
Tasks
- Load PDF template from assets
- Access AcroForm using iText7 API
- Iterate FieldMappings and set values
- Flatten form after filling
- Write to MemoryStream and return bytes
- Handle missing fields (log warning, continue)
- Add unit tests with sample PDF
iText7 Pattern
using var pdfDoc = new PdfDocument(new PdfReader(template), new PdfWriter(output));
var form = PdfAcroForm.GetAcroForm(pdfDoc, true);
foreach (var (fieldName, value) in formData.FieldMappings)
{
var field = form.GetField(fieldName);
if (field != null) field.SetValue(value);
}
form.FlattenFields();Files
| File | Action |
|---|---|
apps/gateway/Gateway.API/Services/PdfFormStamper.cs |
Modify |
apps/gateway/Gateway.API/Assets/sample-pa-form.pdf |
Create |
apps/gateway/Gateway.API.Tests/Services/PdfFormStamperTests.cs |
Create |
Design References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority:highAddress soonAddress soonscope:gatewayGateway API (.NET backend)Gateway API (.NET backend)scope:pdfPDF parsing and extractionPDF parsing and extractiontype:featureNew feature or enhancementNew feature or enhancement
Type
Projects
Status
Todo