abtassociates / eva

Eva is a HUD application to aid HMIS Leads with data analysis. It is an open-source project intended for local use by HMIS Administrators in Continuums of Care (CoCs) around the U.S. and its territories.
GNU Affero General Public License v3.0
14 stars 4 forks source link

Eva Crashed on Upload #456

Closed MollyMcEvilley closed 10 months ago

MollyMcEvilley commented 10 months ago

December 6, 2023 8am Eastern

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Upload HMIS CSV Export' tab
  2. Click on 'Browse'
  3. Select ZIP file for upload
  4. The progress bar goes all the way to the right and displays 'Upload complete'
  5. See error (screenshot below)

Expected behavior Not to crash / to show an error related to the structure of my Client.csv file (which I am trying to diagnose and fix)

Screenshots image

Desktop (please complete the following information):

kiadso commented 10 months ago

Hi @MollyMcEvilley! Is it possible there are non-ascii characters in your export? That is currently a crash-worthy event in Eva.

MollyMcEvilley commented 10 months ago

I'm not sure, but it's possible. I assumed the issue for Eva was in Client.csv because the hashing was the only thing different in a dataset I've imported and exported (approximately) a bazillion times... I did manage to "fix" my hashed export so that Eva was satisfied with it.

If this is a known issue, I'm going to go ahead and close it.

kiadso commented 10 months ago

@MollyMcEvilley do you know what action(s) you took to fix it? we're curious!

MollyMcEvilley commented 10 months ago

