Merged in feature/textExtractionsPart1 (pull request #192)

all schema and rest apis for text extraction support

* in progress

* stage 8 complete

* phase 9 completed

* phase 9 complete

* ongoing - s3 path fix

* working

* optimize ci build

* e2e tests

* missing test
This commit is contained in:
Jay Brown
2025-11-26 19:23:42 +00:00
parent 2b43799f56
commit c45e1dd427
67 changed files with 16120 additions and 817 deletions
+236 -2
View File
@@ -354,6 +354,59 @@ type Currentcollectorquery struct {
Queryid *uuid.UUID `db:"queryid"`
}
type Currentfieldextraction struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
Filename *string `db:"filename"`
Contracttitle *string `db:"contracttitle"`
Aaretederivedamendmentnum *int32 `db:"aaretederivedamendmentnum"`
Clientname *string `db:"clientname"`
Payername *string `db:"payername"`
Payerstate *string `db:"payerstate"`
Providerstate *string `db:"providerstate"`
Filenametin *string `db:"filenametin"`
Provgrouptin *string `db:"provgrouptin"`
Provgroupnpi *string `db:"provgroupnpi"`
Provgroupnamefull *string `db:"provgroupnamefull"`
Provothertin *string `db:"provothertin"`
Provothernpi *string `db:"provothernpi"`
Provothernamefull *string `db:"provothernamefull"`
Aaretederivedeffectivedt pgtype.Date `db:"aaretederivedeffectivedt"`
Aaretederivedterminationdt pgtype.Date `db:"aaretederivedterminationdt"`
Autorenewalind *bool `db:"autorenewalind"`
Autorenewalterm *string `db:"autorenewalterm"`
Version int64 `db:"version"`
Createdby string `db:"createdby"`
Createdat pgtype.Timestamp `db:"createdat"`
}
type Currentfieldextractionswitharraycount struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
Filename *string `db:"filename"`
Contracttitle *string `db:"contracttitle"`
Aaretederivedamendmentnum *int32 `db:"aaretederivedamendmentnum"`
Clientname *string `db:"clientname"`
Payername *string `db:"payername"`
Payerstate *string `db:"payerstate"`
Providerstate *string `db:"providerstate"`
Filenametin *string `db:"filenametin"`
Provgrouptin *string `db:"provgrouptin"`
Provgroupnpi *string `db:"provgroupnpi"`
Provgroupnamefull *string `db:"provgroupnamefull"`
Provothertin *string `db:"provothertin"`
Provothernpi *string `db:"provothernpi"`
Provothernamefull *string `db:"provothernamefull"`
Aaretederivedeffectivedt pgtype.Date `db:"aaretederivedeffectivedt"`
Aaretederivedterminationdt pgtype.Date `db:"aaretederivedterminationdt"`
Autorenewalind *bool `db:"autorenewalind"`
Autorenewalterm *string `db:"autorenewalterm"`
Version int64 `db:"version"`
Createdby string `db:"createdby"`
Createdat pgtype.Timestamp `db:"createdat"`
Arraysize int64 `db:"arraysize"`
}
type Currenttextentry struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
@@ -370,6 +423,9 @@ type Document struct {
Hash string `db:"hash"`
BatchID *uuid.UUID `db:"batch_id"`
Filename *string `db:"filename"`
Folderid *uuid.UUID `db:"folderid"`
// Original path provided during upload. IMMUTABLE after creation - never modify this value.
Originalpath *string `db:"originalpath"`
}
type Documentclean struct {
@@ -391,8 +447,169 @@ type Documentcleanentry struct {
type Documententry struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
Bucket string `db:"bucket"`
Key string `db:"key"`
// S3 bucket name. IMMUTABLE after creation - never modify this value.
Bucket string `db:"bucket"`
// S3 object key. IMMUTABLE after creation - never modify this value.
Key string `db:"key"`
}
type Documentfieldextraction struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
Filename *string `db:"filename"`
Contracttitle *string `db:"contracttitle"`
Aaretederivedamendmentnum *int32 `db:"aaretederivedamendmentnum"`
Clientname *string `db:"clientname"`
Payername *string `db:"payername"`
Payerstate *string `db:"payerstate"`
Providerstate *string `db:"providerstate"`
Filenametin *string `db:"filenametin"`
Provgrouptin *string `db:"provgrouptin"`
Provgroupnpi *string `db:"provgroupnpi"`
Provgroupnamefull *string `db:"provgroupnamefull"`
Provothertin *string `db:"provothertin"`
Provothernpi *string `db:"provothernpi"`
Provothernamefull *string `db:"provothernamefull"`
Aaretederivedeffectivedt pgtype.Date `db:"aaretederivedeffectivedt"`
Aaretederivedterminationdt pgtype.Date `db:"aaretederivedterminationdt"`
Autorenewalind *bool `db:"autorenewalind"`
Autorenewalterm *string `db:"autorenewalterm"`
Createdat pgtype.Timestamp `db:"createdat"`
Createdby string `db:"createdby"`
}
type Documentfieldextractionarrayfield struct {
ID uuid.UUID `db:"id"`
Fieldextractionid uuid.UUID `db:"fieldextractionid"`
Arrayindex int16 `db:"arrayindex"`
Exhibittitle *string `db:"exhibittitle"`
Exhibitpage *string `db:"exhibitpage"`
Reimbprovtin *string `db:"reimbprovtin"`
Reimbprovnpi *string `db:"reimbprovnpi"`
Reimbprovname *string `db:"reimbprovname"`
Reimbeffectivedt pgtype.Date `db:"reimbeffectivedt"`
Reimbterminationdt pgtype.Date `db:"reimbterminationdt"`
Aaretederivedclaimtypecd *string `db:"aaretederivedclaimtypecd"`
Aaretederivedproduct *string `db:"aaretederivedproduct"`
Aaretederivedlob *string `db:"aaretederivedlob"`
Aaretederivedprogram *string `db:"aaretederivedprogram"`
Aaretederivednetwork *string `db:"aaretederivednetwork"`
Aaretederivedprovtype *string `db:"aaretederivedprovtype"`
Provtaxonomycd *string `db:"provtaxonomycd"`
Provtaxonomycddesc *string `db:"provtaxonomycddesc"`
Provspecialtycd *string `db:"provspecialtycd"`
Provspecialtycddesc *string `db:"provspecialtycddesc"`
Placeofservicecd *string `db:"placeofservicecd"`
Placeofservicecddesc *string `db:"placeofservicecddesc"`
Billtypecd *string `db:"billtypecd"`
Billtypecddesc *string `db:"billtypecddesc"`
Patientagemin *string `db:"patientagemin"`
Patientagemax *string `db:"patientagemax"`
Reimbterm *string `db:"reimbterm"`
Lobprogramrelationship *string `db:"lobprogramrelationship"`
Lobproductrelationship *string `db:"lobproductrelationship"`
Carveoutind *bool `db:"carveoutind"`
Carveoutcd *string `db:"carveoutcd"`
Lesserofind *bool `db:"lesserofind"`
Greaterofind *bool `db:"greaterofind"`
Aaretederivedreimbmethod *string `db:"aaretederivedreimbmethod"`
Unitofmeasure *string `db:"unitofmeasure"`
Reimbpctrate pgtype.Numeric `db:"reimbpctrate"`
Reimbfeerate pgtype.Numeric `db:"reimbfeerate"`
Reimbconversionfactor pgtype.Numeric `db:"reimbconversionfactor"`
Triggercapthresholdamt pgtype.Numeric `db:"triggercapthresholdamt"`
Triggerbasethreshold pgtype.Numeric `db:"triggerbasethreshold"`
Defaultind *bool `db:"defaultind"`
Additiondesc *string `db:"additiondesc"`
Additionmaxfeerateinc pgtype.Numeric `db:"additionmaxfeerateinc"`
Additionmaxpctrateinc pgtype.Numeric `db:"additionmaxpctrateinc"`
Aaretederivedadditionratechangetimeline *string `db:"aaretederivedadditionratechangetimeline"`
Aaretederivedfeeschedule *string `db:"aaretederivedfeeschedule"`
Aaretederivedfeescheduleversion *string `db:"aaretederivedfeescheduleversion"`
Serviceterm *string `db:"serviceterm"`
Cpt4proccd *string `db:"cpt4proccd"`
Cpt4proccddesc *string `db:"cpt4proccddesc"`
Cpt4procmod *string `db:"cpt4procmod"`
Cpt4procmoddesc *string `db:"cpt4procmoddesc"`
Revenuecd *string `db:"revenuecd"`
Revenuecddesc *string `db:"revenuecddesc"`
Diagcd *string `db:"diagcd"`
Diagcddesc *string `db:"diagcddesc"`
Ndccd *string `db:"ndccd"`
Ndccddesc *string `db:"ndccddesc"`
Claimadmittypecd *string `db:"claimadmittypecd"`
Authadmittypedesc *string `db:"authadmittypedesc"`
Claimstatuscd *string `db:"claimstatuscd"`
Claimstatuscddesc *string `db:"claimstatuscddesc"`
Groupertype *string `db:"groupertype"`
Groupercd *string `db:"groupercd"`
Groupercddesc *string `db:"groupercddesc"`
Grouperpctrate pgtype.Numeric `db:"grouperpctrate"`
Grouperbaserate pgtype.Numeric `db:"grouperbaserate"`
Aaretederivedgrouperversion *string `db:"aaretederivedgrouperversion"`
Grouperalternativelevelofcare *string `db:"grouperalternativelevelofcare"`
Grouperseverityind *bool `db:"grouperseverityind"`
Grouperseverity *string `db:"grouperseverity"`
Grouperriskofmortalitysubclass *string `db:"grouperriskofmortalitysubclass"`
Groupertransferind *bool `db:"groupertransferind"`
Grouperreadmissionsind *bool `db:"grouperreadmissionsind"`
Grouperhacind *bool `db:"grouperhacind"`
Outlierterm *string `db:"outlierterm"`
Outlierfirstdollarind *bool `db:"outlierfirstdollarind"`
Rangenbrdays *string `db:"rangenbrdays"`
Outlierfixedlossnbrdaysthreshold pgtype.Numeric `db:"outlierfixedlossnbrdaysthreshold"`
Outlierfixedlossthreshold pgtype.Numeric `db:"outlierfixedlossthreshold"`
Outliermaximum pgtype.Numeric `db:"outliermaximum"`
Outliermaximumfrequency pgtype.Numeric `db:"outliermaximumfrequency"`
Outlierpctrate pgtype.Numeric `db:"outlierpctrate"`
Outlierexclusioncd *string `db:"outlierexclusioncd"`
Outlierexclusioncddesc *string `db:"outlierexclusioncddesc"`
Facilityadjustmentterm *string `db:"facilityadjustmentterm"`
Dshind *bool `db:"dshind"`
Dshpctrate pgtype.Numeric `db:"dshpctrate"`
Dshfeerate pgtype.Numeric `db:"dshfeerate"`
Imeind *bool `db:"imeind"`
Imepctrate pgtype.Numeric `db:"imepctrate"`
Imefeerate pgtype.Numeric `db:"imefeerate"`
Ntapind *bool `db:"ntapind"`
Ntappctrate pgtype.Numeric `db:"ntappctrate"`
Ntapfeerate pgtype.Numeric `db:"ntapfeerate"`
Ucind *bool `db:"ucind"`
Ucpctrate pgtype.Numeric `db:"ucpctrate"`
Ucfeerate pgtype.Numeric `db:"ucfeerate"`
Gmeind *bool `db:"gmeind"`
Gmepctrate pgtype.Numeric `db:"gmepctrate"`
Gmefeerate pgtype.Numeric `db:"gmefeerate"`
Rateescalatorind *bool `db:"rateescalatorind"`
Rateescalatordesc *string `db:"rateescalatordesc"`
Rateescalatormaxrateincpct pgtype.Numeric `db:"rateescalatormaxrateincpct"`
Rateescalatorratechangetimeline pgtype.Numeric `db:"rateescalatorratechangetimeline"`
Stoplossterm *string `db:"stoplossterm"`
Stoplossfirstdollarind *bool `db:"stoplossfirstdollarind"`
Stoplossrangenbrdays pgtype.Numeric `db:"stoplossrangenbrdays"`
Stoplossfixedlossthreshold pgtype.Numeric `db:"stoplossfixedlossthreshold"`
Stoplossmaximum pgtype.Numeric `db:"stoplossmaximum"`
Stoplossmaximumfrequency pgtype.Numeric `db:"stoplossmaximumfrequency"`
Stoplossdailymaxrate pgtype.Numeric `db:"stoplossdailymaxrate"`
Stoplosspctrateonexcesscharges pgtype.Numeric `db:"stoplosspctrateonexcesscharges"`
Stoplossexclusioncd *string `db:"stoplossexclusioncd"`
Stoplossexclusiondesc *string `db:"stoplossexclusiondesc"`
}
type Documentfieldextractionversion struct {
ID uuid.UUID `db:"id"`
Fieldextractionid uuid.UUID `db:"fieldextractionid"`
Version int64 `db:"version"`
Createdby string `db:"createdby"`
Createdat pgtype.Timestamp `db:"createdat"`
}
type Documentlabel struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
Label string `db:"label"`
Appliedat pgtype.Timestamp `db:"appliedat"`
Appliedby string `db:"appliedby"`
}
type Documenttextextraction struct {
@@ -420,6 +637,18 @@ type Documentupload struct {
Createdat pgtype.Timestamp `db:"createdat"`
Filename *string `db:"filename"`
BatchID *uuid.UUID `db:"batch_id"`
FolderID *uuid.UUID `db:"folder_id"`
}
// Virtual folder hierarchy for document organization. Database-only - has no direct relationship to S3 storage locations.
type Folder struct {
ID uuid.UUID `db:"id"`
// Virtual folder path (e.g., "/contracts/2025"). Can be renamed without affecting S3 storage.
Path string `db:"path"`
Parentid *uuid.UUID `db:"parentid"`
Clientid string `db:"clientid"`
Createdat pgtype.Timestamp `db:"createdat"`
Createdby string `db:"createdby"`
}
type Fullactivecollector struct {
@@ -446,6 +675,11 @@ type Fullclient struct {
Cansync bool `db:"cansync"`
}
type Label struct {
Label string `db:"label"`
Description string `db:"description"`
}
type Query struct {
Queryid uuid.UUID `db:"queryid"`
Querytype Querytype `db:"querytype"`