I created this view in SQL Server so that all of the text qualifiers and formatting are taken care of before I do the export instead of trying to accomplish it in the DTSX package -- I just export exactly what's in the view. It's so much easier that it feels kind of like cheating.

 create view [dbo].[vw_hmis_Client_Hashed] as select case when PersonalID is null then '' else '"' + PersonalID + '"' end as PersonalID
     , case when FirstName is null then '' else substring(master.dbo.fn_varbintohexstr(hashbytes('SHA2_256', soundex(FirstName))), 1, 64) end as FirstName
     , case when MiddleName is null then '' else substring(master.dbo.fn_varbintohexstr(hashbytes('SHA2_256', soundex(MiddleName))), 1, 64) + '"' end as MiddleName
     , case when LastName is null then '' else substring(master.dbo.fn_varbintohexstr(hashbytes('SHA2_256', soundex(LastName))), 1, 64) + '"' end as LastName
     , case when NameSuffix is null then '' else '"' + NameSuffix + '"' end as NameSuffix
     , case when NameDataQuality is null then '' else cast (NameDataQuality as nvarchar) end as NameDataQuality
     , case when SSN is null then '' 
            when len(SSN) >= 9 then right(SSN, 4) + substring(master.dbo.fn_varbintohexstr(hashbytes('SHA2_256', SSN)), 1, 64)
            when len(SSN)= 8 then right(SSN, 4) + substring(master.dbo.fn_varbintohexstr(hashbytes('SHA2_256', 'x' + SSN)), 1, 64) 
            when len(SSN)= 7 then right(SSN, 4) + substring(master.dbo.fn_varbintohexstr(hashbytes('SHA2_256', 'xx' + SSN)), 1, 64) 
            when len(SSN)= 6 then right(SSN, 4) + substring(master.dbo.fn_varbintohexstr(hashbytes('SHA2_256', 'xxx' + SSN)), 1, 64) 
            when len(SSN)= 5 then right(SSN, 4) + substring(master.dbo.fn_varbintohexstr(hashbytes('SHA2_256', 'xxxx' + SSN)), 1, 64) 
            when len(SSN)= 4 then SSN + substring(master.dbo.fn_varbintohexstr(hashbytes('SHA2_256', 'xxxxx' + SSN)), 1, 64) 
            when len(SSN)= 3 then 'x' + SSN + substring(master.dbo.fn_varbintohexstr(hashbytes('SHA2_256', 'xxxxxx' + SSN)), 1, 64) 
            when len(SSN)= 2 then 'xx' + SSN + substring(master.dbo.fn_varbintohexstr(hashbytes('SHA2_256', 'xxxxxxx' + SSN)), 1, 64) 
            when len(SSN)= 1 then 'xxx' + SSN + substring(master.dbo.fn_varbintohexstr(hashbytes('SHA2_256', 'xxxxxxxx' + SSN)), 1, 64) 
            else '' end as SSN
     , case when SSNDataQuality is null then '' else cast (SSNDataQuality as nvarchar) end as SSNDataQuality
     , case when DOB is null then '' else format (DOB ,'yyyy-MM-dd') end as DOB
     , case when DOBDataQuality is null then '' else cast (DOBDataQuality as nvarchar) end as DOBDataQuality
     , case when AmIndAKNative is null then '' else cast (AmIndAKNative as nvarchar) end as AmIndAKNative
     , case when Asian is null then '' else cast (Asian as nvarchar) end as Asian
     , case when BlackAfAmerican is null then '' else cast (BlackAfAmerican as nvarchar) end as BlackAfAmerican
     , case when HispanicLatinaeo is null then '' else cast (HispanicLatinaeo as nvarchar) end as HispanicLatinaeo
     , case when MidEastNAfrican is null then '' else cast (MidEastNAfrican as nvarchar) end as MidEastNAfrican
     , case when NativeHIPacific is null then '' else cast (NativeHIPacific as nvarchar) end as NativeHIPacific
     , case when White is null then '' else cast (White as nvarchar) end as White
     , case when RaceNone is null then '' else cast (RaceNone as nvarchar) end as RaceNone
     , case when AdditionalRaceEthnicity is null then '' else cast (AdditionalRaceEthnicity as nvarchar) end as AdditionalRaceEthnicity
     , case when Woman is null then '' else cast (Woman as nvarchar) end as Woman
     , case when Man is null then '' else cast (Man as nvarchar) end as Man
     , case when NonBinary is null then '' else cast (NonBinary as nvarchar) end as NonBinary
     , case when CulturallySpecific is null then '' else cast (CulturallySpecific as nvarchar) end as CulturallySpecific
     , case when Transgender is null then '' else cast (Transgender as nvarchar) end as Transgender
     , case when Questioning is null then '' else cast (Questioning as nvarchar) end as Questioning
     , case when DifferentIdentity is null then '' else cast (DifferentIdentity as nvarchar) end as DifferentIdentity
     , case when GenderNone is null then '' else cast (GenderNone as nvarchar) end as GenderNone
     , case when DifferentIdentityText is null then '' else cast (DifferentIdentityText as nvarchar) end as DifferentIdentityText
     , case when VeteranStatus is null then '' else cast (VeteranStatus as nvarchar) end as VeteranStatus
     , case when YearEnteredService is null then '' else cast (YearEnteredService as nvarchar) end as YearEnteredService
     , case when YearSeparated is null then '' else cast (YearSeparated as nvarchar) end as YearSeparated
     , case when WorldWarII is null then '' else cast (WorldWarII as nvarchar) end as WorldWarII
     , case when KoreanWar is null then '' else cast (KoreanWar as nvarchar) end as KoreanWar
     , case when VietnamWar is null then '' else cast (VietnamWar as nvarchar) end as VietnamWar
     , case when DesertStorm is null then '' else cast (DesertStorm as nvarchar) end as DesertStorm
     , case when AfghanistanOEF is null then '' else cast (AfghanistanOEF as nvarchar) end as AfghanistanOEF
     , case when IraqOIF is null then '' else cast (IraqOIF as nvarchar) end as IraqOIF
     , case when IraqOND is null then '' else cast (IraqOND as nvarchar) end as IraqOND
     , case when OtherTheater is null then '' else cast (OtherTheater as nvarchar) end as OtherTheater
     , case when MilitaryBranch is null then '' else cast (MilitaryBranch as nvarchar) end as MilitaryBranch
     , case when DischargeStatus is null then '' else cast (DischargeStatus as nvarchar) end as DischargeStatus
     , case when DateCreated is null then '' else format (DateCreated ,'yyyy-MM-dd HH:mm:ss') end as DateCreated
     , case when DateUpdated is null then '' else format (DateUpdated ,'yyyy-MM-dd HH:mm:ss') end as DateUpdated
     , case when UserID is null then '' else '"' + UserID + '"' end as UserID
     , case when DateDeleted is null then '' else format (DateDeleted ,'yyyy-MM-dd HH:mm:ss') end as DateDeleted
     , case when ExportID is null then '' else '"' + ExportID + '"' end as ExportID from hmis_Client;
alex-silverman commented 10 months ago

@MollyMcEvilley,

I know you found a workaround for this issue, which is great. If you find the time, we would be very appreciative if you tried uploading your original file here: https://hmis-stage.abtsites.com/eva-dev/. We added a way to catch non-ascii characters and display them in the File Structure Analysis. We're wondering if that may be the underlying issue here. If so, your test will help confirm we can handle this and similar issues in the future.

MollyMcEvilley commented 10 months ago

Hi @alex-silverman. I did save the file and tried again a few minutes ago to upload it, but I got the same result. If it makes a difference, I'm pretty sure there was something profoundly wrong with the Client.csv file that I was generating, which is why I abandoned it and started from scratch.

image

kiadso commented 10 months ago

hey @MollyMcEvilley

Is the Client.csv file you're working with sample data? If it is, can you send it to me via my work email? <3 We are so curious!!