{"version":3,"sources":["states/promptState.js","components/Root.js","wrappers/withRoot.js","contexts/Session/reducer.js","contexts/Session/actions.js","contexts/Session/index.js","hooks/useSession.js","util/AVAPeople.js","util/AVAGroups.js","util/AVAUtilities.js","util/AVADateTime.js","util/AVAObservations.js","util/AVAServiceRequest.js","util/AVAMessages.js","util/AVACalendars.js","util/AVAActivityLoader.js","util/AVAStyles.js","components/dialogs/SwitchPatientDialog.js","graphql/mutations.js","components/Section.js","components/sections/ClientsSection.js","components/sections/RelationshipSection.js","components/sections/LinkedAccountsSection.js","components/sections/MessageRouting.js","components/dialogs/PatientDialog.js","components/sections/ProfileSection.js","components/sections/AdministrativeSection.js","components/forms/PersonFilter.js","components/dialogs/SendMessageDialog.js","components/forms/MakeMessage.js","components/sections/Snapshot.js","util/AVADocuments.js","components/forms/AVAConfirm.js","util/AVAUploadFile.js","components/forms/FormFillB.js","components/sections/FormSection.js","components/sections/TechInfoSection.js","components/sections/MessagePreferencesSection.js","components/dialogs/PersonNotes.js","components/sections/LinkedAccounts.js","components/sections/PersonalizationSection.js","components/sections/GroupAssignments.js","components/dialogs/PeopleMaintenance.js","components/forms/EditList.js","components/dialogs/NewCalendarEvent.js","components/sections/QuickSearch.js","components/forms/MessageForm.js","components/forms/MessageMonitor.js","components/forms/MessageFormLegacy.js","components/forms/FileUpload.js","components/forms/ObservationForm.js","components/forms/AVATextInput.js","components/forms/FamilyMaintenance.js","components/forms/FormFill.js","components/dialogs/DocumentDashboardB.js","components/dialogs/MarqueeMaintenance.js","components/forms/MultiObservationFormC.js","components/forms/MultiObservationFormD.js","components/forms/CheckInCheckOut.js","util/AVAPrintServiceRequest.js","components/forms/CalendarEventEditForm.js","components/dialogs/StaffAccess.js","components/dialogs/RequestDashboard.js","components/forms/ReportRequest.js","components/dialogs/CalendarDashboard.js","util/AVACalendarPrint.js","components/forms/CalendarForm.js","components/dialogs/ShowCalendar.js","components/forms/CopyMenu.js","components/forms/EditObservation.js","components/forms/ShowBulkList.js","components/forms/LoadMenuSpreadsheet.js","components/forms/MenuForm.js","components/dialogs/ShowMenu.js","components/forms/EditActivity.js","components/forms/EventActivityForm.js","components/forms/ActivityFilter.js","components/dialogs/ShowEventActivity.js","components/forms/LoadWorkOrderSpreadsheet.js","components/forms/LoadNamesFromFile.js","components/forms/GroupForm.js","components/forms/GroupFilter.js","components/forms/GroupControl.js","components/dialogs/ShowGroup.js","components/forms/AVASubscription.js","components/forms/NumberForm.js","components/forms/Number2Form.js","components/forms/FreeTextForm.js","components/sections/ClientProfileSection.js","components/dialogs/ClientMessagingSection.js","components/sections/WeatherSection.js","components/sections/GlobalMessagePreferencesSection.js","components/dialogs/ClientMaintenance.js","components/dialogs/FormManagement.js","components/dialogs/AVACarousel.js","util/MakeAVAMenu.js","components/sections/AVAInHome.js","components/forms/MenuFormB.js","components/dialogs/ShowMenuB.js","components/dialogs/BulletinBoard.js","components/forms/DynamicForm.js","components/dialogs/NewFactDialog.js","components/sections/AVAMenu.js","components/sections/ConnectMenu.js","screens/TheseusScreen.js","screens/ThankYouScreen.js","serviceWorker.js","screens/Reloader.js","screens/NotFound.js","navigation/RootNavigation.js","components/dialogs/SelectAccount.js","hooks/useIosCheck.js","hocs/withBootstrap.js","contexts/DarkMode/reducer.js","contexts/DarkMode/actions.js","contexts/DarkMode/index.js","App.js","util/hocFactory.js","wrappers/withRecoil.js","hocs/withRouter.js","hocs/withDarkMode.js","hocs/withTheme.js","hooks/useDarkMode.js","hocs/withSnackbar.js","hocs/withSession.js","index.js","ava_alert.mp3"],"names":["promptState","atom","key","default","Root","_ref","children","setPrompt","useSetRecoilState","stableSetter","React","useCallback","useEffect","beforeInstallPromptListener","event","preventDefault","window","addEventListener","removeEventListener","createElement","Fragment","withRoot","Component","props","state","action","type","payload","patient","patients","accessList","message_targets","profile","groups","preloads","calendar","roles","session","user","initialState","version","SessionContext","createContext","dispatch","useReducer","reducer","Provider","value","context","useContext","undefined","Error","savedSession","foundPeople","async","makeName","pRec","AVAname","getPerson","Item","Items","map","p","Object","prototype","toString","call","concat","name","first","last","trim","displayName","person_id","messaging","hasOwnProperty","preferred_method","destinations","keys","k","length","getImage","pPerson","getObject","Array","isArray","getPersonFromPartialID","pClient","pID","qQ","TableName","ExpressionAttributeValues","qR","dbClient","query","promise","catch","error","code","console","log","recordExists","getPersonFromLocation","pLoc","replacements","East","West","North","South","Unit","v","replace","toLowerCase","toUpperCase","getPersonByName","pFirstName","pLastName","includes","pWords","split","pop","join","sentenceCase","ExpressionAttributeNames","getPersonByWords","FilterExpression","conjunction","x","searchWords","search_data","filter","w","splice","pElement","arguments","override","_personRec$Item","_personRec$Item2","personRec","get","Key","cl","voice","home","formatPhone","sms","cell","office","email","display_name","numberIn","Number","response","Math","floor","slice","getSession","session_id","sessionRec","groups_managed","responsible_for","makeSearchData","iArray","search_words","forEach","i","searchTerm","push","location","digits","names","firstName","lastName","values","n","titleCase","phone","iC","wordCheck","addDays","pDate","pDays","copy","makeDate","date","setDate","getDate","addMonths","pMonths","cDate","setMonth","getMonth","daysDiff","d1","d2","d1DST","getTimezoneOffset","d2DST","abs","getTime","pInput","optionIn","options","assign","timeZone","targetDateStamp","targetDate","originalInput","Date","noTime","setHours","buildDate","leftOver_text","isDate","relDate","absDate","oaDate","dateOnly","absFull","currentDate","beginningOfCurrentDay","validation","foundError","toLocaleString","month","day","year","forceForward","setFullYear","getFullYear","hours","mWord","weekday","getDay","hour","getHours","getMinutes","tOfDay","minute","dayPart","workingHours","working_hours","isHoliday","weekend","startTime","try_start","start","isNaN","endTime","try_end","end","targetDateYMD","targetDateInput","regEx","timeZoneName","pString","test_me","datePart","parsed","match","addendPart","delimiter","today","validateDate","sixtyDaysAgo","finalAnswer","date_asCorrected","try_me","words","plusMinus","days$","timePart","daysToAdd","validString","parseInt","test","mTime","makeTime","exists","pStringPieces","yearPiece","monthPiece","dayPiece","yearAt","findIndex","twoDigYr","goodDate","thisYear","resolvedYear","noYearCorrection","m","f","culledDate","dateFromText","hh24","mm","variant","foundAt","dateFromString","ordinal","now","thisMonth_target","lastMonth_target","noFuture","nextMonth_target","pStringLower","currentDofWeek","requestedDofWeek","indexOf","pIn","pTime","inTime","ampm","hh","hh$","mm$","numeric24","empty","hhClean","hAdd","padStart","minutesSinceMidnight","string24","good","groupRecs","targetObj","targetArray","loadedGroupObj","loadedPerson","accountAccess","pClient_id","myClass","myPeopleRec","respList","proxyList","birthdayList","account_class","allGroupObject","getAllGroups","myAdminGroup","getGroup","selectedID","admin_class","clientGroupAssignments","getCustomizations","customization_value","accountClass","makeArray","group_id","myGroupAccessLevel","accessLevelTable","clientList","clients","c","id","everyClient","scan","returnArray","activeClients","this_client","disabled","sort","a","b","client_id","getAllClients","clientName","clientLogo","groupFlavor","groupHierarchy","t","g","min","logo","icon","count","list","nameOnly","allPeople","getMemberList","pxL","peopleList","pX","accessLevel","myMaxAccessLevelToThisPerson","personFlavor","may_proxy_to","gL","subscription_status","myRole","getRole","this_group","view_group","max","_p$local_data","local_data","dob","numeric$","pRec2Push","access","directory_option","member_of","unshift","shortList","searchString","subscription","subscription_active","deepCopy","isMemberOf","pGroup_id","getGroupsBelongTo","getGroupsResponsibleFor","returnObject","rejectObject","qParm","KeyConditionExpression","everyGroup","my_session","my_session_groups_managed","shift","my_session_responsibleList","startsWith","classList","admin_list","group_name","role","rejectGroup","gArray","gID","newObject","cKey","groupRec","pGroup","pSession","every","some","gRec","belongs_to","determineClass","gList","group_assignments","pGroups","foundIDs","foundGroups","checkExclude","sortResults","exclude","includeShortList","defaultClient","grp","client","IndexName","gPeopleRecs","ava_only","withSession","_foundGroups$i$groups","rObj","getGroupMembers","request","groupList","all_groups","flat","this_response","first_name","last_name","short","mType","ignore_unlisted","withResponsible","rN","ascending","sort_by","descending","createNewGroup","adminList","memberList","madeFromGroup","newGroupID","substr","newGroupRec","group_type","common_activities","put","clt","this_member","addMember","this_admin","update","UpdateExpression","peopleRec","newGroupList","clientGroups","cG","ndx","peopleGroupRec","client_group_id","prepareTargets","includeGroups","includePeople","responsibleList","responsibleObj","groupObj","allGroupArr","gKey","search","allPeopleArr","_p$name","_p$name2","JSON","stringify","getPublicGroupList","thisGroup","getPrivateGroupList","responseData","adminHierarchy","publicGroups","privateGroups","gHResponse","hierarchy","nameObj","messagingObj","parentObj","classObj","activity","matchResult","str","inst","pers","pName","pText","personList","personNames","objText","activity_code","recipientID","recipientName","title","withChildren","success","result","recursiveSearch","parent_of","top_level","addChild","parent","target","my_child","grandchildren","group_names","preferred_recipients","group_tree","recursiveSort","searchObj","level","oKeys","selectable","getGroupHierarchy","groupTree","groupNames","gXRef","_profile$groups","classHierarchy","classLevel","parent_group","this_respFor","checkGroup","this_managed","child","person_admin_class","getObservationItems","pObsKey","returnObj","pObsQkey","obsItemRec","oiRec","characteristic","getObservationKeys","observation_key","getObservations","pKey","observations","valueList","oList","returnQual","ymd","always","resolveVariables","oL","o","oRec","sort_key","sort_order","observation_code","qualObj","fee","description","image_url","qualifiers","minimum_required","maximum_allowed","return","makeObservationList","pObs","_activityRec","_activityRec$validati","activityRec","variables","clean","returnList","returnQObj","assignedClient","getActivity","listLength","this_entry","oType","oKey","oClient","cList","cQual","patient_id","getLambda","cleanedList","sortedSection","r","valid_values_list","value_qualifiers","lambdaString","lCleaned","lFunction","lString","rValues","rQual","lObj","e","body","params","FunctionName","ClientContext","require","util","base64","encode","InvocationType","LogType","Payload","data","lambda","invoke","err","payloadObject","parse","response_code","response_values","response_qualifiers","getObservationOptions","display_value","pCode","getServiceRequests","sortInstructions","isObject","checkSort","order","rT","rP","person","requestor","request_type","request_id","local_key","foreign_key","rTarray","assigned_to","Limit","ScanIndexForward","loopCount","unSortedList","index","ExclusiveStartKey","LastEvaluatedKey","limit","putServiceRequest","currentTime","timestamp","requestDate","requestID","proxy_user","author","sDate","onBehalfOf","historyArray","history","serviceRequestRec","requestType","activity_key","original_request","assign_to","update_time","requestStatus","last_status","notes","attachments","Location","composite_key","goodWrite","requestLogRec","last_update","messageResult","rMsg","rTime","preparedMessages","prepareMessage","thread_id","messages","sendResults","sendMessages","sent","message","updateServiceRequest","instructionList","instructionNumber","this_instruction","handleTest","SRDocument","prepareSRDocuments","document_type","sendSRDocuments","distribution_method","documentType","SRDocuments","page","pdfLaunch","htmlMessage","rawMessage","pdfLine","align","image","pdfCurrent","style","size","after","authorName","tLower","oboWord","pDateTime","absolute","creator_id","cTyp","cLab","pdfDown","formattedRequestObj","formatServiceRequestDetails","this_selection","optionList","entries","pdfStyle","before","this_option","noNewLine","italic","indent","images","refText","process","href","yPos","noNewPage","html","plainText","pdf","doc","factForm","SRDocObj","methodList","messageObj","testMode","messageText","htmlMessageText","recipientList","recipient_list","subject","attachment_method","goodS3","s3Resp","s3","upload","Bucket","Body","output","ACL","ContentType","attachment_data","filename","content","disposition","content_id","force_method","preffered_method","handleServiceRequestMessaging","on_behalf_of","unProcessed","logRec","last_visited","retryNeeded","initialCount","finalCount","retryCount","this_Request_group","this_Log_group","failedItems","requestObject","RequestItems","writeResponse","batchWrite","PutRequest","log_time","UnprocessedItems","returnMessage","this_request","total_fees","selections","textInput","rowType","fees","rowDetails","row","isChecked","textValue","selection","text","qualSelections","input","includeFees","moreInfo","qualData","option","display","requestDetailsObj","s","_this_request$qualifi","_this_request$fees","_this_request$qualifi2","this_fee","Intl","NumberFormat","currency","format","_this_request$options","this_choice","_this_request$options2","_this_request$options3","_this_request$options4","_this_request$options5","pushIt","_this_request$fees2","fee_string","validRequestStatus","pRequestType","pStatus","currentSession","rType","service_request_types","statusList","getMessages","thread","record_type","inBodyData","results","requestRec","bodyList","messageList","returnResults","inBody","requestInfo","activityName","request_date","request_ID","reprint","overrideMethod","needMultiPrint","firstDoc","_this_request$format","multiPrint","lastDoc","resolveMessageVariables","method","htmlText","pdfInfo","formatRequestDetails","buildDocument","mealTicketFormat","processRules","fNArr","fName","decodeURI","requestToTest","skipTo","thenArray","passedTest","check","resolved","then","else","rule","instruction","urgent","custom_text","inString","workString","front","rest","variable","back","env","charAt","pMe","listFromArray","dDate","dType","keyDate","if$","then$","qObj","q","summaryType","margin","spaceBetweenLines","renderCheckBox","aVal","topic","sVal","lineSpacing","aVal_raw","qual","tOut","fileName","s3Key","s3Bucket","S3_bucket","_body$messaging","_body$messaging$forma","this_method","pdfResp","savePDF","local","S3","onSave","s3Location","okToShowSection","this_sectionObj","fields","this_test","show_if","this_value","field","array_in_array","printInstructions","source","callBody","logo_dimensions","pObj","oData","imageBucket","oPieces","oFile","myPiece","substring","rawObject","gotURL","getSignedUrl","Expires","ContentLength","gotObject","getObject64","bold","ignoreNextLine","instruction_type","instruction_key","lines","lineKey","testSucceeded","_body$messaging2","_body$messaging2$form","PDF","pBlob","data64","responseStatus","open","save","saveName","_body$format","seat_key","tableNumberKey","keyRequest","requestList","aSort","bSort","width","pageWidth","border","font","family","large","medium","small","tiny","layout","orientation","info","top","bottom","left","right","printableArea","jsPDF","unit","titleWords","outTitle","pdfLineMealTicket","client_name","outClientName","author_id","order_timestamp","author_name","table_key","location_key","locationKey","outAuthor","outTime","outSeat","outRequestor","choiceList","choice","outO","tLine","initials","rect","setFont","lastSize","setFontSize","nextLine","getTextWidth","OGtext","tWords","firstLine","_body$pdf","_body$format2","addPage","pageHeight","internal","pageSize","height","center","centerPoint","nowTime","xPos","pageNumber","getNumberOfPages","reportTime","customizations","print_specs","logo_width","logo_height","pdfHeader","pageN","savedStyle","newX","pdfHTML","estimated_rows_needed","footerText","printed_height","sizeEstimate","ceil","estimated_y_units_needed","fontSize","scale_factor","print_scale","print_ypos","print_xpos","BOLD","NORMAL","protectOrphan","imageWidth","imageHeight","img","Image","src","onload","naturalWidth","naturalHeight","xOffset","addImage","radio","circle","radioSelected","callback","windowWidth","html2canvas","y","autoPaging","split_lines","this_line","splitTextToSize","pdfImage","getImageSize","shrinkFactor","Promise","res","onerror","postTime","toSend","mCount","uuid","PostOfficeRec","voiceMail","voice_mail","allowReplyAll","to","ind","gCode","gr","goodSend","goodPost","sName","messageHistory","mRecs","headerLine","in_out","was_held","mR","posted_time","created_time","mInfo","mLine","deliver_method","endsWith","rule_used","mRLast","update_contents","deliver_to","time","line","eventCache","slotTimes","eventRec","occRec","slotRec","_eventRec$time","_occRec$time","_eventRec$time2","_occRec$time2","eventStart24","from","event_start_time24","eventEnd24","event_end_time24","slotPattern","slotArray","occData","foundNdx","slot","slotData","found_end_time24","found_start_time24","slot_description","slot_object_list","found","find","found_start","found_end","start24","end24","getCalendarEntries","statusUpdate","_body$filter","_body$filter2","_body$filter3","_body$filter4","_body$filter5","_body$filter6","_body$filter7","start_Date","end_Date","startDate","numeric","endDate","returnArr","rC","rV","makeString","event_id","rTin","rO","occurrence_id","occurrence","create_occ","allow_create","rParts","newOcc","putEventOccurrence","event_key","getSlotList","slotObj","cRecs","eventData","calData","last_ampm","show_ampm","_eventRec$eventData3","_eventRec$eventData3$","_eventRec$eventData3$2","_eventRec$eventData4","_eventRec$eventData4$","_eventRec$eventData4$2","event_data","sign_up","calc_ampm","slot_sort","status","show_this_slot","slot_start_time24","slot_end_time24","slotRecs","ownedSlotsFound","rNum","slotKey","owner_location","owner","current","this_person","makeReadableName","marked","defaultSlotOwners","newSlotObj","copySlots","occExists","indexAt","occurrence_date","stopLoop","pItem","pPrimary","pFirst","from_occ","to_occ","from_event","SlotData","newSlot","writeSlot","readableName","this_slotObj","getOccurenceList","event_occurrence","from_date","from_numeric","to_date","to_numeric","occArray","fDate","tDate","occPattern","recurrence","candidate","day_of_week","validateOccurrenceDate","foundEnough","firstWeek","firstDate","first_date","d","monthToCheck","day_of_month","yearToCheck","checkDate","possDate","done","day_of_year","specified","number_of_occurrences","inDate","numericDate","stringDate","exceptions","last_date","oResp","inEvent","reqOcc","evRec","ocRec","eventIn","dateFromEvent","eventRecs","oDate","putCalendar","last_written_occurrence","addOccurrence","makeSlotName","pSlot","nSlot","occ_id","slotHistory","slotDataObj","override_name","makeHistory","note","ownerRec","documents_assigned","newDescription","newLocation","slot_owner","list_key","schedule_key","default_forms","documentsAssignedToThisPerson","formList","ownerList","slotInfo","this_slot","this_form","pertains_to","owner_groups","oN","this_owner","assign_groups","document_id_toBeAssigned","goodGet","foundDocumentAlreadyCompleted","queryObj","form_id","queryResult","document_id","personThatNeedsToBeAssigned","putDocument","incomplete","formType","formType_date","date_assigned","this_document","docRef","documents","needsUpdate","uniqueDocRef","item","pos","self","updateExpression","expressionAttributeNames","expressionAttributeValues","resolve","isEmpty","no_messaging","overrideRecipientList","overrideRecipient","subjectText","override_subject","override_description","override_messageText","msgObject","this_message","middle","occurrenceData","_body$filter10","_body$filter11","_body$filter12","_body$filter13","slots","eventInfo","occInfoArray","rec","makeNumber","sID","time_from","slotName","v2buildCalendar","screenStatus","start_date","end_date","setDateRange","peopleInfo","conflicts","startObj","endObj","this_date","events","date_words","relative","oRecs","sorted_oRecs","total_oRecs","current_oRec","current_event","this_event","current_occurrenceDate","current_occurence_asDate","current_occurence_tomorrow_asDate","this_occurrence","skip_event","filter_groups","group","filter_owners","this_oRec","write_me","slot_owners","this_slotOwner","_eRec$Item$eventData","_eRec$Item$eventData2","_eRec$Item$eventData3","_eRec$Item$eventData4","_eRec$Item$eventData5","_eRec$Item$eventData6","eRec","allowed_group","slot_names","makeSlotNames","occurrence_cancelled","makeSort24","instance_number","try_again","slotTimesResponse","event_description","start_time24","end_time24","this_Sunday","dayOfWeek","summaries","minutes","availability","start_time","end_time","minutes_booked","event_title","greetings","greetingsAll","holidays","mmdd","obs","yymmdd","sort24","this_start","this_end","this_eventData","time$","lastID","found_slotObj","sO","AWS","sak","keyList","id2","indexer","len","DynamoDB","DocumentClient","apiVersion","region","accessKeyId","secretAccessKey","CognitoIdentityServiceProvider","elastictranscoder","ElasticTranscoder","stepFunctions","Lambda","cloudfront","CloudFront","recordId","Count","getLocalWeather","client_weather","weather","restAPI","hostname","path","nws_office","nws_x","nws_y","headers","properties","periodWords","periods","place_name","detailedForecast","getMarqueeMessage","urgentMessage","selectedMRecs","mRec","future_OK","belongsTo","allowedGroup","rawData","sRec","criticalMessage","priorityMessage","sessionStorage","setItem","pValue","arr","obj","prop","pArray","inArray","ignoreBlank","makeList$","link","nextToLast","threeOrMore","linkWord","or","cRec","custom_key","inP","returnValue","pNum","pLink","lim","return$","stringToColor","string","hash","charCodeAt","color","constructor","returnString","outObj","pair","makeObject","makeObj","pairs","extract","f_left","f_right","fuzzyLeft","fuzzyRight","includeLeft","includeRight","a1","a2","this_a","pN","parseNumeric","pStr","parseFloat","isNumeric","hasNumbers","hasText","pObjIn","pTyp","imageURI","fExt","pLen","ans","random","deepResolve","workObj","aKey","variable_name","user_id","ttime","splitInstruction","oResponse","dateOptions","iParts","tTime","parseSpreadsheet","pWorkbook","cellValue","cellColumn","cellRow","SheetNames","sheetName","currentSheet","Sheets","currentCell","isMobile","navigator","userAgent","switchActiveAccount","newClient","newPatient","user_homeClient","resetUser","sessionObject","getItem","currentProfile","removeItem","jumpTo","updateDb","pData","pData_loop","k_num","aNamesObj","aValuesObj","expression","newRec","oldRec","table","delete","deleteDbRec","getDb","getSpec","foundDoc","pRequest","api_data","finalReturn","TELSdefaults","requestHeaders","newTELSworkorder","invokeFailed","fResp","Presponse","sessionState","checkbox","ignore","required","rowTestArray","multiColumn","displayBold","displayStyle","displayItalic","doneWithTopBox","defaultCheckedWords","getActivityDetail","pActRec","preLoad_code","preLoaded","preLoad_key","preLoad_data","global_default_value","global_default_object","fact","_fact$activity_rec","_fact$activity_rec2","excludeList","default_value","activity_rec","pDefaults","defaultValues","dO","dField","rKey","dValue","resolveDefaults","prepareDefaults","resolvedActivity","activity_name","default_object","this_key","specialCases","ignoreArrayCheck","factClient","loadError","responseArray","global_defaults","column_list","column_defaults","column_object","activity_id","buildDisplayRows","listValues","defaults","displayRowList","vIndex","oValueObject","observationDefaultValue","last_instruction","oControl","oValue","docRows","noUpdate","rowTest","observationKey","getKey","desc","getQualifier","qualResponse","buildQualifiers","docLines","this_qualifier","obo_line","obo","location_line","header","row_qualifier","qKey","pQual","rememberedQualifiers","docLineList","oItem","dVal","uom","remembered","AVAclasses","makeStyles","theme","AVAAvatar","marginTop","marginBottom","minHeight","minWidth","maxHeight","maxWidth","paddingTop","roundedCorners","borderRadius","AVAButton","marginLeft","spacing","marginRight","paddingLeft","paddingRight","textTransform","textDecoration","textWrap","fontWeight","AVAButton_noBorder","AVAMicroButton","typography","noDisplay","visibility","AVATitle","AVABigBoldTitle","marginY","marginX","paddingX","AVABox","paddingBottom","AVABoxCentered","flexDirection","justifyContent","AVASmallText","AVABigBoldText","AVALargeText","AVAProgressBar","backgroundColor","transition","AVAClientBackground","AVADefaults","client_style","padding","AVAPromptBackground","promptBackgroundColor","URL","AVATextStyle","user_fontSize","returnStyle","lineHeight","overflow","optionKey","fontStyle","weight","wrap","textAlign","AVATextVariableStyle","outText","innerWidth","hexToRgb","hex","opacity","rgbToHsl","h","l","hslToRgb","hue2rgb","contrastColor","rgb","parts","isDark","hexColors","useStyles","formControl","clientPopUp","freeInput","verticalAlign","groupName","orSeparator","idText","Transition","forwardRef","ref","Slide","direction","onClose","useSession","person_filter","setPersonFilter","useState","client_filter","setClientFilter","forceRedisplay","setForceRedisplay","rowLimit","setRowLimit","onlyClient","tally","okClient","candidate_id","candidate_name","multiClient","selectedClient","setSelectedClient","classes","AVAClass","subMenuHead","useRef","rowsWritten","filterTimeOut","cLine","scrollIntoView","behavior","block","Dialog","onScroll","paper","fullWidth","elevation","TransitionComponent","handleClose","DialogContentText","className","TextField","onChange","handleChangePersonFilter","vCheck","clearTimeout","setTimeout","filterInput","autoComplete","Typography","Paper","component","Box","square","ListItem","onClick","my","alignItems","mr","alt","sx","listEntry","pLine","_state$session","_state$session$group_","inactive","okToShow","onSelect","button","flexWrap","DialogActions","Button","startIcon","CloseIcon","createPutFact","outlined","mt","py","px","borderBottom","flexGrow","container","radioText","HeadText","InstructionText","radioTextWIthTopSpacing","HeadTextWIthTopSpacing","radioButton","groupData","multiple","updateGroups","reactData","setReactData","adminGroupList","fullGroupList","enqueueSnackbar","useSnackbar","updateGroupList","myAdminGroups","myOtherGroups","myRollUpGroups","groupsToCheck","gObj","newData","force","prevValues","updateReactData","Section","List","root","onContextMenu","persist","Checkbox","foundIt","checked","TableContainer","Table","stickyHeader","TableHead","TableRow","TableCell","relationships","TableBody","relationship","access_type","formControlLbl","groupMemberList","updateSession","updateProxy","updateSubscription","person_filter_lower","setPersonFilterLower","enoughFilterDigits","setenoughFilterDigits","filterCount","respArray","showName","returnName","helperText","this_item","inTheList","filteredPerson","dense","ListItemIcon","edge","tabIndex","disableRipple","inputProps","ListItemText","primary","FormControl","RadioGroup","defaultValue","aria-label","presp","FormControlLabel","control","Radio","label","ml","CircularProgress","formControlFrom","formControlOn","formControlDayRow","formControlTo","formControlDays","centerCenter","photoButton","alignSelf","idTextNoSpacing","inputRule","inputRuleWide","defaultButton","palette","confirm","topButton","rowButtonRed","outline","reject","radioTextNoSpacing","radioDays","radioTextBold","radioTextHeader","fullBody","radioTextBig","topicBox","buttonBox","topicBoxwithHoverBorder","radioTextTop","radioTextTopRight","radioTextRight","_person$time_based_ru","_person$time_based_ru2","updateSetChange","onChangeMethod","onChangeEscalationType","onChangeWaitTime","onChangeKeyWords","onChangeEscalationData","numRows","time_based_rules","ruleRows","setRuleRows","lastEntry","setLastEntry","viewVersion","setViewVersion","linkedAccounts","setLinkedAccounts","handleChangeEscalationType","tableRow","escalationType","escalationData","accountArray","pR","getLinkedAccounts","handleChangeMethod","handleChangeEscalationData","onChangeToTime","time_to","updateRoutingDay","dayValue","removeEntry","newString","route","_route$day","_route$day3","_route$day5","_route$day7","_route$day9","_route$day11","_route$day13","FormGroup","TimePicker","clearIcon","clockIcon","disableClock","labelPlacement","_route$day2","_route$day4","_route$day6","_route$day8","_route$day10","_route$day12","_route$day14","surrogate","Input","waitTime","underline","multiline","keyWords","pIndex","DeleteIcon","handleAddRule","boxWithRoom","alignContent","picture","breakpoints","down","pConfirmedButton","resetButton","infoButton","radioTextWithTopMargin","lineTextWithTopMargin","local_boolean","local_tiny","idText1","idText2","_patient$name","_patient$name2","_state$session10","_patient$time_based_r","_patient$name3","_patient$name4","_state$user","_patient$name5","_patient$name6","isMounted","localData","setLocalData","patientGroups","setPatientGroups","responsibleArray","setResponsibleArray","proxy","setProxy","refreshTrigger","setRefreshTrigger","patientPChange","setPatientPChange","patientSession","setPatientSession","sessionVersion","setSessionVersion","changes","setChangesReact","showQuestionMark","setShowQuestionMark","photoChanges","setPhotoChanges","resettingPwd","setResettingPwd","pwdConfirmed","setPwdConfirmed","fontFactorChanged","setFontFactorChanged","editPhotoKey","setEditPhotoKey","editPhoto","setEditPhoto","cropperInstance","setCropper","setUserFontSize","fontFactor","config","setChanges","cValue","prepareLocal","localObj","ldKey","absolute_full","_localPersonRec$name","_localPersonRec$name2","_localPersonRec$messa","_localPersonRec$messa2","_localPersonRec$messa3","_localPersonRec$messa4","_localPersonRec$messa5","_localPersonRec$messa6","_localPersonRec$messa7","_localPersonRec$messa8","_localPersonRec$messa9","_localPersonRec$messa10","_localPersonRec$messa11","_localPersonRec$messa12","inactiveGroup","inactiveAssignment","groupID","localPersonRec","getPersonRec","targetSession","getSessionData","font_size","workingGroupMemberList","getGroupMemberList","_m$name","_m$name2","_m$name3","finalRespArray","workLocalData","ready","email_private","sms_private","voice_private","office_private","local_data_display","sessionClient","sessionPatient","inputPWD","last_login","PWDDisplayed","storePassword","priority_activities","favorite_activities","favorite_blocked","photoURL","requirePassword","directoryOption","directoryPartner","directory_partner","_localPersonRec$messa13","_localPersonRec$messa14","passwordDisplayed","initialize","_state$session2","_state$session3","pWho","password_change_date","_state$session4","_state$session5","temp_session","clientId","gML","hiddenFileInput","passwordSection","removeTemporaryPhoto","deleteObject","handleAbort","newUserID","pLocal","tryAgain","newID","namePart","showWarning","clientPart","numberPart","proposedID","handleUpdate","_state$session6","_state$session7","errorList","name_parts","updatePerson","pwdReset","newPassword","myClient","putPerson","updateString","newFactData","qualifier","API","graphql","graphqlOperation","_state$session8","_state$session8$group","_state$session9","fileID","extension","copyObject","CopySource","handleBlurName","prepareUserID","fullScreen","AppBar","Toolbar","IconButton","handleChangeFirstName","onBlur","handleChangeLastName","handleChangeUser","handleBlurUser","HelpOutlineIcon","checkNum","lX","FormHelperTextProps","lDate","Switch","pt","MessageRouting","numberRows","Slider","newValue","aria-labelledby","step","titleRow","hidden","click","rotate","destroy","getCroppedCanvas","toBlob","editedPhoto","File","pTarget","pFile","cfParm","DistributionId","InvalidationBatch","CallerReference","Paths","Quantity","createInvalidation","handleSavePhoto","Cropper","zoomTo","aspectRatio","viewMode","minCropBoxHeight","minCropBoxWidth","background","responsive","dragMode","movable","autoCropArea","checkOrientation","onInitialized","instance","files","pType","handleSaveTemporaryPhoto","fullAccess","ClientsSection","updatedGroupArray","RelationshipSection","LinkedAccountsSection","updatedResponsibleArray","newProxy","newStatus","handleChangeSubscriptionStatus","element","scrollToPassword","noValidate","borderColor","wipPassword","_currentValues$people5","_currentValues$people6","_currentValues$people10","_currentValues$people11","_currentValues$people12","_currentValues$people13","_currentValues$people14","_currentValues$people15","_currentValues$people16","_currentValues$people17","_currentValues$people18","_currentValues$people19","_currentValues$people20","_currentValues$people21","_currentValues$people22","_currentValues$people23","_currentValues$people24","_currentValues$people25","_currentValues$people26","_currentValues$people27","_currentValues$people28","_currentValues$people29","_currentValues$people30","_currentValues$people31","_currentValues$people32","_currentValues$people33","_currentValues$people34","_currentValues$people35","_currentValues$people36","_currentValues$people37","_currentValues$people38","_currentValues$people39","_currentValues$people40","_currentValues$people41","_currentValues$people42","_currentValues$people43","_currentValues$people44","_currentValues$people45","_currentValues$people46","_currentValues$people47","_currentValues$people48","_currentValues$people49","_currentValues$people50","_currentValues$people51","_currentValues$people52","_currentValues$people53","_currentValues$people54","_currentValues$people55","_currentValues$people56","_currentValues$people57","_currentValues$people58","_currentValues$people59","_currentValues$people60","_currentValues$people61","_currentValues$people62","_currentValues$people63","_currentValues$people64","_currentValues$people65","_currentValues$people66","_currentValues$people67","_currentValues$people68","_currentValues$people69","_currentValues$people70","_currentValues$people71","_currentValues$people72","currentValues","ogValues","setError","updateField","makeLocation","address","_currentValues$people","_currentValues$people2","_currentValues$people3","_currentValues$people4","updateList","tableName","fieldName","errorMessage","_currentValues$people7","_currentValues$people8","_currentValues$people9","errorField","errorValue","isError","updateObj","errorObj","cell_phone","storage_format","number_part","contact_info","number","landline_phone","landline","work_phone","work","alternate","alternate_phone","domain","valid","alt_email","address2","city","zip_code","emergency_contact","contact1","contact2","local_customFields","this_customField","cFNdx","_currentValues$people73","_currentValues$people74","local_result","numeric_result","prompt","focusedSection","focusAt","form_fields","this_formField","dialogPaper","listItem","onCancel","allowRandom","multiSelect","splitter","alreadyChecked","visible_filter","setVisibleFilter","random_address","setRandomAddress","maxY","setMaxY","checkList","setCheckList","toggling","toggleCheck","buildList","split_on_whitespace","initial_checklist","toReversed","preselected_person","foundPerson","newLimit","filterNumbers","formatted","conflict","conflictEntry","CheckIcon","progressBar","titleText","dialogBox","subDescriptionText","listItemAVA","pReturnValue","setMessageTargets","loading","setLoading","gResponse","adminAccount","DialogContent","dividers","mb","client_logo","textOverflow","PersonFilter","selectedPerson","containerBox","contentBox","radius_rounded","overflowX","imageArea","buttonArea","tightRight","radioHeader","promptText","promptUse","buttonText","sender","pRecipientID","pRecipientName","onComplete","setUrgent","setMethod","allowCancel","seedText","setFocus","rList","selectID","IDImage","newAccount","attachmentList","promptUsage","checkPrompts","HTMLMessage","viewAsHTML","multipleRecipients","nameInput","isUrgent","forceMethod","imageURL","focus","noInput","handleAddAccount","lName","pParse","pAddress","isEmail","isPhone","workingID","queryExpression","ProjectionExpression","checkRecs","maxID","makeUniqueID","patient_display_name","onNameEnter","makeTitle","selectedData","rArray","nArray","hasGroups","SendMessageDialog","pb","mx","handleChangeNameInput","onKeyPress","dangerouslySetInnerHTML","handleChangeTextInput","qualOption","CloudUploadIcon","handleSaveFile","sendToID","sendToName","senderName","principalMessageText","voiceMailText","u","resp","handleSave","SendIcon","reactUpdObj","proxy_allowed_from","alert","severity","person_notes","this_urgentNote","uNx","noteText","user_name","myImage","address1","myFamilyMembers","p1","p2","memberNdx","viewFamilyMember","tIndex","viewFamilySnapshot","this_note","nx","sectionNdx","sections","section_name","isOpen","InfoIcon","sendMessage","PhoneInTalkIcon","administrative_account","MakeMessage","user_display_name","PeopleMaintenance","initialValues","sectionToShow","createDocument","docData","form_type","docRec","client_id_form_type","update_by","formData","documentDueDate","due_date","formRec","restricted_access","goodPut","docOut","formIn","dueDate_key","formRecIn","due_by","temp_dueDate","this_dueBy","checkMe","updateDocument","_ref2","isNew","save_type","url","pending","docBasis","fetchedRec","notTitle","cancelText","confirmText","onConfirm","makeLine","makeIndent","promptLines","pl","bgcolor","bgColor","blankLine","GoBackIcon","onLoad","uploadList","saving","focusOn","loadProgress","allowAttach","loadingInProgress","this_title","grow","bgColor_option","radioHead","progress","LinearProgress","total","oneOnly","s3Data","partSize","queueSize","reactData_index","send","on","abort","pFactor","loaded","s3file","converterParms","PipelineId","Output","PresetId","converterOK","createJob","fType","fLoc","formControlCheckGroup","formControlTitle","clientBackground","breakRow","flexBasis","inputDisplay","_reactData$formRec4","_reactData$formRec4$o","signatureRef","req","play","useSound","AVA_AlertSound","volume","nowObj","document_title","familyRec","family_id","newPerson","newFamily","stage","errorsOnForm","formUpdates","lastActiveTime","idleState","clientSampleMode","isInitializing","valuesChanged","reset","useIdleTimer","onIdle","minutesSinceActive","enteredIdleStateTime","final","timeout","recWritten","document_status","onAction","throttle","setFieldDefault","_reactData$fields$thi","_reactData$fields$thi2","_reactData$fields$thi3","_reactData$fields$thi9","_reactData$fields$thi10","this_field","defaultObj","formFieldRec","field_name","sourceDefaults","this_default","source_path","source_file","object","value_path","notime","makeNewUser","tableDefaults","tables","_reactData$fields$thi4","_reactData$fields$thi5","_reactData$fields$thi6","_reactData$fields$thi7","_reactData$fields$thi8","ignore_if","_reactData$fields$thi11","_reactData$fields$thi12","ignoreList","initializeDoc","preset_values","_ref4","pertains_to_name","_reactData$peopleRec$","_reactData$peopleRec$2","tempTitle","form_name","this_section","occurrences","section_number","field_index","default_source","saveAs","field_key","field_variables","_formRec$fields$this_23","_formRec$fields$this_24","_formRec$fields$this_25","_formRec$fields$this_32","_formRec$fields$this_33","_formRec$fields$this_34","_formRec$fields$this_35","_formRec$fields$this_36","_formRec$fields$this_39","form_field","newLine","_formRec$fields$this_21","_formRec$fields$this_22","_formRec$fields$this_26","_formRec$fields$this_27","_formRec$fields$this_28","_formRec$fields$this_29","_formRec$fields$this_30","_formRec$fields$this_31","_formRec$fields$this_40","fill","og_default","formatValue","rawValue","_formRec$fields$this_37","_formRec$fields$this_38","valueText","selectionObj","selectionList","bonusList","bonusText","log_results","viewOnly","edit","ifEmpty","resetFields","sigRefNumber","wip_saveAs","wip_file","found_index","this_word","logAs","_ref5","_ref6","timeOnly","_reactData$peopleRec$3","_reactData$peopleRec$4","makeNextAction","_ref7","reconcilePrompt","_ref8","isExisting","candidateB","num","family_name","handleChangeValue","_reactData$fields$pro","newText","newList","occ_index","_ref9","this_resetter","_ref10","answer","rememberAnswer","vValue","extracted_field","field_part","regex_part","RegExp","show_log","_reactData$pathFile","pathFile","logLine","AVACheckBoxGroup","clickText","handleMakeSelection","withPrompt","resolveValue","resolvedObj","_reactData$formRec","_reactData$formRec$op","_reactData$docRec","_reactData$formRec2","_reactData$formRec2$o","_ref11","field_values","_reactData$fields$thi19","valueArray","_reactData$fields$thi20","save_instructions","save_file","if_value","log_instructions","log_file","putError","noFinal","signatures","getTrimmedCanvas","toDataURL","_ref3","documentList","numberOfDocuments","docIndex","docInfo","docID","sectionObj","noPrint","line_was_compressed","compressPrint","other","showNA","printDocumentB","_reactData$docRec2","_reactData$formRec3","_reactData$formRec3$o","send_message","attach","createForm","instructions","source_doc","doc_location","dataSaved","send_instructions","newMessageThread","message_id","reply_to","recipient_key","send_to","deliver_time","message_text","recipient_base","_ref12","form","newDocumentID","final_messageText","origin","this_assignment","final_html","_reactData$fields$a$","_reactData$fields$a$$","_o$a$","_o$a$$prompt","printWIP","_ref13","endX","this_text","promptWidth","printDocumentHybrid","dontShowSection","reason","memberOf","mode","_formRec$fields$this_3","_formRec$fields$this_4","_formRec$fields$this_5","_formRec$fields$this_12","_formRec$fields$this_13","_formRec$fields$this_16","_formRec$fields$this_17","_formRec$fields$this_18","_formRec$fields$this_19","_formRec$fields$this_","_formRec$fields$this_2","_formRec$fields$this_6","_formRec$fields$this_7","_formRec$fields$this_8","_formRec$fields$this_9","_formRec$fields$this_10","_formRec$fields$this_11","_formRec$fields$this_20","_formRec$fields$this_14","_formRec$fields$this_15","initializeBlank","printType","printEmptyDocument","start_from_scratch","goLoad","fieldNdx","_reactData$fields$thi21","a_zero","rows","fPhone","dObj","rel","helper","SignatureCanvas","canvasProps","clear","Select","choose","searchBy","dropdownHandle","clearOnSelect","clearOnBlur","searchable","create","closeOnClickInput","closeOnSelect","borderWidth","noDataLabel","placeholder","borderTop","noSaveContinue","activeErrors","suppressSection","_reactData$fields$thi13","_reactData$fields$thi14","_reactData$fields$thi15","_reactData$fields$thi16","_reactData$fields$thi17","_reactData$fields$thi18","mySelections","handleReview","PrintIcon","rowButton","AVAUploadFile","_reactData$formRec5","_reactData$formRec5$o","_reactData$formRec6","_reactData$formRec6$o","nextAction","onFinish","AVAConfirm","_reactData$formRec7","_reactData$formRec7$o","_reactData$formRec8","_reactData$formRec8$o","Snackbar","autoHideDuration","anchorOrigin","vertical","horizontal","Alert","this_action","actionNdx","function","AlertTitle","_reactData$masterForm2","checkCircleDisplayed","circleDisplayed","orangeCircleDisplayed","redCircleDisplayed","redPencilDisplayed","orangePencilDisplayed","pencilDisplayed","addAmendmentDisplayed","historyAmendmentDisplayed","historyDisplayed","masterFormList","my_form_people","myFormListObj","myPersonRec","this_groupID","forms","view_only","_formData$formRec","_formData$formRec$opt","why","dueDate","wipDocs","assignedDocs","completedDocs","isUpdating","isAmending","allDocs","this_doc","_formData$formRec2","_formData$formRec2$op","completed_count","cObj","date_completed","amendments","doc_status","person_first_name","formsInitialized","setPencilColor","setCheckCircleColor","setRefTrue","refToSet","editForm","this_person_id","this_formID","formHistoryMode","form_index","_reactData$masterForm","CheckCircleIcon","nowJ","EditIcon","RadioButtonUncheckedIcon","allowAmendments","AddCircleIcon","isAmendingForm","DynamicFeedIcon","FormFillB","ignore_me","statusObj","isPrinting","doc_reference","docNdx","_reactData$masterForm3","file_location","this_amendment","mandatory_passwords","forceSetPassword","password","proposedPass","master_account","messageOptions","enabled","show","exclusive","textWrapStyle","preferred_methods","optionAt","urgent_keyWords","methods","this_rule","global_rule","rule_id","ArrowDownwardIcon","ArrowUpwardIcon","errorIndex","_this_rule$time_range","from_time","time_range","_this_rule$time_range2","to_time","this_day","day_num","_this_rule$day","_this_rule$day2","when_urgent","proxyOptions","proxy_id","previous_option","check_option","justifyItems","note_id","number_of_proxy_accounts","addAccountList","this_class","selected_classIndex","addPerson","newName","reactUpd","addFamilyMember","linkedPersonFilter","raw","lower","_reactData$linkedPers","_reactData$linkedPers2","OKtoShow","proxyRec","newFamilyMembers","_currentValues$sessio","_currentValues$sessio2","languageTable","preferred_language","myAnswer","photo","temp","imageEditing","newPhoto","dropdownPosition","clearable","multi","keepSelectedInList","onInputChange","new_messaging_required","useNewMessaging","clicked_group","parentGroup","foundParent","parentAt","test_group","popUpMenu","paperPallette","padRight","_reactData$current$pe19","_reactData$current$pe20","_reactData$current$pe21","_reactData$current$pe22","initialized","popupMenuOpen","recentlyCompletedDocs","familyFormsObj","allow_old_messaging","user_class","OKtoSave","saveCompleted","image_editing","components","Snapshot","component_id","ProfileSection","AdministrativeSection","MessagePreferencesSection","LinkedAccounts","PersonalizationSection","GroupAssignments","PersonNotes","TechInfoSection","FormSection","og","peopleAccountRecs","peopleGroups","handleResize","isAuthorized","version_id","component_name","parm_personRec","_state$session$global","_peopleRec$Item$messa","_peopleRec$Item$messa2","_peopleRec$Item$messa3","_peopleRec$Item$messa4","_peopleRec$Item$messa5","global_mail_rules","_peopleRec$Item$time_","_state$session2$globa","start_index","formFieldsRec","this_fieldRec","showOnProfile","unresolve","isEnabled","isDisabled","set_sectionName","linked_accounts","this_type","add_account","existing_type","saveChanges","person_id_blank","_reactData$current$pe9","_reactData$current$pe10","_reactData$current$pe15","_reactData$current$pe16","_reactData$current$pe17","_reactData$current$pe18","_reactData$current$pe11","_reactData$current$pe12","_reactData$current$pe13","_reactData$current$pe14","_reactData$current$pe","_reactData$current$pe2","_reactData$current$pe3","_reactData$current$pe4","_reactData$current$pe5","_reactData$current$pe6","_reactData$current$pe7","_reactData$current$pe8","Avatar","greetingName","aria-controls","aria-haspopup","anchorEl","currentTarget","Menu","keepMounted","MenuList","MenuItem","SwapHorizIcon","HomeIcon","_reactData$options","_reactData$options2","zIndex","borderLeft","borderRight","componentName","SectionToRender","errorItem","this_update","renderSection","listToUpdate","preparedOGList","passedIn","prepare","allDone","OGList","currentList","messageArea","Tooltip","MoveUpIcon","MoveDownIcon","titlePersonSelect","listItemHighlighted","noRow","timeInput","personalEvent","showNewEvent","isAppointment","ownerTargetInfo","setOwnerTargetInfo","setLastDate","lastAsADate","setLastAsADate","specificPeople","setSpecificPeople","customizeButton","setcustomizeButton","specificOwners","setSpecificOwners","signup_type","setSignUpType","setDefaultSlotOwners","slot_max_seats","setSlotMaxSeats","slot_interval","setSlotInterval","eventDateAsDisplayString","setEventDateAsDisplayString","dateObj","displayTimes","setIntervalDisplay","showOwnerSelect","setShowOwnerSelect","setOwnerList","checkedDays","setCheckedDays","closeSnackbar","restrictToGroups","slotObjList","event_date","prefMethod","preReservationList","setPerson","chosen_names","title_override","event_location","location_override","allDay","timeOK","dOfw","intervals24h","time_duration","oDays","eventID","calendar_info","inR","occDays","setRecurrence","schedule_type","timeObj","from_minutesSinceMidnight","duration","fromObj","toObj","tempTime","restrictions","personal_event","reminders","reminder_minutes_Enrolled","reminder_minutes_NotEnrolled","name_security","slot_visibility","inCalInfo","inNum","starter","lastSeat","setSeatNames","occRecords","addEvent","writeRequest","localStorage","handleChangeEventDate","handleLastDateExit","addYears","yyyy","toDateString","setEnd","setStart","setDuration","rawList","makeChoices","defaultStyles","isSelected","peopleNames","reservationList","location_override_override","handleChangeDescription","handleChangeLocation","toLocaleDateString","this_dow","simpleForm","reactUpdateObj","updatedList","handleSetSlotTimes","intervals","useFromTime","useToTime","hh_raw","ownerEntry","ownerTargetObj","pChoices","EditList","allowAdd","_reactData$linkedPers15","this_pref","withGroups","groupInfo","groupList_minLevel","loadList","my_children","this_level","next_level","keepSelections","countSelections","selectedPeople_count","selectedPeople_list","selectionPeople_obj","showAll","sIndex","pickAndGo","person_name","listName","withPreferred","showPreferredList","this_recipient","rIndex","this_object","_reactData$linkedPers3","_reactData$linkedPers4","_reactData$linkedPers5","_reactData$linkedPers6","OKtoShowPreferred","hidePeople","showGroupList","gIndex","_reactData$linkedPers7","_reactData$linkedPers8","_reactData$linkedPers9","_reactData$linkedPers10","OKtoShowGroup","showGroupEdit_id","withSpecialValues","special_values","_reactData$linkedPers11","_reactData$linkedPers12","_reactData$linkedPers13","_reactData$linkedPers14","this_special","responseA","skip","char","pickOne","person_firstName","person_lastName","showProfileEdit_id","buttonColor","updatedPerson","newMessagePage","SendButton","myImageArea","makeIconStyle","locationLine","preferenceLine","attachmentLine","techInfoLine","techInfoLine2","timeLine","_reactData$newMessage","_reactData$selections","pMessageList","onReset","attachments_to_send","newMessage","confirmMessage","confirmessage_index","deletePending","expanded_composite_key","forceReloadTime","imageTable","inOut_filter","isSmall","isTiny","lastReloadTime","messageFilter","messageFilterLower","myName","newMessageMode","newMessageRecipients","recipients","newMessageSubject","newMessageText","newMessageVMAlternative","newMessageVMAltText","newUrgentMessage","replyToList","showDeleted","showIndividualList","showQuickSearch","singleFilterDigit","statusFilter","statusMessage","sorted_threads","threadObj","threads","viewPeopleMaintenance","warning","window_width","last_displayed_thread","status_filter_result","onImageError","makeReadableTime","pJavaDate","hour12","allMessages","inRecs","processDeliveryRecs","outRecs","deliveryRecs","inOut","my_id","totalProcessed","totalCount","this_deliveryRec","sent_from","delete_flag","message_number","message_added","hLink","subject_line","sent_time","author_image","status_urgent","urgency","status_with_attachment","Boolean","partner_id","other_recipients","recipient_number","recipient_id","recipient_name","wasHeld","status_held","status_blocked","status_redirected","status_with_rules","status_not_og","not_original_recipient","heldUntil","standardizeMethod","holdUntil","hold_reason","this_result","last_update_time","delivery_status","deleted_by","loop_until","raw_method","onError","SettingsIcon","showReplyToSearch","_reactData$preferred_","_reactData$preferred_2","aLine","aIndex","AttachmentIcon","recipientMessageText","getAttachment","this_thread","thread_index","message_index","this_messageIndex","personFilter","inculdes","makeSubject","makeToLine","makeMethodLine","overflowWrap","overflowY","makeRecipientLines","result_index","ExpandMoreIcon","ExpandLessIcon","ReplyIcon","flex","dRec","new_deleted_by","handleRemoveMessage","QuickSearch","reduce","peopleBox","scrollbarWidth","peopleBoxWithSpace","dragNamesFirst","dragNamesLast","assignment_avatar","_state$patient","_state$patient$name","activity_filter","setActivityFilter","lower_activity_filter","setLowerFilter","building","columnSort","daysToMonitor","denseView","event_being_edited","filterTextLower","groupsManagedObject","pGroupList","selectAll","selectOpen","selectPrivate","selectMine","prepareGroupObject","isDarkMode","useMediaQuery","needRef","newGroups","popUpOpen","progressMessage","pWidth","received_mode","selectDate","selectedPerson_id","selectedPersonRec","selectedPersonFirstName","selectedPersonLastName","showList","show_group","showGroupSelect","selectedGroup_id","selectedGroupRec","selectedGroupMembers","timeLastFetched","timeWindowStart","updatesMade","minimumGroupLevel","calcMinimumGroupLevel","groupMembersUpdated","messageFetch","selectMembers","messageData","held","blocked","redirected","bounced","with_attachment","with_rules","received","not_og","_this_message$content","_this_message$content2","_this_message$recipie","_this_message$author","isAttachment","ruleUsed","_this_message$author2","objRefIncrement","rule_list","recipient","PeopleIcon","listIndex","inObj","kX","cX","personMessages","personMessages_inOutFilter","personMessages_statusFilter","onChangeCommitted","updatedSelections","resetTimeWindow","marks","seletedGroupMembers","MessageForm","rowsDisplayed","message_filter","setMessageFilter","message_filter_lower","setMessageFilterLower","setSingleFilterDigit","setMessageList","showAddPrompt","setShowAddPrompt","messageResults","setMessageResults","setDeletePending","setConfirmMessage","confirmID","setConfirmID","confirmIndex","setConfirmIndex","promptForMessage","setPromptForMessage","setRecipient","recipientIndex","setRecipientIndex","setOpen","setDefault","inOut_mode","setinOut","pContent","toggleOpen","pMessageID","workingOpen","pCommonKey","returnData","getReceiptDetails","requestBody","getMessageResults","attachmentName","messageArray","language","this_image","patient_name","sender_name","sender_id","sender_image","common_key","message_content","toLine","randomName","pMessageRec","mIndex","Collapse","in","unmountOnExit","pThreadID","threadHeaderRec","responseList","destination","replyAllList","pMessage_id","tempMessageList","ContactMailOutlinedIcon","MarkunreadMailboxOutlinedIcon","screenBody","rowButtonConfirm","uploadButton","rowButtonReject","rowButtonGreen","fileTag","fileType","file","LoadIcon","textLine","descText","profileArea","popUpMenuRow","popUpFooter","inputRow","subTitle","_reactData$textInput","factName","cancelPending","confirmStatus","confirmPrompt","checkedToSave","initialLoadComplete","errorOnScreen","dataRows","setDataRows","setAnchorEl","linkURL","setLinkURL","factType","pChecked","workDataRows","workChosenQ","chosenQual","links","getDescription","defaultChecked","defaultDataRows","altValue","freeText","_fact$value","setValue","displayRows","initialLoad","onCheckEnter","handleDateExit","handleTimeExit","handleTextExit","AVAdate","isQChecked","pQualName","pChoice","textIsPresent","handleClick","AutorenewIcon","this_index","workChecked","qRndx","opt","oX","pOrderOption","pQualifier","pQualChoice","qRule","workArray","max_allowed","min_required","handleQualChecked","oBo","foreignKey","requestObj","putSR","cStatus","pDisplayRows","errorsExist","rText","qRow","aRow","makeConfirm","placeHolder","promptBackground","errorText","keyPressed","setTextInput","inputValue","buildValueList","promptArray","titleArray","buttonArray","tx","selectOne","toggleCheckbox","sel","autoFocus","save_on_enter","currentFocus","this_prompt","promptParts","innerText","maxAttach","smallTextLine","whiteSpace","rootNoPadding","backGroundRed","backGroundGreen","backGroundNone","hiddenItem","listTopRow","listItemSticky","position","familyMembers","newAccountForm","showCompleted","restrict_to_client_id","selectedColumn","columnForms","setPopupMenuOpen","prepareField","_fieldData$default","editMode","fieldData","data_value","_reactData$columnForm","_reactData$columnForm2","refValue","refField","_reactData$columnForm3","_reactData$columnForm4","_reactData$columnForm5","_reactData$columnForm6","getRefValue","refs","remainingData","this_ref","refWords","visible_value","raw_value","allNums","cleanValue","nickname","isBlank","foundFamily","_state$patient2","_state$patient2$name","newFamilyID","role_if_new","familyRecs","familyHeader","this_familyRec","last_state","this_columnNumber","_familyMembers$","_familyMembers$$name","may_create","account_types","accountTypeList","noFamilyColumn","this_formList","makeFormList","selectAForm","editColumn","_reactData$columnForm7","_reactData$columnForm8","afterObj","formObjList","_reactData$defaults","this_obj","this_formObj","_this_form$options","existingComplete","existingCompleteRecs","existingWIP","getForm","date_started","anonymous","asForm","useFamilyID","form_status","saveAndClose","column_index","this_column","familyIn","saveObj","makeHandlerArray","valueObj","ar","resolveValues","personIn","sessionIn","eMail","familyOut","workList","handleArray","arrayToHandle","subArray","oWork","nDx","oIn","checkObj","makeFormRequest","makeScreenName","_reactData$familyMemb","personName","_this_column$name","wX","suppressAddPerson","addDocPrompt","GroupAddIcon","contextText","formStatus","addNewAccountDoc","form_if_new","new_account_form","identifyNewAccountForm","roleToAdd","_statusObj$recWritten","_statusObj$recWritten2","newLength","AVATextInput","this_one","docParts","storedSignature","version__number","savePending","incompleteMode","document","sampleField","reactValues","setReactValues","valuesChangedSinceLastSave","setValuesChangedSinceLastSave","updateReactValues","newDocument","loadInitialOptions","saveCallObj","save_continue","coords","getPosition","isGeolocationAvailable","isGeolocationEnabled","positionError","useGeolocated","positionOptions","enableHighAccuracy","userDecisionTimeout","watchLocationPermissionChange","makeDefault","_reactData$formRec$fi","_reactData$formRec$fi2","_reactData$formRec$fi3","_reactData$formRec$fi14","_reactData$formRec$fi15","default_peopleList","default_ref","prompt_ref","defaultText","_reactData$formRec$fi4","_reactData$formRec$fi5","_reactData$formRec$fi6","documentsObj","loadDocument","recent","fuzzy_search","assigned__to","newPrompt","_reactData$formRec$fi7","_reactData$formRec$fi8","readableTime","textDescription","defaultType","_reactData$formRec$fi9","_reactData$formRec$fi10","_reactData$formRec$fi11","_reactData$formRec$fi12","_reactData$formRec$fi13","defaultSelections","defaultSelectionList","handleChangeListText","defaultDate","whoIS","recordID","_reactData$selectedPe","_reactData$selectedPe2","_state$recordID","_state$recordID$name","_state$recordID2","_state$recordID2$name","_state$recordID3","_reactData$selectedPe3","_reactData$selectedPe4","_reactData$selectedPe5","_reactData$selectedPe6","_state$recordID4","_state$recordID4$mess","_state$recordID5","_state$recordID5$mess","formatDegrees","degrees","isLongitude","getDirection","tempObj","ogText","ogAt","forceClickOn","forceClickOff","_reactValues$props$pr2","FormLabel","_reactValues$props$pr","relatedTarget","focusVisible","documentRec","completed_by","document__title","titleFields","titleWord","_reactData$document","_reactData$document$r","completed_timestamp","_reactData$formRec$fi18","_reactData$formRec$fi19","_reactData$formRec$fi20","signature_field","specific_document","splitDoc","loadForm","reactObj","sN","fN","docValues","docDocument","_docData$fields$this_","_docData$fields$this_2","_docData$fields$this_3","signature","printDocument","_reactData$formRec$fi21","_reactData$formRec$fi22","_reactData$formRec$fi23","_reactData$formRec$fi24","_reactData$formRec$fi25","signatureImage","latitude","longitude","accuracy","authHelper","withAPIKey","locationClient","LocationClient","getLocationClientConfig","SearchPlaceIndexForPositionCommand","Position","MaxResults","Results","selectedResponse","Place","AddressNumber","textResponse","netAccuracy","Distance","calcAccuracyFeet","round","Label","reverseGeo","speed","errorFields","_reactData$formRec$fi16","_reactData$formRec$fi17","sigImage","pageHead","editInput","load","completed_and_displayed","formType_filter","formTypes","title_words","time_frame","filtered_results","filter_description","docObj","recentlyExpandedForm","setFilter","documentStatusOptions","filterTimeFrames","formRowRef","printAll","document_list","print","onafterprint","er","getName","sortByLastName","okToShowPerson","person_index","docList","okToShowDoc","docDate","fromDate","toDate","getDocRec","docFile","formResult","active","viewInactive","isExpanded","sequence","setFormList","docResult","loadTrigger","this_docXRef","this_docRec","insert_before","myPersonObj_index","this_personObj","attemptedDate","recToPush","put_before","setDocObj","formNdx","okToShowForm","uploadDoc","pendingInstructions","formName","addDocForm","printEmptyForm","personNdx","selectedPerson_index","parentFormType","amedment_form_id","editDoc","doc_index","amendment_number","selectValue","buttonPressed","wordList","status_response","status_key","status_descripition","valid_for","selectedName","completedDocRec","save_info","docXRefRec","TextureIcon","selectedGroups","deleteKeyPending","eventStartDisplayDate","StartAsADateObj","EndAsADateObj","marqueeData","futureOK","resolveFromDate","eventEndDisplayDate","resolveToDate","message_key","deleteTextPending","italics","putMarquee","messageKey","stopMessage","setCancelPending","setConfirmStatus","setConfirmPrompt","confirmDelete","setConfirmDelete","morePeople","setMorePeople","defaultPerson","defaultQualSelections","defaultRequestType","titleName","columnList","allowAttachments","records2Update","setRecords2Update","allowAddPeople","setAllowAddPeople","allowRemovePeople","setAllowRemovePeople","setSelectedColumn","extractRequestType","activityParts","activityCode","activityClient","columnUniqueName","my_column","commonRows","dName","dN","dX","array","dKey","selectList","addPeople","buildDefaults","paymentInfo","collectPayment","allow","defaultColumnList","localData_maxDName","activities","defaultsToUse","this_activityKey","this_requestType","this_requestName","this_foreignKey","requestName","column_id","defaultColumns","maxDName","addColumns","columnNumber","rowNumber","vText","handleTextAll","_state$session3$group","_state$accessList","_state$accessList$sta","prohibitedGroups","obo_prohibited","_state$session2$group","guestAssignment","guest","guestGroups","winner_at","typed_in_words","hits","hitCount","winner","winnerList","accessList_person","wordsMatched","total_matches","name_word","typed_in_word","_hits$winner_at$name","_hits$winner_at$name2","newDName","maxHits","maxHitCount","_hits$winner_at$name3","_hits$winner_at$name4","dText","_hits$x$name","_hits$x$name2","targetColumns","_hits$winner_at$name5","_hits$winner_at$name6","resetTitleName","checkRow","handleOBOText","handleChangeTextField","columnActivated","workingTitle","nameWords","this_lastName","this_firstName","isQualChecked","rowData","pOption","pSelection","optSelected","qOpt","qChoice","qValueText","qualRules","optionsSelected","numberOfSelections","this_id","this_name","myDefaultColumns","column","dRow","nameElements","suppressDuplicateCheck","existingRequest","checkExistingRequests","importTypes","requestor_name","applyExistingRequest","commonText","columnCommonName","this_column_index","request_to_update","requestToUse","current_request","sX","_existingRequest$requ","_existingRequest$requ2","_existingRequest$requ3","_existingRequest$requ4","_existingRequest$requ5","_existingRequest$requ6","_existingRequest$requ7","_existingRequest$requ8","image_location","request_key","useExisting","requestAction","_state$session$servic","snackAction","phrase","fKdate","rValue","orderWarning","lastRec","thisTest","innerResponse","checkField","checkValue","qualSelected","this_row","itemSelected","s64","b64","fromDataURL","allPossibilitiesObj","selectedOBOkey","allQualsList","qualPicked","sIDs","lockSend","_fact$messaging","_fact$messaging$forma","everyoneText","message_body","writtenRecords","choices_list","s3Response","pushText","svc_messaging","new_messaging","_fact$value$freeText","_fact$value2","_fact$value2$freeText","_fact$value3","_fact$value3$freeText","formatCallObj","factMessagingList","plain","attachment","_message_body$messagi","_message_body$messagi2","sendRequests","warningsExist","dataExists","warningSection","column_number","selectionText","columnName","row_number","this_qual","qualCount","warningMessage","expanded","maxMatch","accessRec","this_hit","_this_hit$accessRec$n","_this_hit$accessRec$n2","select_name","checkForDuplicates","Card","InputProps","CheckBoxIcon","CheckBoxOutlineBlankIcon","_reactData$currentSta","_reactData$currentSta2","kiosk_mode","validated_user","residentName","residentLocation","guest_mode","guest_vendor","resident_mode","add_guest_mode","adminOverride","adminIndex","outList","adminView","validateUser","IDString","nonRes","error_field","personRecs","ID_words","phone_key","candidates","getCurrentStatus","reqArray","reqRec","putCheckout","visiting","visitor_name","Action","last10checkout","checkout_recent_history","marquee_message","staff_mode","determineMode","other_mode","makeGreeting","custom_greeting","checkin_image","select_user","cIndex","paddingY","currentStatus","add_try_number","enteredID","guestList","vendorList","checkedOutList","checkedInGuests","checkedInVendors","outSorter","guestSorter","vendorSorter","getCheckedOut","resident_checkout_prompts","hNote","responses","hWho","residentRec","guestName","vendorCompany","contactNumber","gLast","gFirst","gNames","dLast","dFirst","dNames","gPhone","addedPerson","newPersonRec","availableID","lookupID","addVendor","addGuest","vendor_mode","outRow","outNdx","inRow","inNdx","vendor_company","printRawData","_this_item$current_re","_this_item$original_r","_this_item$current_re2","workData","formatted_type","_this_item$original_r2","requestor_location","updated","enteredBy","enteredBy_name","display_date","summary_request","notes_section","formatted_request","messageRecs","pdfBlob","savePDFBlob","_body$print","_body$print$data","_body$print2","_body$print2$data","_body$print3","_body$print3$data","autoPrint","remembered_indent","imageSize","listItemLeft","listItemNarrow","clientPopUpWithPadding","standardIndent","standard","_pOccData$owner","pEventCode","pEvent","pPatient","pSignUps","pViewOnly","pOccData","pMode","eventSlotList","setEventSlotList","selectNewSlotOwner","setSelectNewSlotOwner","editSlot","setEditSlot","editNoteNumber","setEditNoteNumber","newNote","setNewNote","isEventOwner","isWaitListed","waitList","ownerOfSlots","setOwnerOfSlots","firstAvailableSlot","setFirstAvailableSlot","messageType","messageRecipientIDs","messageRecipientNames","editEventInfo","editInfoErrorList","editOwnerInfo","editIndex","signUpObject","attachedSR","selectAssignTo","numberOfOwnedSlots","wait_list","editWaitList","isOwned","isSlotOwner","setChoices","noCurrent","memberInfo","pLL","slotOwnerList","conflictInfo","timeText","getDoc","handlePrint","previousXPos","eoData","font_family","totalLines","detail_indent","slotList","outName","occupiedSlot","oParts","formatTime","nameY","noBreak","mVal","outVal","event_info","returnPromise","pHHMM","textIn","textArray","String","rememberedYPos","needPageBreak","yOffset","pageNumberLine","t2Words","printOccurrenceSheet","handleUpdateWaitList","handleAllocateSlot","pRelease","release","workingList","whereToGo","newPersonName","newPersonID","newPersonLocation","message_override","overrideList","published","updatedSlotData","foundIndex","handleCancelEvent","goodUpdate","_this_item$slotData","_this_item$slotData$s","_this_item$slotData$s2","selected","firstAvailableChoice","checkOwnership","getEventSlots","attachedRequest","assigned_to_name","buildIt","PersonAddIcon","allowAssign","StorageOutlined","filteredList","_this_item$slotData2","getMarker","currentHistory","check_in","TimerOffIcon","RadioButtonCheckedIcon","AlarmAddIcon","notes_required","SaveIcon","updatedIndex","pNote","slotUpdate","handleChangeNotes","AssignmentTurnedInIcon","docRecs","dR","selectForm","selectedDoc_id","selectedDocMode","prohibit_removeSelf","PersonAddDisabledIcon","RestoreIcon","editTimeEntries","appointmentDateTimeStamp","pr","selectedForm","availability_list","already_booked","calRecs","check_client","check_person_id","personID","check_date","_this_calRec$slotData","_this_calRec$slotData2","this_calRec","_eventRec$eventData","_eventRec$eventData$e","_eventRec$eventData$e2","_eventRec$eventData2","_eventRec$eventData2$","_eventRec$eventData2$2","myAvailability","newSlotStart24","newSlotEnd24","messageSubject","updatedDate","updatedValues","reactUpdates","OGDate","newDate","newTime","previousEntry","dNumeric$","needsSlotUpdates","needsSlotTimeMessage","timeStart","timeEnd","delimiters","newFrom","newTo","tempEnd","tempMM","trunc","time24","qS","handleUpdateEvent","errors","foundTimes","getHistoryTimes","newIn","newOut","errorFree","this_userName","eventKey","newOwners","handleUpdateOwner","selectedPeople","this_eventID","other_occurrences","ask_cancelSeries","checkOtherOccurrences","event_cancelled","next_event","summaryInfo","totalSlots","ownedSlots","markedSlots","listComplete","wl_entry","addedIndexAt","last_selected","priority_list","last_selected_person","screen_mode","selected_person","selection_list","inList","finalList","existingIDs","a_row","inactiveGroupList","_this_row","_this_row2","buildSelectionList","last_visited_name","type_date","mrowhead","mrowdetail","mrowqual","_reactData$filter","_reactData$filter2","firstSelectedRowRef","unmount","setUnmount","filterIn","filtering","statusNot","showNotBox","rebuilding","selectedPersonName","displayVersion","OGFilter","pageTitle","requestIDs","showDashboard","showSummary","selectionsChanged","showUpdateForm","showEventEdit","detailEdit","showStaffAccess","checkInStatusObj","rowOpen","display_summary","display_summaryList","filterText","TELS_isUpdating","dashboard_idleTimer","createRef","msBeforeSleeping","idle_delay","allRowsSelected","selectedCount","filtered","OKToDisplay","allChecked","statusWords","delivery","handleUpdates","pOptions","historyLine","messageStatusText","assignedToName","history_update","myNote","updateRows","rowChanged","rowSelected","statusChanged","assignmentChanged","enteredNote","OGHistoryLine","woNumber","update_date","newFormattedRequest","buildRequestDetails","notify","messageAuthor","notifyMessage","handlePrintRequest","printList","serviceRequestRecsIn","remembered_customizationsRec","requestsIn","remembered_activityRec","alternate_messaging","printServiceRequest","prepareSummary","last_fKey","countThisLine","menuType","keepGoing","getRequestors","anyRowsSelected","checklistSelected","selectedRow","checklistRow","OK","flavor","rowIndex","firstSelectedRow","pI","mRow","workingKey","mX","nameOut","postedWord","prepareMessageHistory","buildDashboard","setStatusList","qList","maxTimeStamp","lastTimeStamp","eList","buildRequestFromEvent","sort_factor","this_sort","orderForDate","timeStamp","sortDataRows","msInADay","open_closed","total_open_time","total_idle_time","oldest_requests","row_status","age","MAX_SAFE_INTEGER","average_open_time","average_time_since_last_activity","value_word","this_status","setColor","statistics","rangeObj","low","med","high","ok","bad","allowTELS","TELSfacilityID","requestTimeStamp","AVAupdateDate","AVArequestDate","requestorRec","requestor_image","textBased_request","requestTime","textForm","selectOnly","aName","shortForm","fReq","fSearch","fText","formatRequest","historyList","noteList","updateHistoryList","hLine","nLine","mHist","_this_event$slotData2","foundStatus","_this_event$slotData","_this_event$slotData$","_this_event$slotData3","_this_event$slotData4","_this_event$slotData5","_this_event$slotData6","returnText","returnSearch","textLink","dLine","opts","rTextList","qx","kLow","responseObj","IdleTimer","onActive","lastIdle","lastActive","newRecordsFound","playAlert","newKey","request_timestamp","newRow","extendDashboard","startOnMount","debounce","SearchIcon","handleChangeFilter","SwapVertIcon","this_status_index","statusIn","statusWord","handleChangeStatusSelection","_this_item$workData","_this_item$workData2","_this_item$workData3","_this_item$workData4","_this_item$workData5","noSelect","showForeignKey","mSumLine","mSumIndex","tX","OKToDisplayStatus","toFixed","qText","qX","selectedIDs","commonKey","commonFKey","StaffAccess","listOfPeopleToVisit","allowDashboard","ListIcon","DashboardIcon","ClearAllIcon","DoneAllIcon","allowSummary","allRows","ListAltIcon","requestor_id","getSelectedDetails","checklist_info","cEntries","sendList","woNum","summaryDescription","this_filteredLine","TELS_facility","newTELSrequest","newWOassigned","entityIdentifier","handleCreateTELS","SaveAltIcon","CalendarEventEditForm","report_id","safeMode","lambda_parms","oNdx","goodSubmit","rowButtonDefault","rowButtonBlue","setAllRows","moreRows","setMoreRows","request_filter","setRequestFilter","request_filter_lower","setRequestFilterLower","showReactError","promptForUpdate","setPromptForUpdate","setProgress","setPWidth","requestNames","maint","meal","guest_room","trans","breakfast","createMessageText","mData","pM","mL","handleChangeRequestFilter","promiseArr","stopAt","buildCalendarDetails","all","thisEntry","list_type","slot_number","thisPerson","last_note","requestUpdates","printCalendar","myCalendar","currentEvent","entry","bodyFirst","calFirst","calendarGrid","headRow","colSpan","styles","halign","valign","weekNumber","sunday","this_week","dayOfMonth","eventList","showTime","columnStyles","cellWidth","autoTable","head","startY","headStyles","minCellHeight","bodyStyles","htmlToFormattedText","onlyRegistered","avatar","tooltipBody","arrowBody","pxToRem","dateCell","transform","subDescriptionText2","relaxedView","client_background","calendar_background","client_backgroundCenter","button_area","calendarPeople","selectedDate","assignmentView","slotsView","template__List","todayYMD","clicked_on_date","agendaView","weekView","setInitialView","factor7","colorScheme","unavailable","owned","full","waitlist","waitlisted","calendar_fill","calendar_fill_text","executePublish","publishData","ava_env","startDateObj","endDateObj","dates","people_count","already_published","event_list","eventsFound","willPublish","alreadyPublished","failedFilter","proceedWithoutWarning","eX","event_message","event_count","eLL","filters","ownerFilter","eventFilter","publishCalendar","ignoreFilters","idFilter","eventIDFilter","setPublishDates","handlePublishOptions","pDx","pEx","dateRangeMessage","previouslyPublishedMessage","skippedMessage","eventsToShow","isUnAvailable","showSlots","check_person","_this_event$customiza","show_as_unavailable","handleDragStart","ev","dataTransfer","setData","dropTarget","handleDragOver","isTemplate","getTemplate","template_id","this_template","handleDrop","dropType","dragged_id","getData","eventSignup","droppedOn_event","addTemplateEvent","selectedTemplate","appointmentStart","appointmentEnd","appointmentDate","getAppointmentType","templateRec","eventIndex","dateIndex","_droppedOn_event$time","_droppedOn_event$time2","conflictingEvent","isAvailable","this_time","eventObj","proceedWithSignUp","handleConflictOptions","slotAssigned","slotUpdates","checkConflict","conflictProceed","slotToUse","occInfo","date_index","event_index","isDense","setTextColor","allSlotsFull","allSlotsEmpty","numberToCheck","keyColor","scheme","waitListExists","setAvailabilityColor","template","r256","r_hex","g256","g_hex","b256","b_hex","make_rgba","setBackgroundColor","this_background","makeCalendarTime","ord","subtitle","selectPerson","rememberedDenseData","DateRangeIcon","CalendarViewDayIcon","FormatLineSpacingIcon","FormatAlignJustifyIcon","GroupIcon","FilterListIcon","setDates","groupFilter","no_dragTemplate","draggable","onDragStart","EventIcon","generic_description","noWrap","assignment__List","this_list","assignmentList","this_candidate","_reactData$conflictIn","_reactData$conflictIn2","_reactData$conflictIn3","tooltip","arrow","enterDelay","conflict_date","cDateX","this_conflict","cN","placement","boxShadow","assignmentDisplayBy","visible_y","onDragOver","onDrop","dayOfWeek_word","idToFind","getPersonName","newStart","newStartDate","newEndDate","addPersonalEvent","owner_only","updatedData","calRef","NewCalendarEvent","newEvent","newOccDate","newEntry","myChoice","ArrowBackIcon","AddEventIcon","endIcon","ArrowForwardIcon","OGpatient","defaultObject","eventClient","calendarMode","showPersonSelect","setShowPersonSelect","setShowAll","load_myCal","selectedEvent","setStatusMessage","onStatusUpdate","progressWidth","progressPct","setCalendar","theCalendar","checkClient","adopted_client","tCal","reminder_minutes","choosePerson","organizeCalendar","this_calendar","calendarList","sorted_eventIDs","s1","s2","calendarEntry","forceReload","filterGroup","this_year","next_year","bDay","assignmentRows","sortedList","assignmentSortBy","templateList","workingTemplateList","allTemplates","templateData","availableTo_groups","calendar_day","justifySelf","CalendarForm","newDefaultValues","pPatientRec","listBox","showUpload","changeDetected","setChangeDetected","setEventDate","eventAsADate","setEventAsADate","sundayAsADate","setSundayAsADate","randomize","setRandomize","myRandomInts","quantity","candidateInt","days","rDate","makeYMD","workDate","getObservationRecs","pNumberDays","jump","numberDays","obsRecs","targetDateArray","sundayValue","sundayTarget","fromDoW","toDoW","incr","date_keys","newObservationList","date_key","observation","showDialog","handleCancel","observationType","setObservationType","observationCode","setObservationCode","setObservationKey","entryTypes","setEntryTypes","observationClient","observationDate","oD","observationLongDate","eTypeList","getEntryTypes","select","eType","listRow","detailRow","detailRowSpaceAbove","bulkItemList","setBulkItemList","setEditMode","selectedObservation","setSelectedObservation","updateIndex","setUpdateIndex","cols","handleEditObservation","workingArray","removedItem","handleDeleteItem","EditObservation","updatedRow","XLSX","handleSpreadsheet","pXFile","XMLHttpRequest","responseType","Uint8Array","resultObj","split_value","hKey","useKey","sKey","suffix","lower_date","upper_date","parseTemplateMenu","read","fObj","ShowBulkList","typeOfLine","recipeCode","observationLine","observationList","handleLoad","displayed_ObservationName","addMode","savedRequestUpdates","observationItemMode","oIValues","oIImage","oIKey","ogSelectedObservation","newObservationName","loadMode","recipeList","oiCharacteristics","observation_item_characteristics","GridListTile","unsortedRecipeList","obsWords","filteredRecipeList","pObs_name","this_dataKey","rightSide","handleAddObservation","AddIcon","observation_type","menu_types","now$","oIogName","OIKey","OIInfo","OIObj","oIName","loadOIValues","original_data","update_data","oldRightSide","newCompositeKey","handleUpdateObservation","newOCode","newDataList","oIRec","checkN","handleAddOItem","newOItemData","LoadMenuSpreadsheet","handleDeleteObservation","showMenu","setObservationList","setSelectedDate","setLoadMode","copyMode","setCopyMode","buildObservationList","obsList","tNext","dayWord","MenuForm","handleCopy","FileCopyIcon","CopyMenu","setActivityName","eventActivityList","selectedEventActivity","setSelectedEventActivity","deleteItem","setDeleteItem","deleteIndex","setDeleteIndex","Grid","GridList","cellHeight","handleEditEventActivity","EditActivity","client_event_id","handleDeleteEventActivity","activityList","activityObject","pEvent_id","setEventActivityList","showEventSelect","setShowEventSelect","entireActivityList","setEntireActivityList","menuName","setMenuName","entireActivityObject","setEntireActivityObject","getEventActivitiesList","getEventActivities","aList","getActivityMenus","buildDetailedMenuList","EventActivityForm","ActivityFilter","selectedActivity","listForEdit","pMenu","aRec","aCode","aEvent","getEventListFromMenu","showSheet","defaultUser","sheetData","jobTime","workbook","request_data","key_data","description_data","foundHeader","sdL","activeRow","sheetColumn","guessedAuthor","guessedOBO","reqRecs","rL","findLocal","thisWord","possibles","guessedRecs","openRecs","descriptive_words","request_words","updateTime","closeTime","statusFrom","prevText","fKey","processXLSData","fileList","runType","filesProcessed","setFilesProcessed","excludeThisPerson","this_filter","property","val","if_exists","key_column","headerRow","keyWord","hasHeaderRow","spreadsheet","nameList","toSpliced","rightName","pList","pCount","localFileName","summaryList","sheetObj","testList","substituteNames","recipientNameList","callList","noCallList","colWidth","AVA_ID","Name","Status","fakeNumber","avaID","tID","voiceMailMessage","emptyRow","newWorksheet","utils","json_to_sheet","wch","newWorkbook","book_new","book_append_sheet","bufferInfo","write","bookType","s3Upload","handleFiles","startExecution","stateMachineArn","fileLocation","localName","giveSpace","giveMoreSpace","giveSpaceBoth","adHead","adName","superSizeLast","superSizeFirst","upSizeLast","upSizeLocation","upSizePreferenceBox","superSizePreferenceLine1","superSizePreferenceLine2","superSizePreferenceLine3","superSizeArea","_state$accessList$sta5","_state$accessList$sta6","pPatientName","pGroupRec","pGroupName","pStyle","pRole","showEditPerson","setShowEditPerson","editPersonRec","setEditPersonRec","workingMemberList","setGroupMemberList","confirmPerson","setConfirmPerson","showSuperSize","setshowSuperSize","showAccountHistory","setShowAccountHistory","promptForName","setPromptForName","superSizeData","setSuperSizeData","singlePersonMode","setsinglePersonMode","setMessageType","singlePerson","public_groups","private_groups","overrideRole","setOverrideRole","writtenRows","multiGroups","prefLineText","prefLine","private","handleAddPersonToGroup","handleRemoveGroupMember","removeMember","tempMemberList","nameXRef","makeContactLines","pMessaging","pPreference","respIn","respFiltered","makeResponsibleLines","locLine","locIndex","prefIndex","_state$session$direct","directory_format","paperSize","handlePrintDirectory","handlePrintRoster","_state$accessList$sta2","found_level","_state$accessList$sta3","_state$accessList$sta4","messageAll","newGroupName","newMemberList","pG","inData","formatLocalData","addAdministrator","AddCircleOutlineIcon","removeAdministrator","RemoveCircleOutlineIcon","RequestDashboard","updateMode","greenButton","listItemAVALight","listItemAVABold","rightEdgeSmall","onRefresh","requestNewGroup","setRequestNewGroup","newGroupAdministrator","groupRole","droppedOn","draggedFrom","_groupsManagedObject$","levelZero","targetGroup_formerFamilyTree","myParent","targetGroup_newFamilyTree","former_parent","new_parent","intent","personGroup","personObj","addGroupList","addedGroups","newClientGroupsObj","AVAclassesperson_id","removeChildren","this_child","checkEmptyParent","this_parent","gX","_draggedFrom$personOb","removedGroups","alertMessage","handleDrop_removeGroup","_draggedFrom$personOb2","targetGroup_parent","handleDrop_removePerson","onAbort","pGroup_name","pGroupArray","tClient","tGroup","_state$accessList$thi","thisList","_state$accessList2","_state$accessList2$th","newPeople","reactUpdater","foundGroup","my_role","mbrList","GroupForm","soughtGroup","gMObj","selectedIndex","groupManagement","GroupFilter","selectedGroup","newGroupObj","GroupControl","setMode","respID","respName","InputLabelProps","shrink","labelOne","labelTwo","errorOne","setErrorOne","errorTwo","setErrorTwo","xs","_currentValues$custom","_currentValues$custom2","_currentValues$custom3","_currentValues$custom4","_currentValues$custom5","_currentValues$custom6","_currentValues$custom7","_currentValues$custom9","_currentValues$custom10","_currentValues$custom11","localColor","customizationRecs","getBackgroundImage","getLogo","ui_tiles","useOldVersion","_currentValues$custom8","saveNewTitle","rowObj","bBoardList","generic_activities_list","group_list_index","changesMade","setBBoard","section_sort","activity_line","aList_index","sectionKeys","spec","split_type","split_spec","receipientObj","this_part","aObj","getMessageInfo","needsHeader","MessagingInitialized","groupNdx","selectedSection","LinkIcon","new","aData","aNdx","draggedFromIndex","droppedOnIndex","entryToAdd","CancelIcon","spliceAt","bbResponse","first_entry","updatedLine","addLink","nws_info","_nws_info$properties$","_nws_info$properties$2","_nws_info$properties$3","_nws_info$properties$4","gridId","gridX","gridY","relativeLocation","_nws_info$properties$5","_nws_info$properties$6","_nws_info$properties$7","_nws_info$properties$8","_nws_info$properties$9","_nws_info$properties$10","_nws_info$properties$11","_nws_info$properties$12","_nws_info$properties$13","_nws_info$properties$14","_nws_info$properties$15","_nws_info$properties$16","nws_place","withPeopleList","when_notUrgent","showRuleGroupsQuickSearch","ruleIndex","showRulesQuickSearch","selectedOption","selectedRulesPeople","addAttachment","ClientProfileSection","ClientWeatherSection","WeatherSection","ClientMessagingSection","GlobalMessagePreferencesSection","this_cRec","_this_cRec$customizat","_this_cRec$customizat2","_reactData$current$cu","_reactData$current$cu2","_reactData$current$cu3","check_rule","filterComplete","filterNotStarted","filterInProcess","default_filters","isEditing","masterPeopleList","handleChangeActivityFilter","selectedValue","filterPending","display_data","_reactData$masterPeop","_reactData$masterPeop2","_reactData$masterPeop3","_reactData$masterPeop4","_reactData$masterPeop5","_reactData$masterPeop6","_reactData$masterPeop7","_reactData$masterPeop8","personForms","person_first","person_last","buildMasters","formPeople","allForms","allGroups","sortedForms","selectedForm_id","VisibilityIcon","selectedFormRec","selectedFormMembers","calledFrom","_reactData$masterPeop11","_reactData$masterPeop12","_reactData$masterPeop13","_reactData$masterPeop14","_reactData$masterPeop9","_reactData$masterPeop10","_reactData$masterForm4","_reactData$masterForm5","_reactData$masterForm6","_reactData$masterForm7","_reactData$masterForm8","_reactData$masterForm9","_reactData$masterPeop17","_reactData$masterPeop18","_reactData$masterPeop19","_reactData$masterPeop20","_reactData$masterPeop15","_reactData$masterPeop16","_reactData$masterForm10","_reactData$masterForm11","_reactData$masterForm12","_reactData$masterForm13","_reactData$masterForm14","_reactData$masterForm15","_reactData$masterForm16","_reactData$masterForm17","_reactData$masterForm18","carousel_status","saveState","current_index","innerHeight","visible_x","gallery","renderVideoUrl","video","controls","original","imageList","AVAdata","slide_type","video_url","slideShow","originalHeight","originalWidth","thumbnail","thumbnailHeight","thumbnailWidth","AVA","renderItem","bind","ImageGallery","items","showThumbnails","slideInterval","showNav","showFullscreenButton","autoPlay","startIndex","currentIndex","selected_image","ShowCalendar","AVAIcon","customObj","activityObj","masterClient","subMenuData","forceRefresh","numberOfRows","sectionDetails","activityHistory","makeVersion","inStr","vYr","vMo","vDay","sectionCheck","alreadyInSection","pSec","pActIn","pAct","ava_version_number","todays_numeric_date","handleSubMenu","buildMainMenu","pSubMenu","pActivities","pOverrides","sectionColor","sectionIcon","menu_name","subActivities","getSubMenu","aL","subClient","subKey","addRow","parent_name","sectionSort","sectionName","duplicateCheck","menuStructure","currentSection","logo_Rec","this_activity","section","neededGroups","getGroupsPersonBelongsTo","allowDuplicates","auth","user_group","overrideColor","overrideIcon","oGroup","oGroupRec","oColor","oIcon","subName","subOverrides","currentMenu","subMenuObj","section_color","raw_data","section_icon","row_color","row_type","parent_menu","child_menu","last_used","is_favorite","subMenu_data","nextA","subLines","prohibited","sData","customColor","customIcon","saveMenu","pActivity","pParent","pParentName","pSectionSort","pSectionName","pSectionColor","pSectionIcon","pReason","aClient","aType","pSort","favorite","returnRowObject","preLoad","pActivityCode","aResolved","getActivityFromObject","overrideDefault","overrideTitle","addClient","iType","iData","checkVer","aRecs","pActivityObj","a4","neededGroupArray","batchGetRequest","Keys","Set","Groups","batchGet","Responses","pendingBar","logoSmall","popUpMenuButton","hello","sectionHeader","logoDisplay","boldCenter","setSelected","removeCookie","useCookies","mainMenu","setMainMenu","setGreetingName","greetingWords","setGreetingWords","pendingFact","setPendingFact","setCurrentMenu","menuArray","setMenuArray","menuNames","setMenuNames","sectionOpen","setSectionOpen","setShowStaffAccess","showProfileEdit","setShowProfileEdit","showAddAccount","setShowAddAccount","showNewFactDialog","setShowNewFactDialog","needsConfirmation","setNeedsConfirmation","toggleClick","setToggleClick","setGroupData","menu_reloaded","loadedMenuVersion","avatarStyle","checkReload","menuRec","menu_version","AVA_main_menu","getLastActiveTime","updateAVA","pOpen","screenQuiet","interimMenu","updateFavorites","activityRowIndex","activityRow","activityLine","changeMade","favoriteList","favoriteBlocked","activity_class","onSaveFact","pFact","pFactName","putFact","factFlavor","foundText","constructedQualifier","qArray","subkey","factValueType","cMessage","mediaData","_pFact$value","_pFact$value$freeText","_pFact$value$mediaDat","_pFact$value$mediaDat2","_pFact$value$mediaDat3","Title","fileExtension","pMediaData","buff","buffer","uploadId","fileSize","forceSingle","arrayBuffer","Float32Array","numberOfParts","uploadOK","putObject","upParms","Metadata","MetaData","createMultipartUpload","UploadId","uploadPromises","uPartParm","subarray","PartNumber","uploadPart","uploadResults","upDone","MultipartUpload","Parts","ETag","completeMultipartUpload","s3Bad","abortMultipartUpload","putS3Object","tag","reload","beQuiet","AVA_section_open","wholeMenu","MakeAVAMenu","helpRow","buildMenu","newFact","flexShrink","SubscriptionIcon","createAccountAuthority","pUser","pPwd","pMessage","accessLog","Auth","signOut","ExitToAppIcon","NewReleasesOutlinedIcon","_sessionObject$cognit","_sessionObject$cognit2","_sessionObject$cognit3","sTime","cognitoSession","accessToken","exp","makeExpiration","AVACarousel","_this_row$default_val","AVA_version","activityLog","subMenu","gad_response","NotFavorite","FavoriteIcon","SwitchPatientDialog","PatientDialog","NewFactDialog","fromHome","oopsieMessage","url_parameters","pResult","onNext","onSelected","innerBox","local_service_details","parm_keyDate","dateKey","selectedMealType","selectedDateKey","selectedMenu","selectedArea","service_details","menuTypeList","newAttachmentList","this_observationCode","this_itemDescription","new_MoreInfo","OIwritten","this_observation","filterRecipeList","menu_category","this_recipe","menus","dining_area","dining_structure","display_value_day","handleNewObservation","meal_type","useDate","menu_date","room","selected_okey","new_okey","dataList","check_key","return_type","categories","areaType_key","aTNdx","menuType_key","menuNDX","menuDate_key","menu_type","mtNDX","catNdx","onCreateNew","displayed_category","menu","_state$groups","_state$groups$belongs","_state$groups2","_state$groups2$belong","qROpt","qROx","alwaysList","setAlwaysList","setRecipeList","displayedDate","setDisplayedDate","buildAlways","todayList","oldObservations","unsortedObservations","seenLabel","seenValue","seenType","buildRecipeList","concatList","handleChangeDate","dateValue","PlaylistAddCheckIcon","link_title","link_address","_activity_line$defaul","getBulletinBoard","disableUnderline","setNewFact","qualifierTable","nums","setNums","mOut","setMOut","formState","setFormState","OGmessage","setOGmessage","OGvalue","setOGvalue","setFreeText","onChangeQualText","onChangeValue","onChangeNums","newNums","NumberForm","FreeTextForm","oName","defaultValueObj","ClientMaintenance","FormManagement","VideoRecorder","isOnInitially","showReplayControls","replayVideoAutoplayAndLoopOff","onRecordingComplete","pVideo","videoBlob","recordingStatus","onStartRecording","ReactPlayer","playing","_err$target","_err$target$error","eValue","_err$target2","_err$target2$error","_err$target3","_err$target3$error","_err$target4","_err$target4$error","allowDownload","Number2Form","MessageFormLegacy","MessageMonitor","BulletinBoard","ReportRequest","FileUpload","ObservationForm","requestNumber","oSelected","fQualifiers","AVASubscription","MultiObservationFormC","MultiObservationFormD","CheckInCheckOut","_newFact$value","_newFact$value$freeTe","_newFact$value2","_newFact$value2$freeT","CalendarDashboard","dV","dVKey","dVValue","MarqueeMaintenance","OGsession","ShowMenu","ShowMenuB","LoadNamesFromFile","FamilyMaintenance","FormFill","DocumentDashboardB","LoadWorkOrderSpreadsheet","ShowEventActivity","ShowGroup","AVAInHome","appBar","descriptionText","warningText","fontColor","searchLine","searchBox","_fact","setMessage","factImageClass","setFactImageClass","factIOClass","setFactIOClass","factEventClass","setFactEventClass","factMessageClass","setFactMessageClass","executionDefaultValue","setExecutionDefaultValue","setQualifierTable","associationsTable","setAssociationsTable","withNext","oopsie","handleExit","badData","xVal","numeric_minimum","numeric_maximum","fVal","numerica_minimum","goodMessage","eString","factCode","lQ","fact_history","observation_status","mF","vL","nF","associations","nfValue","qStr","qArr","DynamicForm","handleNext","handleSkip","current_time","showPasswordEdit","marqueeVersion","pause","_state$profile","tempName","client_timezone","cognito_expires","pRow","background_color","Marquee","marqueeLine","marqueeIndex","nextActivityRec","nextActivityList","nextActivity","gotRec","onNextFact","cardcontent","cardcontentdetail","media","draggedAt","from_type","to_type","droppedAt","wholeRow","borderStyle","CardActionArea","CardMedia","CardContent","lower_index","cookies","serviceWorker","registration","AVAaction","docUser","ConnectMenu","AVAMenu","gridList","mainPaper","inputRoot","inputInput","transitions","up","activityText","raised","client_icon","unregister","gutterBottom","homePath","Route","exact","Redirect","screen","NotFound","listRowIndent","listRowBottom","moduleState","clientObj","choosePeople","peopleRecs","chooseClient","this_client_id","useIosCheck","nav","useMemo","standalone","platform","maxTouchPoints","MSStream","CognitoClient","DarkModeContext","AssignmentIcon","TheseusScreen","Reloader","ThankYouScreen","hasError","ErrorBoundary","super","componentDidCatch","render","this","hocFactory","hocs","rtl","reduceRight","DerivedComponent","withHOC","App","RootNavigation","RecoilRoot","BrowserRouter","DarkModeProvider","useDarkMode","unstable_createMuiStrictModeTheme","light","main","dark","secondary","prefersDarkMode","localTheme","ThemeProvider","CssBaseline","notistackRef","onCLickDismiss","SnackbarProvider","maxSnack","SessionProvider","setCookie","doneTrying","setDoneTrying","AVAReady","setAVAReady","localAVAReady","AVAFollowUpData","setAVAFollowUpData","currentClientLogo","customizationData","urlData","multipleAccountList","bootState","allParams","useLocation","URLSearchParams","useParams","tryUser","pSource","_reactData$customizat","_reactData$customizat2","goodSessionV2","foundSession","dbError","getSessionV2","waiveTFA","logAccessAttempt","accountFound","getByAlternateID","tempURLOBj","getParamsFromURL","tfa","goodUser","foundPatient","tempPass","expectedAddress","eMessage","goodLogin","cognitoLogin","launchAVA","genericLogin","activeUser","localCognitoSession","_localCognitoSession$","_localCognitoSession$2","refresh_token","cognitoPoolUser","currentUserPoolUser","adminInitiateAuth","pool","userPoolId","refreshSession","getRefreshToken","uMessage","idToken","jti","AVAsession","session_key","getSessions","login","cData","cookieValues","AVAuser","getClientCookie","cClient","getCookie","checkUser","testModeErrorTrap","_reactData$customizat3","_reactData$customizat4","_reactData$customizat5","_reactData$customizat6","NeedUser","enteredUserID","enteredPass","whichButton","lKP","possibleUserRecs","hint","padEnd","forgotPassword","thatWorked","userFrom","possibility","passwordRequired","proposedPassword","confirmSetPassword","this_user","SelectAccount","pPass","signIn","username","clientMetadata","avaAccount","caseCorrectedPassword","c0","validationData","e2","putActionCookie","urlObj","AVAclient","pSender","pRecipient","pSessionID","goodIO","eMessageText","logoRec","pPersonID","altIDs","pAttempted","pOK","timestring","user_key","attempted_user","attempted_password","pLaunchUser","goodSession","currentPatient","client_list","customizationsRec","_currentSession","_currentSession$group","this_month","group_structure","groupObject","adminArray","admin","staff","sessionInfo","maxAge","pProfile","pLogin","pURL","pSessionInfo","attributeValues","workSession","this_patient","groupsObj","membersObj","aPromise","rightNow","dPromise","thisDate","calendarRecs","screenDate","found_events","cancelled_occurrences","occurrenceRec","responseCal","responseEventRec","responseRec","eID","eDate","_found_events$occurre","_found_events$occurre2","_found_events$occurre3","_found_events$occurre4","allowed_event","_found_events$this_ev","getAllOccurrences","occList","sampleList","allSettled","loadSyncInfo","Amplify","configure","ReactDOM","getElementById","module","exports"],"mappings":"8PAOeA,MALKC,YAAK,CACvBC,IAAK,cACLC,QAAS,OCkBIC,MAlBFC,IAAmB,IAAlB,SAAEC,GAAUD,EACxB,MAAME,EAAYC,YAAkBR,GAC9BS,EAAeC,IAAMC,YAAYJ,EAAW,CAACA,IAanD,OAXAG,IAAME,UAAU,KACd,MAAMC,EAA8BC,IAClCA,EAAMC,iBACNN,EAAaK,IAGf,OADAE,OAAOC,iBAAiB,sBAAuBJ,GACxC,KACLG,OAAOE,oBAAoB,sBAAuBL,KAEnD,CAACJ,IAEGC,IAAAS,cAAAT,IAAAU,SAAA,KAAGd,ICVGe,MANEC,GAAaC,GAC5Bb,IAAAS,cAACf,EAAI,KACHM,IAAAS,cAACG,EAAcC,ICHJ,OAACC,EAAOC,KACrB,MAAM,KAAEC,EAAI,QAAEC,GAAYF,EAC1B,OAAQC,GACN,ICLuB,cDMrB,MAAO,IAAKF,EAAOI,QAASD,GAC9B,ICNwB,eDOtB,MAAO,IAAKH,EAAOK,SAAUF,GAC/B,ICP0B,iBDQxB,MAAO,IAAKH,EAAOM,WAAYH,GACjC,ICR+B,sBDS7B,MAAO,IAAKH,EAAOO,gBAAiBJ,GACtC,ICNuB,cDOrB,MAAO,IAAKH,EAAOQ,QAASL,GAC9B,ICXsB,aDYpB,MAAO,IAAKH,EAAOS,OAAQN,GAC7B,ICZwB,eDatB,MAAO,IAAKH,EAAOU,SAAUP,GAC/B,ICbwB,eDctB,MAAO,IAAKH,EAAOW,SAAUR,GAC/B,ICbqB,Y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,iBAEbjvM,MAAMC,IACLE,QAAQC,IAAI,2CAADjC,OAA4C8B,EAAM2mB,kBAG3DqY,QAAQiwK,WAAW,CAACvB,EAAUE,IACjCz7K,KAAKlC,IACJ/vB,QAAQC,IAAI,6BAADjC,OAA8Byb,KAAKC,UAAUqW,IAAY,yBACpE01K,EAAU3pM,OAAS8B,OAAO4I,OAAO,GAAI,CAAEiwC,aAAa82J,EAAYD,GAChEle,GAAYie,EAAcv4L,EAASrE,UAAW26K,GAAa,KAAM,KAAMqa,GACpExzK,KAAK,KACJjyB,QAAQC,IAAI,4BAnFpB+uM,CAAaz/K,EAAgB28K,GAlhB7BrH,EAAU,eAAgB,OAAQ,CAAEnvJ,KAAM,MAqhBtCnmB,EAAeiiK,eACbjiK,EAAeiiK,eAAehzL,eAAe,YAC/CusM,EAAgBx7K,EAAeiiK,gBAExBjiK,EAAeiiK,eAAehzL,eAAe,WACpDsqL,EAAa,aACb+b,EAAU,YAAaprL,KAAKC,UAAU,CACpC44E,OAAO,IACL,CAAE58C,KAAM,OAGP6Y,EAAUg3I,QAAQ/mM,eAAe,aACxCusM,EAAgBx8I,EAAUg3I,SAE5BN,GAAY,GACZC,GAAgB,EAChBE,EAAmB,CAAE,WAAa,KAC3B,EAmGT,SAASha,GAAYr9E,IAIrB,SAAS7tG,GAAai1C,GACpB,QAAKA,IACDA,EAAS32C,eAAe,SAAoB22C,EAASC,MAAQ,EACjDD,EAAS32C,eAAe,SAAW22C,EAAS32C,eAAe,cahtD/EywM,UAAQC,UAAU5yI,GAElB6yI,IAASlM,OACL1oM,IAAAS,cAACyoM,GAAG,MACN94E,SAASykF,eAAe,SAM1BnP,M,oBCnBAoP,EAAOC,QAAU,IAA0B,uC","file":"static/js/main.82a5f32e.chunk.js","sourcesContent":["import { atom } from 'recoil';\n\nconst promptState = atom({\n key: 'promptState',\n default: null,\n});\n\nexport default promptState;\n","import React from 'react';\nimport { useSetRecoilState } from 'recoil';\nimport promptState from '../states/promptState';\n\nconst Root = ({ children }) => {\n const setPrompt = useSetRecoilState(promptState);\n const stableSetter = React.useCallback(setPrompt, [setPrompt]);\n\n React.useEffect(() => {\n const beforeInstallPromptListener = event => {\n event.preventDefault();\n stableSetter(event);\n };\n window.addEventListener('beforeinstallprompt', beforeInstallPromptListener);\n return () => {\n window.removeEventListener('beforeinstallprompt', beforeInstallPromptListener);\n };\n }, [stableSetter]);\n\n return <>{children};\n};\n\nexport default Root;\n","import React from 'react';\nimport Root from '../components/Root';\n\nconst withRoot = Component => props => (\n \n \n \n);\n\nexport default withRoot;\n","import { SET_PATIENT, SET_PATIENTS, SET_MESSAGE_TARGETS, SET_PROFILE, SET_GROUPS, SET_PRELOADS, SET_CALENDAR, SET_ROLES, SET_SESSION, SET_ACCESSLIST, SET_USER } from './actions';\n\nexport default (state, action) => {\n const { type, payload } = action;\n switch (type) {\n case SET_PATIENT:\n return { ...state, patient: payload };\n case SET_PATIENTS:\n return { ...state, patients: payload };\n case SET_ACCESSLIST:\n return { ...state, accessList: payload };\n case SET_MESSAGE_TARGETS:\n return { ...state, message_targets: payload };\n case SET_PROFILE:\n return { ...state, profile: payload };\n case SET_GROUPS:\n return { ...state, groups: payload };\n case SET_PRELOADS:\n return { ...state, preloads: payload };\n case SET_CALENDAR:\n return { ...state, calendar: payload };\n case SET_ROLES:\n return { ...state, roles: payload };\n case SET_SESSION:\n return { ...state, session: payload };\n case SET_USER:\n return { ...state, user: payload };\n default:\n return state;\n }\n};\n","export const SET_PATIENT = 'SET_PATIENT';\nexport const SET_PATIENTS = 'SET_PATIENTS';\nexport const SET_ACCESSLIST = 'SET_ACCESSLIST';\nexport const SET_MESSAGE_TARGETS = 'SET_MESSAGE_TARGETS';\nexport const SET_GROUPS = 'SET_GROUPS';\nexport const SET_PRELOADS = 'SET_PRELOADS';\nexport const SET_CALENDAR = 'SET_CALENDAR';\nexport const SET_PROFILE = 'SET_PROFILE';\nexport const SET_ROLES = 'SET_ROLES';\nexport const SET_SESSION = 'SET_SESSION';\nexport const SET_USER = 'SET_USER';\n","import React from 'react';\nimport reducer from './reducer';\n\nconst initialState = {\n patient: null,\n patients: null,\n profile: null,\n roles: null,\n session: null,\n user: null,\n version: null\n};\n\nexport const SessionContext = React.createContext(initialState);\n\nexport default ({ children }) => {\n const [state, dispatch] = React.useReducer(reducer, initialState);\n return {children};\n};\n","import React from 'react';\nimport { SessionContext } from '../contexts/Session';\n\nexport default () => {\n const context = React.useContext(SessionContext);\n if (context === undefined) {\n throw new Error('useSession must be used within a SessionProvider');\n }\n return context;\n};\n","import { isPromise, cl, recordExists, sentenceCase, titleCase, isEmpty, dbClient, getObject } from '../util/AVAUtilities';\n\nlet foundPeople = {};\nlet savedSession;\n\nexport async function makeName(pRec) {\n if (!pRec) { return 'N/A'; }\n else if (typeof pRec !== 'object') { return AVAname(await getPerson(pRec)); }\n else if ('Item' in pRec) { return AVAname(pRec.Item); }\n else if ('Items' in pRec) { return pRec.Items.map(p => AVAname(p)); }\n else { return AVAname(pRec); }\n};\n\nexport function AVAname(pRec) {\n if (isPromise(pRec)) {\n return 'Unresolved';\n }\n else if (!pRec) { return 'No name'; }\n else if ('name' in pRec) {\n return (`${pRec.name.first || ''} ${pRec.name.last || ''}`).trim();\n }\n else if ('displayName' in pRec) { return pRec.displayName; }\n else if ('messaging' in pRec) {\n if (('preferred_method' in pRec) &&\n pRec.messaging.hasOwnProperty(pRec.preferred_method)) {\n return `${pRec.messaging[pRec.preferred_method]} (${pRec.person_id})`;\n }\n else {\n let destinations = Object.keys(pRec.messaging);\n for (let k = 0; k < destinations.length; k++) {\n if (typeof destinations[k] !== 'boolean') {\n return `${pRec.messaging[destinations[k]]} (${pRec.person_id})`;\n }\n }\n }\n }\n else { return pRec.person_id; }\n}\n\nexport function getImage(pPerson) {\n if (typeof (pPerson) === 'string') {\n let imageLink = getObject(pPerson, 'image');\n return imageLink;\n }\n else if (Array.isArray(pPerson)) {\n let imageLink = getObject(pPerson[0], 'image');\n return imageLink;\n }\n else {\n return '';\n }\n // return `https://d3sds9ybtm36gy.cloudfront.net/${pPerson}.jpg`;\n};\n\nexport async function getPersonFromPartialID(pClient, pID) {\n let qQ = { TableName: 'People' };\n qQ.IndexName = 'client_id-index';\n qQ.KeyConditionExpression = 'client_id = :c';\n qQ.FilterExpression = 'contains(#p, :pID)';\n qQ.ExpressionAttributeNames = { '#p': 'person_id' };\n qQ.ExpressionAttributeValues = { ':c': pClient, ':pID': pID };\n let qR = await dbClient\n .query(qQ)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n console.log(`Security Violation or no Internet Connection`);\n }\n console.log({ 'Error reading People by Person ID': error });\n });\n if (recordExists(qR)) {\n for (let p = 0; p < qR.Items.length; p++) {\n foundPeople[qR.Items[p].person_id] = qR.Items[p];\n }\n return qR.Items;\n }\n else { return []; }\n}\n\nexport async function getPersonFromLocation(pClient, pLoc) {\n let replacements = {\n East: 'E',\n West: 'W',\n North: 'N',\n South: 'S',\n Unit: ' '\n };\n for (let v in replacements) {\n pLoc = pLoc.replace(v, replacements[v]);\n pLoc = pLoc.replace(v.toLowerCase(), replacements[v]);\n pLoc = pLoc.replace(v.toUpperCase(), replacements[v]);\n }\n pLoc = pLoc.replace(/\\s+/g, '-');\n let qQ = { TableName: 'People' };\n qQ.IndexName = 'client_id-index';\n qQ.KeyConditionExpression = 'client_id = :c';\n qQ.FilterExpression = 'contains(#l, :pL) or contains(#l, :pLup) or contains(#l, :pLow)';\n qQ.ExpressionAttributeNames = { '#l': 'location' };\n qQ.ExpressionAttributeValues = { ':c': pClient, ':pL': pLoc, ':pLup': pLoc.toUpperCase(), ':pLow': pLoc.toLowerCase() };\n let qR = await dbClient\n .query(qQ)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n console.log(`Security Violation or no Internet Connection`);\n }\n console.log({ 'Error reading Person by Location': error });\n });\n if (recordExists(qR)) {\n for (let p = 0; p < qR.Items.length; p++) {\n foundPeople[qR.Items[p].person_id] = qR.Items[p];\n }\n return qR.Items;\n }\n else { return []; }\n}\n\nexport async function getPersonByName(pClient, pFirstName, pLastName) {\n if (!pLastName) {\n if (pFirstName.includes(',')) {\n let pWords = pFirstName.split(/,(.*)/);\n pLastName = pWords[0].trim();\n pFirstName = pWords[1].trim();\n }\n else {\n let pWords = pFirstName.split(' ');\n pLastName = pWords.pop();\n pFirstName = pWords.join(' ');\n }\n }\n let qQ = { TableName: 'People' };\n qQ.IndexName = 'client_id-index';\n qQ.KeyConditionExpression = 'client_id = :c';\n qQ.FilterExpression = 'contains(#f, :f) and contains(#f, :l)';\n qQ.ExpressionAttributeValues = { ':c': pClient, ':f': sentenceCase(pFirstName), ':l': sentenceCase(pLastName) };\n qQ.ExpressionAttributeNames = { '#f': 'display_name' };\n let qR = await dbClient\n .query(qQ)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n console.log(`Security Violation or no Internet Connection`);\n }\n console.log({ 'Error reading People by Name': error });\n });\n if (recordExists(qR)) {\n for (let p = 0; p < qR.Items.length; p++) {\n foundPeople[qR.Items[p].person_id] = qR.Items[p];\n }\n return qR.Items;\n }\n else { return []; }\n}\n\nexport async function getPersonByWords(pClient, pWords) {\n if (!pWords || pWords.length === 0) { return []; }\n let qQ = { TableName: 'People' };\n qQ.IndexName = 'client_id-index';\n qQ.KeyConditionExpression = 'client_id = :c';\n qQ.ExpressionAttributeNames = { '#d': 'search_data' };\n qQ.ExpressionAttributeValues = { ':c': pClient };\n qQ.FilterExpression = '';\n let conjunction = '';\n for (let x = 0; x < pWords.length; x++) {\n if (pWords[x] && (pWords[x].length > 2)) {\n qQ.FilterExpression += ` ${conjunction} contains(#d, :f${x})`;\n qQ.ExpressionAttributeValues[`:f${x}`] = pWords[x];\n conjunction = 'and';\n }\n }\n if (!qQ.FilterExpression) { return []; }\n let qR = await dbClient\n .query(qQ)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n console.log(`Security Violation or no Internet Connection`);\n }\n console.log({ 'Error reading People by Name': error });\n });\n if (recordExists(qR)) {\n for (let p = 0; p < qR.Items.length; p++) {\n let searchWords = qR.Items[p].search_data.split(/[\\W,]/);\n let notFoundWords = pWords.filter(w => { return (w && !searchWords.includes(w)); });\n if (notFoundWords.length === 0) {\n foundPeople[qR.Items[p].person_id] = qR.Items[p];\n }\n else {\n qR.Items.splice(p, 1);\n }\n }\n return qR.Items;\n }\n else { return []; }\n}\n\nexport async function getWIPFormList({ client_id, personList }) {\n let response = {};\n\n // in a minute, we're going to need the names and due dates of all the forms that are found.\n // we'll grab them all here.\n let formNames = {};\n let formDueDates = {};\n let formList = {};\n let formResult = await dbClient\n .query({\n TableName: 'Forms',\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': client_id }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading Forms is ${error}`);\n });\n if (recordExists(formResult)) {\n for (let this_form of formResult.Items) {\n formNames[this_form.form_id] = this_form.form_name;\n formDueDates[this_form.form_id] = this_form.due_by ? this_form.due_by[0] : null;\n }\n }\n\n // ... and we'll need the formList from every group\n let groupResult = await dbClient\n .query({\n TableName: 'Groups',\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': client_id }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading Groups is ${error}`);\n });\n if (recordExists(groupResult)) {\n for (let this_group of groupResult.Items) {\n formList[this_group.group_id] = this_group.forms;\n }\n }\n\n for (let person_id of personList) {\n // get all the groups that this person belongs to\n let peopleRec = await dbClient\n .get({\n Key: { person_id: person_id },\n TableName: \"People\"\n })\n .promise()\n .catch(error => {\n cl({ [`in getWIPFormList, Error reading People key=${person_id}`]: error });\n });\n if (!recordExists(peopleRec)) {\n response[person_id] = {\n formListObj: {},\n numberWIP: 0,\n nearest_dueDate: 0\n };\n }\n\n let myFormListObj = {};\n // get all the forms that are assigned to people in this group \n for (let this_group of peopleRec.Item.groups) {\n if (formList[this_group] && (formList[this_group].length > 0)) {\n for (let this_form of formList[this_group]) {\n if (!myFormListObj.hasOwnProperty(this_form)) {\n myFormListObj[this_form] = {\n form_id: this_form,\n form_name: formNames[this_form],\n due_date: formDueDates[this_form],\n completed: false,\n wip: false,\n document_list: []\n };\n }\n }\n }\n }\n\n // get all the completed documents for this person\n let recentlyCompletedDocs = await dbClient\n .query({\n KeyConditionExpression: 'pertains_to = :p',\n ScanIndexForward: false,\n IndexName: 'pertains_to-formType_date-index',\n Limit: 40,\n TableName: 'CompletedDocuments',\n ExpressionAttributeValues: {\n ':p': person_id\n }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading CompletedDocuments; error is ${error}`);\n });\n if (recordExists(recentlyCompletedDocs)) {\n for (let this_doc of recentlyCompletedDocs.Items) {\n if (!myFormListObj.hasOwnProperty(this_doc.formType)) {\n myFormListObj[this_doc.formType] = {\n form_id: this_doc.formType,\n form_name: formNames[this_doc.formType],\n due_date: formDueDates[this_doc.formType],\n completed: true,\n wip: false,\n document_list: []\n };\n }\n myFormListObj[this_doc.formType].completed = true;\n myFormListObj[this_doc.formType].document_list.push({\n document_id: this_doc.document_id,\n isComplete: true,\n location: this_doc.file_location,\n date_completed: this_doc.date_completed\n });\n }\n }\n\n // Check for an exising WIP form\n let wipDocuments = await dbClient\n .query({\n KeyConditionExpression: 'pertains_to = :p',\n ScanIndexForward: false,\n TableName: 'DocumentsInProcess',\n IndexName: 'pertains_to-formType_date-index',\n ExpressionAttributeValues: {\n ':p': person_id,\n }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading DocumentsInProcess; error is ${error}`);\n });\n if (recordExists(wipDocuments)) {\n for (let this_doc of wipDocuments.Items) {\n if (!myFormListObj.hasOwnProperty(this_doc.formType)) {\n myFormListObj[this_doc.formType] = {\n form_id: this_doc.formType,\n form_name: formNames[this_doc.formType],\n due_date: formDueDates[this_doc.formType],\n completed: false,\n wip: true,\n document_list: []\n };\n }\n myFormListObj[this_doc.formType].wip = true;\n myFormListObj[this_doc.formType].document_list.push({\n document_id: this_doc.document_id,\n isComplete: false,\n });\n }\n }\n\n // go through all the forms to summarize\n let numberWIP = 0;\n let nearest_dueDate = false;\n for (let this_formID in myFormListObj) {\n if (!myFormListObj[this_formID].completed || myFormListObj[this_formID].wip) {\n numberWIP++;\n if (myFormListObj[this_formID].due_date\n && (myFormListObj[this_formID].due_date > 0)\n && (!nearest_dueDate || (myFormListObj[this_formID].due_date < nearest_dueDate))\n ) {\n nearest_dueDate = myFormListObj[this_formID].due_date;\n }\n }\n }\n response[person_id] = {\n formListObj: {},\n numberWIP,\n nearest_dueDate\n };\n }\n return response;\n}\n\nexport async function getPerson(pID, pElement = '*all', override = false) {\n if (!foundPeople || (!(pID in foundPeople)) || override) {\n let personRec = await dbClient\n .get({\n Key: { person_id: pID },\n TableName: \"People\"\n })\n .promise()\n .catch(error => {\n cl({ [`in getPerson, Error reading key=${pID}`]: error });\n });\n if (!recordExists(personRec)) {\n if (pElement === 'validate') { return false; }\n else { return {}; }\n }\n else if (pElement === 'validate') { return true; }\n if (!personRec.Item.hasOwnProperty('messaging')) {\n personRec.Item.messaging = {};\n }\n if (personRec.Item.messaging.voice) {\n personRec.Item.voice = personRec.Item.home = formatPhone(personRec.Item.messaging.voice);\n personRec.Item.search_data += ' ' + personRec.Item.messaging.voice;\n }\n else { personRec.Item.voice = personRec.Item.home = ''; }\n if (personRec.Item.messaging.sms) {\n personRec.Item.cell = personRec.Item.sms = formatPhone(personRec.Item.messaging.sms);\n personRec.Item.search_data += ' ' + personRec.Item.messaging.sms;\n }\n else { personRec.Item.cell = personRec.Item.sms = ''; }\n if (personRec.Item.messaging.office) {\n personRec.Item.office = formatPhone(personRec.Item.messaging.office);\n }\n else { personRec.Item.office = ''; }\n personRec.Item.email = personRec.Item.messaging.email;\n if (!personRec.Item.hasOwnProperty('name')) {\n personRec.Item.name = {};\n }\n personRec.Item.first = personRec.Item?.name.first;\n personRec.Item.last = personRec.Item?.name.last;\n personRec.Item.display_name = (`${personRec.Item.first} ${personRec.Item.last}`).trim();\n if (!personRec.Item.search_data) { personRec.Item.search_data = ''; }\n personRec.Item.search_data += personRec.Item.search_data.toLowerCase();\n personRec.Item.search_data +=\n ' ' + personRec.Item.messaging.email +\n ' ' + (personRec.Item.messaging.voice || '') +\n ' ' + (personRec.Item.messaging.office || '') +\n ' ' + (personRec.Item.messaging.sms || '');\n foundPeople[pID] = personRec.Item;\n }\n switch (pElement.toLowerCase()) {\n case '*all': { return foundPeople[pID]; }\n case 'name': { return await makeName(foundPeople[pID]); }\n default: { return foundPeople[pID]; }\n }\n};\n\nexport function formatPhone(numberIn) {\n if (!numberIn) { return ''; }\n if (typeof (numberIn) === 'string') { numberIn = Number(numberIn.replace(/\\D/g, '')); }\n let response = '';\n switch (true) {\n case (numberIn > 9999999): {\n response += `(${(' ' + Math.floor(numberIn / 10000000)).slice(-3)}) `;\n }\n // eslint-disable-next-line\n case (numberIn > 9999): {\n response += `${(' ' + Math.floor(numberIn / 10000)).slice(-3)}-`;\n response += ('0000' + (numberIn % 10000).toString()).slice(-4);\n break;\n }\n default: { response += (' ' + (numberIn % 10000).toString()).slice(-4); }\n }\n return response.trim();\n}\n\nexport async function getSession(pID) {\n if (savedSession && (savedSession.session_id === pID)) {\n return savedSession;\n }\n let sessionRec = await dbClient\n .get({\n Key: { session_id: pID },\n TableName: \"SessionsV2\"\n })\n .promise()\n .catch(error => { cl({ 'Error reading SessionsV2': error }); });\n if (recordExists(sessionRec)) {\n if (('groups_managed' in sessionRec.Item) && !Array.isArray(sessionRec.Item.groups_managed)) {\n sessionRec.Item.groups_managed = sessionRec.Item.groups_managed.split(/[[,\\]]/);\n }\n if (('responsible_for' in sessionRec.Item) && !Array.isArray(sessionRec.Item.responsible_for)) {\n sessionRec.Item.responsible_for = sessionRec.Item.responsible_for.split(/[[,\\]]/);\n }\n savedSession = sessionRec.Item;\n return sessionRec.Item;\n }\n return {};\n};\n\nexport async function addGuest(body) {\n if (!body\n || !body.name\n || !body.name.first\n || !body.name.last\n || (!body.phone && !body.sms && (!body.messaging || !body.messaging.sms))\n || !body.client_id\n ) { return { result: 'failed', message: 'Missing data in request' }; }\n let tryAgain;\n let availableID = '';\n let namePart = `${body.client_id}_guest_`;\n if (body.id || body.person_id) { namePart += body.id || body.person_id; }\n else { namePart += body.name.first.trim().substr(0, 1).toLowerCase() + body.name.last.toLowerCase().replace(/\\W/g, ''); }\n let numberPart = 1;\n let lookupID = namePart;\n do {\n let found = await getPerson(lookupID);\n if (!isEmpty(found)) {\n tryAgain = true;\n lookupID = `${namePart}${numberPart}`;\n numberPart++;\n }\n else {\n tryAgain = false;\n availableID = lookupID;\n }\n } while (tryAgain);\n cl(`User ID ${availableID} assigned`);\n let putPerson = {\n person_id: availableID,\n client_id: body.client_id,\n \"name\": {\n first: titleCase(body.name.first),\n last: titleCase(body.name.last),\n },\n messaging: {\n email: body.email || (body.messaging ? body.messaging.email : null),\n sms: body.phone || body.sms || (body.messaging ? body.messaging.sms : null),\n voice: body.voice || (body.messaging ? body.messaging.voice : null),\n office: body.office || (body.messaging ? body.messaging.office : null)\n },\n search_data: makeSearchData([body]) + ' guest',\n preferred_method: 'sms',\n requirePassword: false,\n storePassword: true,\n directory_option: 'normal',\n clients: {\n id: body.client_id,\n groups: ['guests']\n },\n groups: ['guests'],\n location: body.location ? body.location.replace(/,/g, '') : body.client_id\n };\n await dbClient\n .put({\n Item: putPerson,\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating People; error is:`, error);\n return { result: 'failed', message: error };\n });\n return { result: 'success', personRec: putPerson };\n}\n\nexport async function addVendor(body) {\n if (!body) {\n return { result: 'failed', message: 'Missing data in request' };\n }\n else if (!body.name || !body.name.first || !body.name.last) {\n return { result: 'failed', message: 'Missing name in request' };\n }\n else if (!body.location) {\n return { result: 'failed', message: 'Missing location in request' };\n }\n else if (!body.client_id) {\n return { result: 'failed', message: 'Missing client in request' };\n }\n else if (!body.phone && !body.sms && (!body.messaging || !body.messaging.sms)) {\n return { result: 'failed', message: 'Missing phone number in request' };\n }\n let tryAgain;\n let availableID = '';\n let namePart = `${body.client_id}_vendor_`;\n if (body.id || body.person_id) { namePart += body.id || body.person_id; }\n else { namePart += body.name.first.trim().substr(0, 1).toLowerCase() + body.name.last.toLowerCase().replace(/\\W/g, ''); }\n let numberPart = 1;\n let lookupID = namePart;\n do {\n let found = await getPerson(lookupID);\n if (!isEmpty(found)) {\n tryAgain = true;\n lookupID = `${namePart}${numberPart}`;\n numberPart++;\n }\n else {\n tryAgain = false;\n availableID = lookupID;\n }\n } while (tryAgain);\n cl(`User ID ${availableID} assigned`);\n let putPerson = {\n person_id: availableID,\n client_id: body.client_id,\n \"name\": {\n first: titleCase(body.name.first),\n last: titleCase(body.name.last),\n },\n messaging: {\n email: body.email || (body.messaging ? body.messaging.email : null),\n sms: body.phone || body.sms || (body.messaging ? body.messaging.sms : null),\n voice: body.voice || (body.messaging ? body.messaging.voice : null),\n office: body.office || (body.messaging ? body.messaging.office : null)\n },\n search_data: makeSearchData([body]) + ' vendor',\n preferred_method: 'sms',\n requirePassword: false,\n storePassword: true,\n directory_option: 'normal',\n clients: {\n id: body.client_id,\n groups: ['vendors']\n },\n groups: ['vendors'],\n location: body.location ? body.location.replace(/,/g, '') : body.client_id\n };\n await dbClient\n .put({\n Item: putPerson,\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating People; error is:`, error);\n return { result: 'failed', message: error };\n });\n return { result: 'success', personRec: putPerson };\n}\n\nexport function makeSearchData(iArray) {\n let search_words = [];\n iArray.forEach(i => {\n if (i.searchTerm) { search_words.push(...(i.searchTerm.trim().split(/\\s+/))); };\n if (i.location) {\n search_words.push(...(i.location.replace(/,/g, ' ').trim().toLowerCase().split(/\\s+/)));\n let digits = i.location.replace(/\\D+/g, '').trim();\n if (digits) {\n search_words.push(...(digits.split(/\\s+/)));\n }\n }\n let names = [i.firstName, i.lastName, (i.display_name ? i.display_name.replace(/,/g, ' ') : '')];\n if (i.name) (names.push(...(Object.values(i.name))));\n names.forEach(n => {\n if (n) {\n search_words.push(...(n.trim().toLowerCase().split(/\\s+/)));\n search_words.push(...(titleCase(n.trim()).split(/\\s+/)));\n }\n });\n let phone = [i.cell, i.sms, i.office, i.voice];\n if (i.messaging) (phone.push(...(Object.values(i.messaging))));\n phone.forEach(p => {\n if (p && (typeof (p) === 'string')) {\n let iC = p.replace(/\\D/g, '');\n search_words.push(iC);\n search_words.push(iC.slice(-4));\n }\n });\n });\n let wordCheck = [];\n search_words.forEach(w => {\n if (!wordCheck.includes(w) && (w !== 'undefined')) { wordCheck.push(w); }\n });\n return wordCheck.join(' ');\n}\n","import { cl, clt, recordExists, makeArray, getCustomizations, dbClient, deepCopy, titleCase } from './AVAUtilities';\nimport { AVAname, getPerson, getSession } from '../util/AVAPeople';\nimport { makeDate } from './AVADateTime';\n\nlet profile, session;\nlet groupRecs = {};\nlet targetObj = {};\nlet targetArray = [];\nlet targetPerson = null;\nlet loadedGroupObj = {};\nlet loadedPerson = null;\n\n/* \n**********************\n\n AVA GROUPS\n\n group_type \n --------------\n admin groups based on who you are; an account belongs to exactly ONE admin group \n parent a group that owns one or more other groups; an account is assigned to this group because it belongs to one of its children or grandchildren\n open groups available for any account to join - equivalient to \"public\"\n public groups available for any account to join - equivalient to \"open\"\n private groups that require a group administrator to add you to\n\n admin_class associated with the single admin group this account belongs to, describes what information is available to members of this group \n --------------\n local see table below \n family see table below\n inactive all actions prohibited for any account in the client that this group is a part of\n support members may view, proxy, and edit any account in the client that this group is a part of\n master members may view, proxy, and edit any account from any client\n\n local and family class access rules\n ------------------------------------\n Other members of a group I am a member of = local may view; family has no access (respect privacy rules)\n Other members of a group that I manage = view (ignore privacy rules)\n Members of a group that I am not a member of = depends on \"view_group\" attribute of group you are viewing\n Specific individual accounts or groups that I am responsible for or manage (SessionsV2 table) = view, proxy, and edit\n Specific individual accounts or groups that I have a relationship with = based on the access_type of the specific relationship\n\n\n********************** \n*/\n\n// Functions\n\nexport async function accountAccess(person_id, pClient_id, dispatch) {\n // Does my person account designate an account_class?\n let myPeopleRec = await getPerson(person_id);\n let myClass;\n let accessList = {};\n let respList = {};\n let proxyList = [];\n let birthdayList = {};\n if (myPeopleRec.account_class) {\n myClass = myPeopleRec.account_class;\n }\n else {\n // What admin group do I belong to in the client_id?\n let allGroupObject = await getAllGroups(person_id, pClient_id);\n let myAdminGroup = await getGroup(allGroupObject.selectedID, pClient_id);\n if (myAdminGroup.admin_class) {\n myClass = myAdminGroup.admin_class;\n }\n else {\n let clientGroupAssignments = await getCustomizations('group_assignments', pClient_id);\n if (clientGroupAssignments && clientGroupAssignments.customization_value) {\n for (let accountClass in clientGroupAssignments.customization_value) {\n if (makeArray(clientGroupAssignments.customization_value[accountClass]).includes(myAdminGroup.group_id)) {\n myClass = accountClass;\n break;\n }\n }\n }\n if (!myClass) {\n myClass = 'local';\n }\n }\n }\n // Now get a list of people that I can access\n let myGroupAccessLevel = {};\n if (myClass !== 'inactive') {\n if (!session || (session.session_id !== person_id)) {\n session = await getSession(person_id);\n }\n if (!session.hasOwnProperty('responsible_for')) {\n session.responsible_for = [];\n }\n let accessLevelTable = ['none', 'restricted', 'view', 'proxy', 'full'];\n let clientList = [pClient_id];\n if (((myClass === 'support') || (myClass === 'admin'))\n && (myPeopleRec.hasOwnProperty('clients') && Array.isArray(myPeopleRec.clients))) {\n myPeopleRec.clients.forEach(c => {\n if (!clientList.includes(c.id)) { clientList.push(c.id); }\n });\n }\n else if (myClass === 'master') {\n clientList = await getAllClients();\n };\n for (let c = 0; c < clientList.length; c++) {\n let client_id = clientList[c];\n // let client_id = pClient_id;\n let clientName = await getCustomizations('client_name', client_id);\n let clientLogo = await getCustomizations('logo', client_id);\n let clientGroupAssignments = await getCustomizations('group_assignments', client_id);\n // for every group in this client, classify that group by its type (admin, staff, resident, etc...)\n // then establish where in the hierarchy of groups this one belongs\n // store that in an object (groupFlavor) for easy retrieval later\n let groupFlavor = {};\n let groupHierarchy = ['admin', 'staff', 'resident', 'family', 'inactive', 'guest', 'vendor', 'unassigned'];\n if (clientGroupAssignments && clientGroupAssignments.customization_value) {\n Object.keys(clientGroupAssignments.customization_value).forEach(t => {\n let groups = makeArray(clientGroupAssignments.customization_value[t]);\n let foundAt = groupHierarchy.indexOf(t);\n if (foundAt < 0) { foundAt = groupHierarchy.length - 1; }\n groups.forEach(g => {\n if (!groupFlavor.hasOwnProperty(g)) { groupFlavor[g] = foundAt; }\n else { groupFlavor[g] = Math.min(foundAt, groupFlavor[g]); }\n });\n });\n }\n accessList[client_id] = {\n name: clientName.customization_value,\n logo: clientLogo.icon,\n count: {},\n list: []\n };\n respList[client_id] = {\n name: clientName.customization_value,\n logo: clientLogo.icon,\n count: {},\n list: []\n };\n let options = {};\n accessLevelTable.forEach(a => { accessList[client_id].count[a] = 0; });\n if (['master', 'support', 'admin'].includes(myClass)) {\n // options = { withSession: true };\n }\n if (client_id !== session.client_id) {\n options = { nameOnly: true };\n }\n let allPeople = await getMemberList('*all', client_id, options);\n // get all the people in the client\n let pxL = allPeople.peopleList.length;\n for (let pX = 0; pX < pxL; pX++) {\n let p = allPeople.peopleList[pX];\n // for each person... I am allowed access to them or not?\n let accessLevel = 'none';\n let myMaxAccessLevelToThisPerson = -1;\n let personFlavor = 99;\n // if I am a support or master class user, I get FULL (level 3) access to all users in this client\n if (['support', 'master', 'admin'].includes(myClass)) {\n myMaxAccessLevelToThisPerson = 3;\n }\n else if (p.may_proxy_to && p.may_proxy_to.hasOwnProperty(person_id)) {\n myMaxAccessLevelToThisPerson = 3; // the person record we're looking at granted permission for me to proxy to them\n }\n else {\n // also... determine my role in all of the groups in this client\n if (p.groups) {\n let gL = p.groups.length;\n for (let x = 0; x < gL; x++) {\n let g = p.groups[x];\n if ((g === 'ALL') || (g === \"__TOP__\") || (g === \"_TOP_\")) {\n continue;\n }\n // am I specificaly responsible for this person?\n if (session.responsible_for.includes(p.person_id)\n && ((myClass !== 'family') || !(['none', 'na', 'cancelled', 'inactive'].includes(session.subscription_status)))\n ) {\n myMaxAccessLevelToThisPerson = 3;\n continue;\n }\n // this person may belong to multiple groups; each group is assigned a type (flavor) earlier\n // which describes where that group lands in the client's hierarchy of groups\n // a person is given a flavor based on the most significant (lowest hierarchy number) group\n // that this person is a member of\n // \n // your class (set in your people rec or defaulted above in this code) determines\n // how you are allowed to interact with people of a particular hierarchy\n if (groupFlavor.hasOwnProperty(g)) {\n personFlavor = Math.min(personFlavor, groupFlavor[g]);\n }\n // We're going to remember the access level for each group, so we don't\n // have to recalculate it for each person in the client\n // if we've already calculated my level of access to members of this group, it will be saved \n // in the myGroupAccessLevel object; if not, calculate it and save it there\n if (!myGroupAccessLevel.hasOwnProperty(g) && (myMaxAccessLevelToThisPerson < 3)) {\n let myRole = await getRole(g, person_id);\n if (myRole === 'responsible') { myGroupAccessLevel[g] = accessLevelTable.indexOf('full'); }\n else {\n // the Group table record for a group MAY contain a view_group attribute\n // if it does, this attribute will contain an object\n // that object is keyed by class of user\n // each key should have a single value with the word (see accessLevelTable above) indicating\n // the level of access granted to users of this class\n // example... the staff group may have a view_group = {'local': 'view'} which would allow \n // local users to see (but not proxy to) its members\n let this_group = await getGroup(g, client_id);\n\n if (this_group.view_group && this_group.view_group.hasOwnProperty(myClass)) {\n myGroupAccessLevel[g] = accessLevelTable.indexOf(this_group['view_group'][myClass]);\n }\n else {\n myGroupAccessLevel[g] = accessLevelTable.indexOf('none');\n if ((myRole === 'member')\n && (['local', 'resident', 'staff', 'admin'].includes(myClass))\n // if I am a member of a group and not a guest, vendor, or family\n // ... I may(at least) view other members of my group\n ) {\n myGroupAccessLevel[g] = Math.max(accessLevelTable.indexOf('view'), myGroupAccessLevel[g]);\n }\n }\n/*\n if (!this_group.hasOwnProperty('view_group')) {\n myGroupAccessLevel[g] = accessLevelTable.indexOf('none');\n }\n else if (this_group['view_group'].hasOwnProperty(myClass)) {\n myGroupAccessLevel[g] = accessLevelTable.indexOf(this_group['view_group'][myClass]);\n }\n else {\n myGroupAccessLevel[g] = accessLevelTable.indexOf('none');\n }\n if ((myRole === 'member')\n && (['local', 'resident', 'staff', 'admin'].includes(myClass))\n // if I am a member of a group and not a guest, vendor, or family\n // ... I may(at least) view other members of my group\n ) {\n myGroupAccessLevel[g] = Math.max(accessLevelTable.indexOf('view'), myGroupAccessLevel[g]);\n }\n */\n }\n }\n if (myGroupAccessLevel[g] > myMaxAccessLevelToThisPerson) {\n myMaxAccessLevelToThisPerson = myGroupAccessLevel[g];\n }\n }\n }\n }\n if (myMaxAccessLevelToThisPerson > 0) { accessLevel = accessLevelTable[myMaxAccessLevelToThisPerson]; }\n if (accessLevel !== 'none') {\n if (p?.local_data?.['date of birth']) {\n let dob = makeDate(p.local_data['date of birth'], { forceForward: true });\n if (!birthdayList.hasOwnProperty(dob.numeric$)) {\n birthdayList[dob.numeric$] = [];\n }\n birthdayList[dob.numeric$].push({\n person_id: p.person_id,\n display_name: `${p.name.first} ${p.name.last}`,\n });\n }\n if ((accessLevel === 'proxy') || (accessLevel === 'full')) {\n proxyList.push(p.person_id);\n };\n let pRec2Push = {\n person_id: p.person_id,\n name: p.name,\n first: p.name.first,\n last: p.name.last,\n display_name: `${p.name.first} ${p.name.last}`,\n preferred_method: p.preferred_method,\n id: p.person_id,\n access: accessLevel,\n };\n if (client_id === session.client_id) {\n pRec2Push.directory_option = p.directory_option;\n pRec2Push.groups = p.groups;\n pRec2Push.location = p.location;\n pRec2Push.messaging = p.messaging;\n pRec2Push.member_of = ((personFlavor < 99) ? groupHierarchy[personFlavor] : null);\n pRec2Push.search_data = p.search_data;\n pRec2Push.session = p.session;\n };\n if (session.responsible_for.includes(p.person_id) || (p.person_id === person_id)) {\n respList[client_id].list.push(pRec2Push);\n }\n else {\n accessList[client_id].list.push(pRec2Push);\n }\n }\n };\n // sort names within this client\n accessList[client_id].list.sort((a, b) => {\n if (a.last > b.last) { return 1; }\n else if (a.last < b.last) { return -1; }\n else if (a.first > b.first) { return 1; }\n else if (a.first < b.first) { return -1; }\n else { return 0; }\n });\n respList[client_id].list.sort((a, b) => {\n if (a.last > b.last) { return 1; }\n else if (a.last < b.last) { return -1; }\n else if (a.first > b.first) { return 1; }\n else if (a.first < b.first) { return -1; }\n else { return 0; }\n });\n accessList[client_id].list.unshift(...respList[client_id].list);\n accessList[client_id].shortList = accessList[client_id].list.map(p => {\n accessList[client_id].count[p.access]++;\n let searchString = [...Object.values(p.name), p.search_data, p.location].join(' ');\n if (p.messaging) { searchString += Object.values(p.messaging).join(' '); }\n // list is of the form ::\n return `${p.name.last}, ${p.name.first}:${p.person_id}:${searchString}`;\n });\n accessList[client_id].groups = myGroupAccessLevel;\n }\n if (myClass === 'family') {\n if (['none', 'na', 'cancelled', 'inactive'].includes(session.subscription_status)) {\n accessList.subscription = {\n subscription_active: false,\n subscription_status: session.subscription_status\n };\n }\n else {\n accessList.subscription = {\n subscription_active: true,\n subscription_status: session.subscription_status\n };\n }\n }\n }\n accessList.birthdayList = deepCopy(birthdayList);\n return accessList;\n}\n\nexport async function getAllClients() {\n let qParm = {\n FilterExpression: 'custom_key = :c',\n ExpressionAttributeValues: { ':c': 'client_name' },\n TableName: \"Customizations\"\n };\n let everyClient = await dbClient\n .scan(qParm)\n .promise()\n .catch(error => {\n cl({ 'Error reading for Clients': error });\n });\n let returnArray = [];\n if (recordExists(everyClient)) {\n let activeClients = everyClient.Items.filter(this_client => {\n return (!this_client.disabled);\n });\n activeClients.sort((a, b) => { // sort by client name\n if (a.customization_value > b.customization_value) { return 1; }\n else { return -1; }\n });\n returnArray = activeClients.map(c => {\n return c.client_id;\n });\n }\n return returnArray;\n}\n\nexport async function isMemberOf(client_id, person_id, pGroup_id) {\n if (!loadedPerson || (loadedPerson !== person_id)) {\n loadedGroupObj = await getGroupsBelongTo(client_id, person_id);\n }\n return (Object.keys(loadedGroupObj).includes(pGroup_id));\n};\n\nexport async function getGroupsResponsibleFor(client_id, person_id, options) {\n var returnObject = {};\n var rejectObject = {};\n // first, get a list of every group in this client\n if (!client_id && session) {\n client_id = session.client_id;\n }\n let qParm = {\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': client_id },\n TableName: \"Groups\"\n };\n let everyGroup = await dbClient\n .query(qParm)\n .promise()\n .catch(error => {\n cl({\n 'Error reading Groups': error,\n client_id: `<${client_id}>`\n });\n });\n if (!recordExists(everyGroup)) {\n return [returnObject, rejectObject];\n }\n // one at a time, determine if you are responsible for this group or not\n // to do this, we'll need the session record for this person\n let my_session = ((!!session && (session.session_id === person_id)) ? session : await getSession(person_id));\n let my_session_groups_managed = [];\n if (my_session.hasOwnProperty('groups_managed')) {\n my_session_groups_managed = makeArray(my_session.groups_managed).map(g => {\n return g.split('~').shift().trim();\n });\n }\n let my_session_responsibleList = [];\n if (my_session.hasOwnProperty('responsible_for')) {\n if (Array.isArray(my_session.responsible_for)) {\n my_session_responsibleList = deepCopy(my_session.responsible_for);\n }\n else if (my_session.responsible_for.startsWith('[')) {\n my_session_responsibleList = session.responsible_for.replace(/[[\\s\\]]/g, '').split(',');\n }\n else {\n my_session_responsibleList = makeArray(my_session.responsible_for);\n }\n }\n let classList = [];\n everyGroup.Items.forEach(this_group => {\n if ((this_group.hasOwnProperty('admin_list') && this_group.admin_list.includes(person_id))\n || (options && options.account_class && (['master', 'support', 'admin'].includes(options.account_class)))\n || (my_session_groups_managed.includes(this_group))\n || (my_session_responsibleList.includes(this_group))) {\n returnObject[this_group.group_id] = {\n group_name: this_group.name,\n group_id: this_group.group_id,\n role: 'responsible',\n admin_class: this_group.admin_class\n };\n if (!classList.includes(this_group.admin_class)) {\n classList.push(this_group.admin_class);\n }\n }\n else {\n rejectObject[this_group.group_id] = {\n group_name: this_group.name,\n group_id: this_group.group_id,\n admin_class: this_group.admin_class\n };\n }\n });\n loadedPerson = person_id;\n return [returnObject, rejectObject, classList];\n}\n\nexport async function getPeopleResponsibleFor(person_id) {\n if (!session || (session.patient_id !== person_id)) {\n session = await getSession(person_id);\n }\n var respList = [];\n if ('groups_managed' in session) {\n for (let g = 0; g < session.groups_managed.length; g++) {\n let [gID,] = session.groups_managed[g].split('~').map(s => { return s.trim(); });\n respList.push(gID);\n };\n }\n let respArray = [];\n if ('responsible_for' in session) {\n if (Array.isArray(session.responsible_for)) { respArray.push(...session.responsible_for); }\n else if (session.responsible_for.startsWith('[')) { respArray = session.responsible_for.replace(/[[\\s\\]]/g, '').split(','); }\n else { respArray.push(session.responsible_for); }\n }\n for (let g = 0; g < respArray.length; g++) {\n let rID = respArray[g].trim();\n if (!respList.includes(rID)) { respList.push(rID); }\n }\n let returnObject = await getMemberList(respList, session.client_id, { sortResults: true });\n return returnObject.peopleList.map(p => {\n return `${p.name.last}, ${p.name.first}:${p.person_id}:${p.search_data}`;\n });\n}\n\nexport async function getGroupsBelongTo(client_id, person_id, options = {}) {\n if (options.hasOwnProperty('groups')) {\n\n }\n // You belong to all groups that you are responsible for\n let [returnObject, rejectObject, classList] = await getGroupsResponsibleFor(client_id, person_id, options);\n // Next, get any other Groups that this person belongs to (but aren't responsible for)\n if (!profile || (profile.person_id !== person_id)) {\n profile = await getPerson(person_id);\n }\n if (profile && profile.groups) {\n for (let rejectGroup in rejectObject) {\n if (profile.groups.includes(rejectGroup)) {\n returnObject[rejectGroup] = {\n group_name: rejectObject[rejectGroup].group_name,\n group_id: rejectObject[rejectGroup].group_id,\n role: 'member'\n };\n if (!classList.includes(rejectObject.admin_class)) {\n classList.push(rejectObject.admin_class);\n }\n }\n }\n }\n loadedPerson = person_id;\n loadedGroupObj = returnObject;\n if (options && options.sort) {\n // put each object in an array of objects, then sort that array and return an object sequenced by the sort\n let gArray = [];\n for (let gID in returnObject) { gArray.push(returnObject[gID]); }\n gArray.sort((a, b) => {\n if (a.group_name > b.group_name) { return 1; }\n else { return -1; }\n });\n let newObject = {};\n gArray.forEach(g => { newObject[g.group_id] = g; });\n return newObject;\n }\n else { return returnObject; }\n};\n\nexport async function getAuthObject(request) {\n /* \n AuthObj in response will set permission level for default, people (as person_id), \n groups (as GRP//group_id), and flavors (as FLAV//flavor). For each key, value should be:\n 0 = none\n 1 = minimal, I may see name only\n 3 = basic, I may see name and location\n 5 = contact detail, I may see contact information\n 7 = edit, I may update person information\n 9 = proxy\n */\n if (!request.userRec) {\n if (!request.user_id) {\n return {\n source: 'Error',\n authObj: { default: 0 }\n };\n }\n else {\n request.userRec = await getPerson(request.user_id);\n }\n }\n // if account_class is 'master' or 'support' grant full authority\n if (request.userRec.account_class && (['master', 'support'].includes(request.userRec.account_class))) {\n return {\n source: `User Account_class ${request.userRec.person_id}//${request.userRec.account_class}`,\n authObj: { default: 9 }\n };\n }\n // set based on the user's group\n if (request.session) {\n if (request.session.group_precedence) {\n if (Array.isArray(request.session.group_precedence)) {\n let lowIndex = 999;\n request.userRec.groups.forEach(uGroup => {\n let foundIndex = request.session.group_precedence.indexOf(uGroup);\n if ((foundIndex > -1) && (foundIndex < lowIndex)) {\n lowIndex = foundIndex;\n }\n });\n if (lowIndex < 999) {\n let targetGroupRec = await getGroup(request.session.group_precedence[lowIndex], request.session.client_id);\n if (targetGroupRec) {\n cl({ 'HighestPrecedentGroup': targetGroupRec.group_id });\n if (targetGroupRec.authorities) {\n return {\n source: `Authority granted to the highest precedent Group I belong to = ${targetGroupRec.group_id}`,\n authObj: targetGroupRec.authorities\n };\n }\n else if (targetGroupRec.flavor && request.session.group_flavors) {\n let foundFlavor = request.session.group_flavors.find(fItem => {\n return (fItem.flavor === targetGroupRec.flavor);\n });\n if (foundFlavor) {\n return {\n source: `Flavor of the Group I belong to that has the highest precedent = ${targetGroupRec.group_id}//${foundFlavor.flavor}`,\n authObj: foundFlavor.authorities\n };\n }\n else {\n cl({ 'Flavor for HighestPrecedentGroup not in Customization group_flavors': targetGroupRec.group_id });\n }\n }\n else {\n cl({ 'HighestPrecedentGroup has neither Authority nor Flavor': targetGroupRec.group_id });\n }\n }\n }\n else {\n cl({ 'None of these User groups in precendent list': request.userRec.groups });\n }\n };\n }\n else {\n cl('No precendent list in Customizations');\n }\n // set based on the user's group with the highest priority flavor\n if (request.session.group_flavors) {\n let lowFlavor = 999;\n let winningGroup;\n for (let g = 0; g < request.userRec.groups.length; g++) {\n if (lowFlavor > 0) {\n let userGroupRec = await getGroup(request.userRec.groups[g], request.session.client_id);\n if (userGroupRec) {\n if (!userGroupRec.flavor && userGroupRec.admin_class) {\n userGroupRec.flavor = userGroupRec.admin_class;\n }\n if (userGroupRec.flavor) {\n let foundFlavorIndex = request.session.group_flavors.findIndex(fItem => {\n return (fItem.flavor === userGroupRec.flavor);\n });\n if ((foundFlavorIndex > -1) && (foundFlavorIndex < lowFlavor)) {\n lowFlavor = foundFlavorIndex;\n winningGroup = request.userRec.groups[g];\n }\n }\n }\n }\n };\n if (lowFlavor < 999) {\n let foundFlavor = request.session.group_flavors[lowFlavor];\n return {\n source: `Highest precedent flavor associated with a Group I belong to = ${winningGroup}//${foundFlavor.flavor}`,\n authObj: foundFlavor.authorities\n };\n }\n else {\n cl({ 'None of these User groups have a flavor in the flavor list': request.userRec.groups });\n }\n }\n else {\n cl('No flavor list in Customizations');\n }\n // set based on the user's admin group\n let allGroupObject = await getAllGroups(request.userRec.person_id, request.session.client_id);\n let userAdminGroupRec = await getGroup(allGroupObject.selectedID, request.session.client_id);\n if (userAdminGroupRec) {\n if (userAdminGroupRec.authorities) {\n return {\n source: `Authority granted to my Admin group = ${userAdminGroupRec.group_id}`,\n authObj: userAdminGroupRec.authorities\n };\n }\n else if (userAdminGroupRec.flavor && request.session.group_flavors) {\n let foundFlavor = request.session.group_flavors.find(fItem => {\n return (fItem.flavor === userAdminGroupRec.flavor);\n });\n if (foundFlavor) {\n return {\n source: `Flavor of my Admin group = ${userAdminGroupRec.group_id}//${foundFlavor.flavor}`,\n authObj: foundFlavor.authorities\n };\n }\n }\n else {\n cl({ 'The Admin group has neither an authority nor a flavor': userAdminGroupRec.group_id });\n }\n }\n // set based on the default authority for this client\n if (request.session.default_authority) {\n return {\n source: 'Default authority for my client',\n authObj: request.session.default_authority\n };\n }\n else {\n cl({ 'There is no default authority for this client': request.session.client_id });\n }\n }\n // failed on every effort\n return {\n source: 'Failed to find any sources',\n authObj: { default: 0 }\n };\n}\n\nexport async function getGroup(pGroup_id, pClient_id) {\n if (!pClient_id) {\n if (pGroup_id && pGroup_id.includes('//')) { [pClient_id, pGroup_id] = pGroup_id.split('//'); }\n else if (session) {\n pClient_id = session.client_id;\n }\n else return {};\n }\n let cKey = `${pClient_id}//${pGroup_id}`;\n if (cKey in groupRecs) { return groupRecs[cKey]; }\n if (!pClient_id || !pGroup_id) { return {}; }\n let groupRec = await dbClient\n .get({\n Key: { client_id: pClient_id, group_id: pGroup_id },\n TableName: \"Groups\"\n })\n .promise()\n .catch(error => {\n cl({\n 'Error reading Groups': error,\n client_id: `<${pClient_id}>`,\n group_id: `<${pGroup_id}>`\n });\n });\n if (recordExists(groupRec)) {\n groupRecs[cKey] = groupRec.Item;\n return groupRec.Item;\n }\n return {};\n};\n\nexport async function getRole(pGroup, pPerson) {\n let pSession = await getSession(pPerson);\n if (!Array.isArray(pGroup)) {\n if ((('responsible_for' in pSession) && (pSession.responsible_for.some(g => g.split('~')[0].trim() === pGroup)))\n || (('groups_managed' in pSession) && (pSession.groups_managed.some(g => g.split('~')[0].trim() === pGroup)))) {\n return 'responsible';\n }\n else {\n let gRec = await getGroup(pGroup, pSession.client_id);\n if (gRec.admin_list && gRec.admin_list.includes(pPerson)) { return 'responsible'; }\n // am I responsible for this group's parent?\n if (gRec.belongs_to) {\n let parentRole = await getRole(gRec.belongs_to, pPerson);\n if (parentRole === 'responsible') { return 'responsible'; }\n }\n }\n if (await isMemberOf(pSession.client_id, pPerson, pGroup)) { return 'member'; }\n else { return 'non-member'; }\n }\n else {\n if (pGroup.every(async n => {\n return (await isMemberOf(pSession.client_id, pPerson, n));\n })) { return 'member'; }\n else { return 'non-member'; }\n }\n\n}\n\nexport function determineClass(gList, group_assignments) {\n let groupFlavor = {};\n let groupHierarchy = ['inactive', 'admin', 'staff', 'resident', 'student', 'camper', 'family', 'guest', 'vendor', 'other'];\n if (group_assignments) {\n Object.keys(group_assignments).forEach(t => {\n let groups = makeArray(group_assignments[t]);\n let foundAt = groupHierarchy.indexOf(t);\n if (foundAt < 0) { foundAt = groupHierarchy.length - 1; }\n groups.forEach(g => {\n if (!groupFlavor.hasOwnProperty(g)) { groupFlavor[g] = foundAt; }\n else { groupFlavor[g] = Math.min(foundAt, groupFlavor[g]); }\n });\n });\n }\n let member_of = groupHierarchy.length - 1;\n if (gList) {\n let gL = gList.length;\n for (let x = 0; x < gL; x++) {\n let g = gList[x];\n if (groupFlavor.hasOwnProperty(g)) {\n member_of = Math.min(member_of, groupFlavor[g]);\n }\n }\n }\n return groupHierarchy[member_of];\n}\n\nexport async function getMemberList(pGroups, pClient_id, options = {}) {\n // returns an array of peopleRecs that are members of the group(s) in pGroups\n // if you happen to include a person_id in the pGroups list, getMemberList returns those too\n let returnArray = [];\n let foundIDs = [];\n let foundGroups = {};\n // if options.exclude is TRUE, getMemberList respects directory_option === exclude \n // otherwise, people records are return without regard to the directory_option\n let checkExclude = false;\n let sortResults = false;\n let shortList = false;\n if (options) {\n if (options.sort || options.sortResults) {\n sortResults = options.sort || options.sortResults;\n }\n if (options.exclude || options.checkExclude) {\n checkExclude = options.exclude || options.checkExclude;\n }\n if (options.shortList || options.includeShortList) {\n shortList = options.shortList || options.includeShortList;\n }\n }\n let defaultClient = pClient_id || session.client_id;\n let gList = [];\n if (Array.isArray(pGroups)) {\n pGroups.forEach(grp => {\n grp = grp.replace('~group:', '');\n gList.push(...(grp.replace(/[[\\]]/g, '').split(/,|~/g)));\n });\n }\n else if (pGroups.includes('[')) {\n pGroups = pGroups.replace('~group:', '');\n gList = pGroups.replace(/[[\\]]/g, '').split(/,|~/g);\n }\n else { gList = [pGroups]; }\n if (gList.some(g => g.toLowerCase().includes('*all'))) { gList = ['*all']; }\n for (let g = 0; g < gList.length; g++) {\n let grp, client;\n if (gList[g].includes(':')) { grp = gList[g].split(':')[1].trim(); } // some arrays send '~group:group_id' in an element\n else if (gList[g].includes('~')) { grp = gList[g].split('~')[0].trim(); } // some arrays send 'group_id ~ group_name' in an element\n else { grp = gList[g].trim(); }\n if (grp.includes('//')) { [client, grp] = grp.split('//'); }\n else { client = defaultClient; }\n let qParm = {\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': client },\n TableName: \"People\",\n IndexName: \"client_id-index\",\n };\n if (grp !== '*all') {\n qParm.FilterExpression = 'contains(groups, :n) OR (person_id = :n)';\n qParm.ExpressionAttributeValues[':n'] = grp;\n\n }\n let gPeopleRecs = await dbClient\n .query(qParm)\n .promise()\n .catch(error => {\n cl({ 'Bad scan on People in getMemberList - caught error is': error });\n });\n if (recordExists(gPeopleRecs)) {\n for (let p = 0; p < gPeopleRecs.Items.length; p++) {\n let i = deepCopy(gPeopleRecs.Items[p]);\n if (!foundIDs.includes(i.person_id)) {\n foundIDs.push(i.person_id);\n if (!checkExclude || (i.directory_option !== 'exclude')) {\n if (!i.name) { i.name = { last: `Unknown ${i.person_id}` }; }\n if (!i.messaging) { i.messaging = { ava_only: `AVA` }; }\n i.display_name = AVAname(i);\n if (options.nameOnly) {\n returnArray.push({\n person_id: i.person_id,\n name: i.name,\n display_name: i.display_name\n });\n }\n else {\n if (options && options.withSession) {\n i.session = await getSession(i.person_id);\n }\n // if you belong to a group that has a parent, you belong to the parent\n if (i.groups) {\n for (let g = 0; g < i.groups.length; g++) {\n if (!foundGroups.hasOwnProperty(i.groups[g])) {\n foundGroups[i.groups[g]] = await getGroup(i.groups[g], client);\n }\n if ((foundGroups[i.groups[g]]?.belongs_to) && (!i.groups.includes(foundGroups[i.groups[g]].belongs_to))) {\n i.groups.push(foundGroups[i.groups[g]].belongs_to);\n }\n }\n }\n returnArray.push(i);\n }\n }\n }\n };\n }\n };\n if (sortResults) {\n returnArray.sort((a, b) => {\n if (a.name.last > b.name.last) { return 1; }\n else if (a.name.last < b.name.last) { return -1; }\n else if (a.name.first > b.name.first) { return 1; }\n else if (a.name.first < b.name.first) { return -1; }\n else { return 0; }\n });\n }\n let rObj = {\n foundIDs,\n 'peopleList': returnArray,\n 'groupList': gList\n };\n if (shortList) {\n rObj.shortList = returnArray.map(p => {\n let searchString = [...Object.values(p.name), p.search_data, p.location].join(' ');\n if (p.messaging) { searchString += Object.values(p.messaging).join(' '); }\n // list is of the form ::\n return `${p.name.last}, ${p.name.first}:${p.person_id}:${searchString}`;\n });\n }\n return rObj;\n}\n\nexport async function getGroupMembers(request = {}) {\n /*\n request...\n group_id - string: a single group to look for\n groupList - array: an array of groups to look for\n ignore_exclude - boolean: true = return even if (directory_option === 'exclude'); false or missing = respect directory option\n short - boolean: true = return only name, id, and search; false or missing = name, id, search, messaging, member_of\n ignore_unlisted - boolean: true = return messaging info, even if private is set\n with_responsible - boolean: true = add responsible_for\n return an array of objects \n */\n if (!request.groupList) {\n if (request.group_id) {\n request.groupList = [request.group_id];\n }\n else {\n return [];\n }\n }\n let response = [];\n let all_groups = (request.groupList.includes('*all'));\n if (!request.client_id) {\n request.client_id = session.client_id;\n }\n // retrieve every account in the client; \n let gPeopleRecs = await dbClient\n .query({\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': request.client_id },\n TableName: \"People\",\n IndexName: \"client_id-index\",\n })\n .promise()\n .catch(error => {\n cl({ 'Bad scan on People in getGroupMembers - caught error is': error });\n });\n if (recordExists(gPeopleRecs)) {\n gPeopleRecs.Items.forEach(personRec => {\n if (personRec.groups && [personRec.groups].flat().some(this_group => {\n return (all_groups || request.groupList.includes(this_group) || request.groupList.includes(personRec.person_id));\n })) {\n let this_response = {\n person_id: personRec.person_id,\n display_name: (`${personRec.name.first.trim()} ${personRec.name.last.trim()}`),\n first_name: personRec.name.first,\n last_name: personRec.name.last,\n search_data: personRec.search_data\n };\n if (!request.short) {\n this_response.member_of = deepCopy(personRec.groups);\n for (const mType in personRec.messaging) {\n if (!mType.includes('_private')) {\n if (request.ignore_unlisted || !personRec.messaging[`${mType}_private`]) {\n this_response[mType] = personRec.messaging[mType];\n }\n }\n }\n }\n response.push(this_response);\n }\n });\n if (request.withResponsible) {\n for (let rN = 0; rN < response.length; rN++) {\n let sessionRec = await getSession(response[rN].person_id);\n if (sessionRec?.responsible_for) {\n response[rN].responsible_for = makeArray(sessionRec.responsible_for);\n }\n }\n }\n let ascending = true;\n let sort_by = 'display_name';\n if (request.sort) {\n if (request.sort.sort_by) {\n sort_by = request.sort.sort_by;\n }\n if (request.sort.descending) {\n ascending = false;\n }\n }\n response.sort((a, b) => {\n if (a[sort_by] > b[sort_by]) {\n return (ascending ? 1 : -1);\n }\n else {\n return (ascending ? -1 : 1);\n }\n });\n return response;\n }\n}\n\nexport async function createNewGroup({ client_id, group_name, belongs_to, adminList, memberList, madeFromGroup }) {\n cl({ 'in createNewGroup with': { client_id, group_name, belongs_to, adminList, memberList } });\n if (!group_name) { return; }\n let newGroupID = 'group_' + group_name.replace(' ', '').substr(0, 5) + '_' + new Date().getTime();\n let newGroupRec = Object.assign({},\n madeFromGroup,\n {\n client_id: client_id,\n group_id: newGroupID,\n admin_list: makeArray(adminList),\n group_type: (madeFromGroup ? 'admin' : 'open'),\n belongs_to: (madeFromGroup ? madeFromGroup.group_id : null),\n name: group_name,\n common_activities: []\n },\n );\n await dbClient\n .put({\n Item: newGroupRec,\n TableName: \"Groups\"\n })\n .promise()\n .catch(error => {\n clt({ 'Bad put to Groups - caught error is': error });\n });\n for (const this_member of makeArray(memberList)) {\n await addMember(this_member, client_id, newGroupID);\n };\n for (const this_admin of makeArray(adminList)) {\n var sessionRec = await dbClient\n .get({\n Key: { 'session_id': this_admin },\n TableName: 'SessionsV2'\n })\n .promise()\n .catch(error => {\n clt({ 'Bad get on SessionsV2 - caught error is': error });\n });\n if (recordExists(sessionRec)) {\n if (!sessionRec.Item.groups_managed) {\n sessionRec.Item.groups_managed = [`${newGroupID} ~ ${group_name}`];\n }\n else {\n sessionRec.Item.groups_managed.push(`${newGroupID} ~ ${group_name}`);\n }\n }\n await dbClient\n .update({\n Key: { 'session_id': this_admin },\n UpdateExpression: \"set #n = :n\",\n ExpressionAttributeValues: {\n \":n\": sessionRec.Item.groups_managed\n },\n ExpressionAttributeNames: {\n \"#n\": \"groups_managed\"\n },\n TableName: 'SessionsV2'\n })\n .promise()\n .catch(error => {\n clt({ 'Bad update on SessionsV2 - caught error is': error });\n });\n }\n return newGroupID;\n}\n\nexport async function addMember(pPerson, pClient, pGroup) {\n let peopleRec = await getPerson(pPerson);\n if (peopleRec?.person_id) {\n let newGroupList = peopleRec.groups;\n newGroupList.push(pGroup);\n let clientGroups = (Array.isArray(peopleRec.clients) ? peopleRec.clients : [peopleRec.clients]);\n clientGroups.some((cG, ndx) => {\n if (cG.id === pClient) {\n clientGroups[ndx].groups = newGroupList;\n return true;\n }\n else { return false; }\n });\n await dbClient\n .update({\n Key: { person_id: pPerson },\n UpdateExpression: \"set groups = :g, clients = :cg\",\n ExpressionAttributeValues: {\n \":g\": newGroupList,\n \":cg\": clientGroups\n },\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n clt({ 'Bad update to People - caught error is': error });\n });\n }\n let peopleGroupRec = {\n client_group_id: pClient + '~' + pGroup,\n display_name: (peopleRec?.person_id ? `${peopleRec.name.last}, ${peopleRec.name.first}` : `${pPerson}, Unknown Account`),\n person_id: pPerson,\n roles: [\"patient\"]\n };\n await dbClient\n .put({\n Item: peopleGroupRec,\n TableName: \"PeopleGroups\"\n })\n .promise()\n .catch(error => {\n clt({ 'Bad put to PeopleGroups - caught error is': error });\n });\n}\n\nexport async function removeMember(pPerson, pClient, pGroup) {\n let peopleRec = await getPerson(pPerson);\n if (peopleRec?.person_id) {\n let newGroupList = peopleRec.groups.filter(g => {\n return !(g === pGroup);\n });\n let clientGroups = (Array.isArray(peopleRec.clients) ? peopleRec.clients : [peopleRec.clients]);\n clientGroups.some((cG, ndx) => {\n if (cG.id === pClient) {\n clientGroups[ndx].groups = newGroupList;\n return true;\n }\n else { return false; }\n });\n await dbClient\n .update({\n Key: { person_id: pPerson },\n UpdateExpression: \"set groups = :g, clients = :cg\",\n ExpressionAttributeValues: {\n \":g\": newGroupList,\n \":cg\": clientGroups\n },\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n clt({ 'Bad update to People - caught error is': error });\n });\n }\n}\n\nexport async function addAdministrator(pPerson, pGroup) {\n let sessionRec = await getSession(pPerson);\n if (sessionRec?.session_id) {\n let rArray = makeArray(sessionRec.responsible_for);\n if (!rArray.includes(pGroup)) {\n rArray.push(pGroup);\n await dbClient\n .update({\n Key: { session_id: pPerson },\n UpdateExpression: \"set responsible_for = :r\",\n ExpressionAttributeValues: {\n \":r\": rArray\n },\n TableName: \"SessionsV2\",\n })\n .promise()\n .catch(error => {\n clt({ 'Bad update to Sessions - caught error is': error });\n });\n }\n }\n}\n\nexport async function removeAdministrator(pPerson, pGroup) {\n let sessionRec = await getSession(pPerson);\n if (sessionRec?.session_id) {\n let rArray = makeArray(sessionRec.responsible_for);\n let rIndex = rArray.indexOf(pGroup);\n if (rIndex > -1) {\n rArray.splice(rIndex, 1);\n await dbClient\n .update({\n Key: { session_id: pPerson },\n UpdateExpression: \"set responsible_for = :r\",\n ExpressionAttributeValues: {\n \":r\": rArray\n },\n TableName: \"SessionsV2\",\n })\n .promise()\n .catch(error => {\n clt({ 'Bad update to Sessions - caught error is': error });\n });\n }\n }\n}\n\nexport async function prepareTargets(pPerson, pClient_id, options) {\n // make a list of all accounts that you are allowed to proxy into\n // You will see options and authorities based on your OWN user ID (session.user_id),\n // but will be making requests on behalf of whoever you proxy into...\n if (targetPerson === pPerson) {\n return { targetArray, targetObj };\n }\n let includeGroups = false;\n let includePeople = true;\n if (options) {\n if (options.includeGroups) { includeGroups = options.includeGroups; };\n if (options.includePeople) { includePeople = options.includePeople; };\n }\n if (!pClient_id) {\n let peopleRec = await getPerson(pPerson);\n pClient_id = peopleRec.client_id;\n }\n let responsibleList = []; // legacy format\n let responsibleObj = {};\n let groupObj = await getGroupsBelongTo(pClient_id, pPerson);\n let allGroupArr = Object.keys(groupObj);\n if (allGroupArr.length === 0) { return []; }\n if (includeGroups) { // first, add a list of groups that you are responsible for (if requested)\n allGroupArr.forEach(g => {\n if (groupObj[g].role === 'responsible') {\n responsibleList.push(`${groupObj[g].group_name}:GRP//${profile.client_id}/${groupObj[g].group_id}`);\n let gKey = `GRP//${profile.client_id}/${groupObj[g].group_id}`;\n responsibleObj[gKey] = {\n group_id: groupObj[g].group_id,\n type: 'group',\n client_id: profile.client_id,\n name: groupObj[g].group_name,\n search: `${groupObj[g].group_name}`\n };\n }\n });\n }\n if (includePeople) { // then, add any individual in a group that you are responsible for OR are a member of\n let responseObj = await getMemberList(allGroupArr, profile.client_id);\n let allPeopleArr = responseObj.peopleList;\n if (allPeopleArr.length > 0) {\n allPeopleArr.forEach(p => {\n responsibleList.push(((`${p.name?.last}, ${p.name?.first}:${p.person_id}:${p.search_data} ${((typeof p.messaging) === 'object') ? JSON.stringify(p.messaging) : ''}`).trim()));\n responsibleObj[p.person_id] = {\n person_id: p.person_id,\n type: 'person',\n name: p.name,\n search: p.search_data,\n messaging: p.messaging\n };\n });\n }\n }\n return { responsibleList, responsibleObj };\n}\n\nexport async function getGroupHierarchy(pClient_id, options) {\n /* \n if options.sort is TRUE, getGroupHierarchy returns an array with [ {id: , belongs_to: , level: , name: , selectable: }, {}, ... ] sorted by name within level\n otherwise, getGroupHierarchy returns an object as {'__TOP__': { firstChild-group_ID: { grandchild-group_ID: { great_grandchild-group_ID: {...}}}, secondChild-group_ID: {...}, ...} \n options can be as follows (all optional and treated as FALSE is missing)\n {\n sort: true, return the names sorted at each level of the hierarchy \n }\n */\n if (!pClient_id) {\n if (session) { pClient_id = session.client_id; }\n else return {};\n }\n let qParm = {\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': pClient_id, ':a': 'admin', ':p': 'parent' },\n FilterExpression: 'group_type IN (:a, :p)',\n TableName: \"Groups\"\n };\n let groupRec = await dbClient\n .query(qParm)\n .promise()\n .catch(error => {\n cl({\n 'Error reading Groups': error,\n client_id: `<${pClient_id}>`\n });\n });\n if (!recordExists(groupRec)) { return {}; }\n let hierarchy = {}; // keys are '__TOP__' and any group that has children; value is an object whose keys are the clidren of this entry's key\n let customRec = await getCustomizations('client_name', pClient_id);\n let nameObj = { '__TOP__': customRec.customization_value }; // this object delivers the groups name for each nameObj[group_id]\n let messagingObj = { '__TOP__': [] };\n let parentObj = { '__TOP__': '' }; // this object tells who the parent is for each parentObj[group_id]\n let classObj = { '__TOP__': 'other' };\n let responsibleObj = { '__TOP__': [] };\n\n // first pass - all admin level groups are added to their parent\n for (let g = 0; g < groupRec.Items.length; g++) {\n if (!groupRec.Items[g].belongs_to) { groupRec.Items[g].belongs_to = '__TOP__'; }\n let thisGroup = groupRec.Items[g];\n if ((thisGroup.group_type === 'admin') || (thisGroup.group_type === 'parent')) {\n if (!hierarchy.hasOwnProperty(thisGroup.belongs_to)) {\n hierarchy[thisGroup.belongs_to] = {};\n }\n hierarchy[thisGroup.belongs_to][thisGroup.group_id] = {};\n nameObj[thisGroup.group_id] = thisGroup.name;\n messagingObj[thisGroup.group_id] = [];\n if (thisGroup.common_activities && (thisGroup.common_activities.length > 0)) {\n thisGroup.common_activities.forEach(activity => {\n if (typeof (activity) === 'string') {\n let matchResult = activity.match(/(.+)~\\[default={recipientID:(.+),recipientName:(.+)\\}\\]~\\[title=(.+)\\]/);\n if (matchResult) {\n let [str, inst, pers, pName, pText] = matchResult;\n console.log(str);\n if (inst === 'form.make_message') {\n messagingObj[thisGroup.group_id].push({\n personList: [pers],\n personNames: [pName],\n objText: pText\n });\n }\n }\n }\n else if ((activity.activity_code === 'form.make_message') && (activity.default && activity.default.recipientID)) {\n messagingObj[thisGroup.group_id].push({\n personList: [activity.default.recipientID].flat(),\n personNames: [activity.default.recipientName || new Array([activity.default.recipientID].flat().length)].flat(),\n objText: activity.title\n });\n }\n });\n }\n parentObj[thisGroup.group_id] = thisGroup.belongs_to;\n responsibleObj[thisGroup.group_id] = thisGroup.admin_list;\n classObj[thisGroup.group_id] = thisGroup.admin_class || 'other';\n let cKey = `${pClient_id}//${thisGroup.group_id}`;\n groupRecs[cKey] = thisGroup;\n }\n }\n // hierarchy now contains every group with children\n // we've passed through every record returned by the query above (get all 'parent' and 'admin' records in the client)\n // since we ignore parents and delete admins, what's left behind is an array of all the parent records\n // loop through these (but no more than 20 times as a safety valve against a run-away loop)\n let count = 0;\n let thisGroup;\n let withChildren;\n do {\n count++;\n for (let g = 0; g < groupRec.Items.length; g++) {\n thisGroup = groupRec.Items[g];\n if (hierarchy.hasOwnProperty(thisGroup.group_id)) {\n // if this parent was identified when building the \"admin\" loop above, \n // it will already have a key in the hierarchy\n withChildren = Object.assign({}, hierarchy[thisGroup.group_id]);\n delete hierarchy[thisGroup.group_id];\n // does my parent already exist in the tree somewhere?\n let [success, result] = recursiveSearch(hierarchy);\n if (success) {\n hierarchy = result;\n }\n else {\n hierarchy[thisGroup.belongs_to] = {};\n hierarchy[thisGroup.belongs_to][thisGroup.group_id] = withChildren;\n };\n nameObj[thisGroup.group_id] = thisGroup.name;\n messagingObj[thisGroup.group_id] = [];\n if (thisGroup.common_activities && (thisGroup.common_activities.length > 0)) {\n // eslint-disable-next-line\n thisGroup.common_activities.forEach(activity => {\n if (typeof (activity) === 'string') {\n let matchResult = activity.match(/(.+)~\\[default={recipientID:(.+),recipientName:(.+)\\}\\]~\\[title=(.+)\\]/);\n if (matchResult) {\n let [str, inst, pers, pName, pText] = matchResult;\n console.log(str);\n if (inst === 'form.make_message') {\n messagingObj[thisGroup.group_id].push({\n personList: [pers],\n personNames: [pName],\n objText: titleCase(pText.toLowerCase().replace('send a message to', '')).trim()\n });\n }\n }\n }\n else if ((activity.activity_code === 'form.make_message') && (activity.default && activity.default.recipientID)) {\n messagingObj[thisGroup.group_id].push({\n personList: [activity.default.recipientID].flat(),\n personNames: [activity.default.recipientName || new Array([activity.default.recipientID].flat().length)].flat(),\n objText: activity.title\n });\n }\n else if ((activity.activity_code === 'form.make_message') && (activity.default && activity.default.recipientID)) {\n messagingObj[thisGroup.group_id].push({\n personList: [activity.default.recipientID].flat(),\n personNames: [activity.default.recipientName || new Array([activity.default.recipientID].flat().length)].flat(),\n objText: titleCase(activity.title.toLowerCase().replace('send a message to', '')).trim()\n });\n }\n });\n }\n parentObj[thisGroup.group_id] = thisGroup.belongs_to;\n classObj[thisGroup.group_id] = thisGroup.admin_class || 'other';\n responsibleObj[thisGroup.group_id] = thisGroup.admin_list;\n groupRec.Items.splice(g, 1);\n g--;\n }\n }\n } while ((groupRec.Items.length > 0) && (count < 20));\n\n // build parent_of object\n let parent_of = {};\n for (let top_level in hierarchy) {\n addChild(top_level, hierarchy[top_level]);\n }\n function addChild(parent, target) {\n for (let my_child in target) {\n if (!parent_of.hasOwnProperty(parent)) { parent_of[parent] = [my_child]; }\n else { parent_of[parent].push(my_child); }\n let grandchildren = addChild(my_child, target[my_child]);\n if (grandchildren) { parent_of[parent].push(...grandchildren); };\n }\n return parent_of[parent];\n }\n\n // manipulate the output:\n if (!options) {\n return ({\n preferred_recipients: messagingObj,\n group_names: nameObj, group_tree: hierarchy, hierarchy, parent_of\n });\n }\n if (options.sort) {\n return ({\n group_names: nameObj,\n preferred_recipients: messagingObj,\n group_tree: hierarchy,\n hierarchy: recursiveSort(hierarchy, [], 0),\n parent_of\n });\n }\n return ({\n preferred_recipients: messagingObj,\n group_names: nameObj, group_tree: hierarchy, hierarchy, parent_of\n });\n\n function recursiveSearch(searchObj) {\n let oKeys = Object.keys(searchObj);\n if (oKeys.length === 0) { return [false, {}]; }\n if (oKeys.includes(thisGroup.belongs_to)) { // parent found\n searchObj[thisGroup.belongs_to][thisGroup.group_id] = withChildren;\n return [true, searchObj];\n }\n else {\n for (let g = 0; g < oKeys.length; g++) {\n let [success, result] = recursiveSearch(searchObj[oKeys[g]]);\n if (success) {\n searchObj[oKeys[g]] = result;\n return [true, searchObj];\n }\n }\n return [false, {}];\n }\n }\n\n function recursiveSort(searchObj, response, level) {\n if (Object.keys(searchObj).length === 0) { return []; }\n let oKeys = Object.keys(searchObj).sort((a, b) => {\n if (nameObj[a] > nameObj[b]) { return 1; }\n else { return -1; }\n });\n for (let g = 0; g < oKeys.length; g++) {\n let selectable = (Object.keys(searchObj[oKeys[g]]).length === 0);\n response.push({\n id: oKeys[g],\n level,\n belongs_to: parentObj[oKeys[g]],\n name: nameObj[oKeys[g]],\n selectable,\n admin_class: classObj[oKeys[g]],\n admin_list: responsibleObj[oKeys[g]]\n });\n if (!selectable) { response = recursiveSort(searchObj[oKeys[g]], response, level + 1); }\n }\n return response;\n }\n}\n\nexport async function getPublicGroupList(pClient_id, person_id, options) {\n if (!pClient_id) {\n if (session) { pClient_id = session.client_id; }\n else return {};\n }\n let qParm = {\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': pClient_id, ':a': 'open', ':p': 'public' },\n FilterExpression: 'group_type IN (:a, :p)',\n TableName: \"Groups\"\n };\n let groupRec = await dbClient\n .query(qParm)\n .promise()\n .catch(error => {\n cl({\n 'Error reading Groups': error,\n client_id: `<${pClient_id}>`\n });\n });\n if (!recordExists(groupRec)) { return {}; }\n groupRec.Items.sort((a, b) => {\n if (a.name > b.name) { return 1; }\n else { return -1; }\n });\n let response = {};\n for (let g = 0; g < groupRec.Items.length; g++) {\n let thisGroup = groupRec.Items[g];\n let role = await getRole(thisGroup.group_id, person_id);\n response[thisGroup.group_id] = {\n group_name: thisGroup.name,\n group_id: thisGroup.group_id,\n role\n };\n }\n return response;\n}\n\nexport async function getPrivateGroupList(pClient_id, person_id, options) {\n if (!pClient_id) {\n if (session) { pClient_id = session.client_id; }\n else return {};\n }\n let qParm = {\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': pClient_id, ':p': 'private' },\n FilterExpression: 'group_type = :p',\n TableName: \"Groups\"\n };\n let groupRec = await dbClient\n .query(qParm)\n .promise()\n .catch(error => {\n cl({\n 'Error reading Groups': error,\n client_id: `<${pClient_id}>`\n });\n });\n if (!recordExists(groupRec)) { return {}; }\n groupRec.Items.sort((a, b) => {\n if (a.name > b.name) { return 1; }\n else { return -1; }\n });\n let response = {};\n for (let g = 0; g < groupRec.Items.length; g++) {\n let thisGroup = groupRec.Items[g];\n let role = await getRole(thisGroup.group_id, person_id);\n response[thisGroup.group_id] = {\n group_name: thisGroup.name,\n group_id: thisGroup.group_id,\n role\n };\n }\n return response;\n}\n\nexport async function getAllGroups(person_id, client_id) {\n /*\n returns the single admin group that this person_id belongs to in the client_id\n selectedID = admin group that this person_id belongs to in the client_id\n AND three objects containing different types of groups:\n adminHierarchy: [], \n publicGroups: {}, \n privateGroups: {}\n */\n\n let responseData = {};\n let profile = await getPerson(person_id);\n let session = await getSession(person_id);\n if (!client_id) {\n if (session) { client_id = session.client_id; }\n if (!client_id) { return { adminHierarchy: [], publicGroups: {}, privateGroups: {} }; }\n }\n let gHResponse = await getGroupHierarchy(client_id, { sort: true });\n responseData.adminHierarchy = gHResponse.hierarchy;\n responseData.groupTree = gHResponse.group_tree;\n responseData.preferred_recipients = gHResponse.preferred_recipients;\n responseData.groupNames = gHResponse.group_names;\n responseData.parent_of = gHResponse.parent_of; // for every group, this lists all its descendants (children, grandchildren, etc)\n let gXRef = {};\n responseData.adminHierarchy.forEach((a, x) => {\n gXRef[a.id] = a;\n if (a.selectable && profile?.groups?.includes(a.id)) {\n responseData.selectedID = a.id;\n }\n });\n // belongs_to object list every group you belong to\n let classHierarchy = ['other', 'vendor', 'vendors', 'guest', 'guests', 'family', 'families', 'camper', 'campers', 'student', 'students', 'resident', 'residents', 'staff', 'admin', 'support', 'master'];\n let classResult = ['other', 'vendor', 'vendor', 'guest', 'guest', 'family', 'family', 'camper', 'camper', 'student', 'student', 'resident', 'resident', 'staff', 'admin', 'support', 'master'];\n let classLevel = classHierarchy.findIndex(c => { return c === (profile.admin_class || 'other'); });\n let belongs_to = {};\n if (profile.groups) {\n for (let this_group of profile.groups) {\n if (gXRef.hasOwnProperty(this_group)) {\n belongs_to[this_group] = {}; // you belong to every group listed in your people record \"groups\" key\n // you also belong to the parent of any group that you belong to\n // any group that is a parent and has this group in its descendants list is a group you belong to\n for (let parent_group in responseData.parent_of) {\n if (responseData.parent_of[parent_group].includes(this_group)) {\n belongs_to[this_group] = {};\n }\n }\n }\n }\n if (session.responsible_for) {\n for (let this_respFor of session.responsible_for) {\n let checkGroup = this_respFor.trim();\n if (belongs_to.hasOwnProperty(checkGroup)) {\n belongs_to[checkGroup].role = 'responsible';\n }\n }\n }\n if (session.groups_managed) {\n for (let this_managed of session.groups_managed) {\n let checkGroup = this_managed.split('~')[0].trim();\n if (belongs_to.hasOwnProperty(checkGroup)) {\n belongs_to[checkGroup].role = 'responsible';\n }\n }\n }\n for (let this_group in belongs_to) {\n console.log(this_group);\n if (gXRef[this_group].admin_list.includes(person_id)) {\n belongs_to[this_group].role = 'responsible';\n }\n if (belongs_to[this_group].role === 'responsible') { // if I am responsible for a group\n if (responseData.parent_of.hasOwnProperty(this_group)) { // ...and that group is a parent\n for (let child of responseData.parent_of[this_group]) {\n if (belongs_to.hasOwnProperty(child)) { // ... and a child of my Group is also in my belongs_to list\n belongs_to[child].role = 'responsible'; // then I am responsible for that group too\n }\n }\n }\n }\n }\n console.log('check here');\n for (let this_group in belongs_to) {\n if (gXRef[this_group].admin_class) {\n classLevel = Math.max(classLevel, classHierarchy.findIndex(c => { return c === gXRef[this_group].admin_class; }));\n }\n belongs_to[this_group].group_name = gXRef[this_group].group_name;\n if (belongs_to[this_group].role !== 'responsible') { // if I belong to a group that I am NOT responsible for\n belongs_to[this_group].role = 'member'; // then I am a member of that group\n }\n }\n }\n\n responseData.person_admin_class = classResult[classLevel];\n responseData.publicGroups = await getPublicGroupList(client_id, person_id);\n // responseData.privateGroups = await getGroupsBelongTo(client_id, person_id, { sort: true });\n responseData.privateGroups = await getPrivateGroupList(client_id, person_id);\n responseData.adminHierarchy.forEach(a => { delete responseData.privateGroups[a.id]; });\n for (let gID in responseData.publicGroups) { delete responseData.privateGroups[gID]; }\n return responseData;\n};\n","import { getPerson, makeName } from '../util/AVAPeople';\nimport { makeDate, isDate } from '../util/AVADateTime';\nimport { getOccurenceList } from '../util/AVACalendars';\nimport { Lambda } from 'aws-sdk';\n\n// NOTES -\n// regex to split at the first instance of a character only (% used as example to split on): is .split(/%(.*)/)\n\nconst AWS = require('aws-sdk');\nlet iconObj = {};\n\nconst sak = () => {\n let keyList = [\n \"nMJ$NnV$cA5-oPTC-j,%If?)UhFnl))hH$$^QGs>SkIAR2OYl`n3;Ap&(cHd}/pKM{ul^KaHat{%hyb^@@o+j(EftN9K768dM,O[\",\n \"[?oRnyvdNc:=4b5-Sy^==`35W41%A}|x2}b_}S#'%pO>-(Op6FjtrZDb:&[j(:y?53M,FTI{gIB?,7S*9DAW2G)Ibq4H[(WFtqo=\",\n \"-RKC(0^vR[u8]z*,Q`M98d?$#6b$;c<`<<1XOseJX&/BT$soC;ZT~n4FEF.d5,?H1#UC(c=x4K8MQkNFg$?tfU;&a#ssocLPMsx]\",\n \"8?7'@=wJ$3LF27=%2E_{1q?U7/Wdd424%0a-Y41^&b/dY(=BO(7ddn1-QgJrT|![&uKXEH5p-P'[Nh#R%I>qbpVpU]nmLdhWcXE>\",\n \"h5]$AK2akK$VkrPM~ynClNK_624AQ26xQG{z-Q]{tu*|vIf(26{G}oi9qls``Fe-WJwVhniEuQG:?Z%w:7Zjl)R7.w_mzq|hu$?5\",\n \"}QE*tYyZ]%5{L0{#KjiPJ-fyfh(:[3?.Uh^V/v{KSYETYeToF63C0;AQYhb,Kq-?N,C5]d{81{yp8Q]RP(y+0%\"\n ];\n let id2 = '';\n let indexer = '4042553918914687589290481423614042529443';\n for (let i = 0; i < 30; i++) {\n let index = Number(indexer.slice(i, i + 1));\n if (index < 6) {\n let pos = Number(indexer.slice(i + 1, i + 3));\n let len = Number(indexer.slice(i + 3, i + 4));\n id2 += keyList[index].slice(pos, pos + len);\n }\n }\n return [id2.slice(0, 20), id2.slice(20, 60)];\n};\n\nexport const dbClient = new AWS.DynamoDB.DocumentClient({\n apiVersion: '2012-08-10',\n region: \"us-east-1\",\n accessKeyId: sak()[0],\n secretAccessKey: sak()[1]\n});\n\nexport const CognitoClient = new AWS.CognitoIdentityServiceProvider({\n region: \"us-east-1\"\n});\n\nexport const s3 = new AWS.S3({\n accessKeyId: sak()[0],\n secretAccessKey: sak()[1]\n});\n\nexport const elastictranscoder = new AWS.ElasticTranscoder({\n accessKeyId: sak()[0],\n secretAccessKey: sak()[1],\n region: \"us-east-1\"\n});\n\nconst StepFunctions = require('aws-sdk/clients/stepfunctions');\nexport const stepFunctions = new StepFunctions({\n accessKeyId: sak()[0],\n secretAccessKey: sak()[1],\n region: \"us-east-1\"\n});\n\nexport const lambda = new Lambda({\n region: 'us-east-1',\n accessKeyId: sak()[0],\n secretAccessKey: sak()[1],\n});\n\nexport const cloudfront = new AWS.CloudFront({\n region: \"us-east-1\",\n accessKeyId: sak()[0],\n secretAccessKey: sak()[1],\n});\n\nexport function recordExists(recordId) {\n if (!recordId) { return false; }\n if (recordId.hasOwnProperty('Count')) { return (recordId.Count > 0); }\n else { return ((recordId.hasOwnProperty(\"Item\") || recordId.hasOwnProperty(\"Items\"))); }\n}\n\nexport async function getLocalWeather(client_weather = {\n \"place_name\": \"AVA HQ\",\n \"nws_x\": 21,\n \"nws_y\": 10,\n \"nws_office\": \"MRX\"\n}) {\n let weather = await restAPI({\n hostname: 'api.weather.gov',\n path: `/gridpoints/${client_weather.nws_office}/${client_weather.nws_x},${client_weather.nws_y}/forecast`,\n method: 'GET',\n headers: {\n \"User-Agent\": \"(AVASeniorConnect.com, rsteele@avaseniorconnect.com)\"\n }\n }, '');\n if (!weather || weather.status || !weather.properties) {\n return `Forecast for ${client_weather.place_name} not available at this time`;\n }\n else {\n let periodWords = weather.properties.periods[0].name;\n if (periodWords.startsWith('this') || periodWords.startsWith('today')) {\n periodWords = `t${periodWords.slice(1)}`;\n }\n return `Forecast for ${client_weather.place_name} ${periodWords} - ${weather.properties.periods[0].detailedForecast}`;\n };\n}\n\nexport async function getMarqueeMessage(client_id, options = {}) {\n let response = [];\n let urgentMessage;\n if (options.client_weather) {\n let weather = await getLocalWeather(options.client_weather);\n if (weather) {\n response.push({\n style: null,\n message: weather\n });\n }\n }\n let now = new Date().getTime();\n let mRecs = await dbClient\n .query({\n KeyConditionExpression: 'client_id = :c and end_time > :now',\n ExpressionAttributeValues: {\n ':c': client_id,\n ':now': now\n },\n TableName: \"MarqueeMessages\",\n IndexName: \"end_time-index\"\n })\n .promise()\n .catch(error => {\n clt(`Error reading MarqueeMessages`, error);\n });\n if (recordExists(mRecs)) {\n let selectedMRecs = mRecs.Items.filter(mRec => {\n if (!options.future_OK && (mRec.start_date > now)) {\n return false;\n }\n if (!options.belongsTo) {\n return true;\n }\n if (mRec.groups && (mRec.groups.length > 0)) {\n return (mRec.groups.some((allowedGroup) => {\n return (options.belongsTo.hasOwnProperty(allowedGroup));\n }));\n }\n return true;\n });\n if (options.rawData) {\n return selectedMRecs;\n }\n selectedMRecs.forEach(sRec => {\n response.push({\n style: sRec.style,\n message: sRec.message,\n criticalMessage: sRec.criticalMessage,\n priorityMessage: sRec.priorityMessage\n });\n if ((sRec.criticalMessage) || (sRec.priorityMessage)) {\n urgentMessage = sRec.message;\n }\n });\n }\n if (urgentMessage) {\n sessionStorage.setItem('marquee_message', JSON.stringify([urgentMessage]));\n }\n else {\n sessionStorage.setItem('marquee_message', JSON.stringify(response));\n }\n return response;\n}\n\nexport function deepCopy(pValue) {\n if (!pValue) {\n return pValue;\n }\n else if (Array.isArray(pValue)) {\n var count = pValue.length;\n var arr = new Array(count);\n for (var i = 0; i < count; i++) {\n arr[i] = deepCopy(pValue[i]);\n }\n return arr;\n }\n else if (isDate(pValue)) {\n return pValue;\n }\n else if (typeof pValue === 'object') {\n var obj = {};\n for (var prop in pValue) {\n obj[prop] = deepCopy(pValue[prop]);\n }\n return obj;\n }\n else {\n return pValue;\n }\n}\n\nexport function listFromArray(pArray, options) {\n if (!Array.isArray(pArray)) {\n if (!pArray || (pArray.trim() === '')) { return 'None'; }\n return pArray;\n }\n let inArray = pArray;\n if (options && options.ignoreBlank) {\n inArray = pArray.filter(e => { return (e.trim() !== ''); });\n }\n let makeList$ = '';\n let link = '';\n let nextToLast = inArray.length - 2;\n let threeOrMore = (inArray.length > 2);\n if (options && options.max && (inArray.length > options.max.length)) {\n return `${inArray.length} ${options.max.words || 'selections'}`\n } \n inArray.forEach((s, x) => {\n let linkWord = 'and';\n if (options) {\n if (options.sentenceCase) { s = sentenceCase(s); }\n if (options.or) { linkWord = 'or' }\n }\n makeList$ += link + s;\n if (threeOrMore) { link = ', '; }\n if (x === nextToLast) (link += (!threeOrMore ? ' ' : '') + `${linkWord} `);\n });\n return makeList$;\n}\n\nexport async function getCustomizations(pKey, pClient) {\n if (!pKey || !pClient) { return false; }\n if (pKey.toLowerCase() === '*all') {\n let customizations = {};\n let cRecs = await dbClient\n .query({\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: {\n ':c': pClient,\n },\n TableName: \"Customizations\"\n })\n .promise()\n .catch(error => {\n clt(`Error reading Customizations`, error);\n });\n if (recordExists(cRecs)) {\n cRecs.Items.forEach(cRec => {\n customizations[cRec.custom_key] = cRec.customization_value || cRec.icon;\n });\n }\n return customizations;\n }\n else {\n let cRec = await dbClient\n .get({\n Key: {\n client_id: pClient,\n custom_key: pKey\n },\n TableName: \"Customizations\",\n })\n .promise()\n .catch(error => {\n cl(`Caught error reading Customizations.Error is: ${error} \n with client = ${pClient} and custom_key = ${pKey} `);\n });\n if (recordExists(cRec)) { return cRec.Item; }\n else { return false; }\n }\n}\n\nexport function makeString(inP, pNum = 0, pLink = ',') { // will force whatever you send it to return a string value\n let returnValue;\n if (typeof inP === 'boolean') { returnValue = (inP ? 'true' : 'false'); }\n else if (!inP) { returnValue = ' '; }\n else if (isObject(inP)) { returnValue = JSON.stringify(inP); }\n else if (!Array.isArray(inP)) { returnValue = inP.trim(); }\n else { // array - return up to pNum entries (or all entries if pNum = 0)\n let lim = ((pNum > 0) ? Math.min(pNum, inP.length) : inP.length);\n let return$ = '';\n for (let a = 0; a < lim; a++) {\n return$ += ((a > 0) ? pLink : '') + makeString(inP[a]);\n }\n returnValue = return$;\n }\n if (returnValue) { return returnValue; }\n else { return ' '; }\n}\n\nexport function stringToColor(string) {\n let hash = 0;\n let i;\n /* eslint-disable no-bitwise */\n for (i = 0; i < string.length; i += 1) {\n hash = string.charCodeAt(i) + ((hash << 5) - hash);\n }\n let color = '#e';\n for (i = 0; i < 3; i += 1) {\n const value = (hash >> (i * 8)) & 0xff;\n color += `00${value.toString(16)}`.slice(-2);\n }\n /* eslint-enable no-bitwise */\n return color.slice(0, 7);\n}\n\nexport function cl() {\n for (let v = 0; v < arguments.length; v++) {\n let value = arguments[v];\n if ((typeof (value) === 'object') && (value.constructor.name === 'Object')) {\n console.log(JSON.stringify(value));\n }\n else { console.log(value); }\n }\n};\n\nexport function clt() {\n for (let v = 0; v < arguments.length; v++) {\n let value = arguments[v];\n if (typeof (value) === 'object') { console.log(JSON.stringify(value)); }\n else { console.log({ value }); }\n };\n};\n\nexport function sentenceCase(pString) {\n if (!pString) { return ''; }\n if (typeof (pString) === 'object') { return JSON.stringify(pString); }\n let words = pString.split(/\\s+/);\n let returnString = '';\n words.forEach((w, x) => {\n if (w.toLowerCase() === 'ava') {\n returnString += 'AVA';\n }\n if (w.toLowerCase() === 'bbq') {\n returnString += 'BBQ';\n }\n else if (x === 0) {\n returnString += `${w.slice(0, 1).toUpperCase()}${w.slice(1).toLowerCase()}`;\n }\n else {\n returnString += w;\n }\n returnString += ' ';\n });\n return returnString.trim();\n}\n\nexport function makeArray(input, delimiter = null) {\n let response = [];\n if (!input) { return []; };\n if (Array.isArray(input)) {\n response.push(...input);\n }\n else if (typeof input === 'object') {\n // response = Object.keys(input);\n response.push(input);\n }\n else if (typeof input === 'number') {\n response.push(input);\n }\n else if ((input.charAt(0) === '{') && (input.charAt(input.length - 1) === '}')) {\n try {\n let rObj = JSON.parse(input);\n Object.keys(rObj).forEach(o => {\n response.push(`${o}=${rObj[o]}`);\n });\n }\n catch {\n let outObj = {};\n let keyValuePairs = input.replace(/[{}]/g, '').split(',');\n keyValuePairs.forEach(pair => {\n let [key, value] = pair.split(':');\n outObj[key.trim()] = value.trim();\n });\n response.push(outObj);\n }\n }\n else if (input.charAt(0) === '[') {\n response = input.replace(/[[\\]]/, '').split(',');\n }\n else if (delimiter) {\n response = input.split(delimiter).map(e => { return e.trim(); });\n }\n else { response.push(input); }\n return response;\n}\n\nexport function makeCustomArray(input, options = {}) {\n let response = [];\n if (!input) { return []; };\n let { delimiter, toLowerCase, notAlone } = options;\n if ((typeof (input) === 'string')) {\n if (toLowerCase) {\n return (notAlone ? input.toLowerCase() : [input.toLowerCase()]);\n }\n else {\n return (notAlone ? input : [input]);\n }\n }\n else if (Array.isArray(input)) {\n for (const this_item of input) {\n response.push(makeArray(this_item, Object.assign({}, options, { notAlone: true })));\n }\n }\n else if (typeof input === 'object') {\n for (const this_key in input) {\n response.push({ [(toLowerCase ? this_key.toLowerCase() : this_key)]: makeArray(input[this_key], Object.assign({}, options, { notAlone: true })) });\n }\n }\n else if (typeof input === 'number') {\n response.push(input);\n }\n else if ((input.charAt(0) === '{') && (input.charAt(input.length - 1) === '}')) {\n try {\n let rObj = JSON.parse(input);\n Object.keys(rObj).forEach(o => {\n response.push(`${o}=${rObj[o]}`);\n });\n }\n catch {\n let outObj = {};\n let keyValuePairs = input.replace(/[{}]/g, '').split(',');\n keyValuePairs.forEach(pair => {\n let [key, value] = pair.split(':');\n outObj[key.trim()] = value.trim();\n });\n response.push(outObj);\n }\n }\n else if (input.charAt(0) === '[') {\n response = input.replace(/[[\\]]/, '').split(',');\n }\n else if (delimiter) {\n response = input.split(delimiter).map(e => { return e.trim(); });\n }\n else { response.push(input); }\n return response;\n}\n\nexport function makeObject(input) {\n if (isObject(input)) {\n return input;\n }\n else {\n let returnO = makeObj(input);\n return (returnO);\n }\n}\n\nexport function makeObj(input) {\n let returnObj = {};\n let pairs = [];\n if (Array.isArray(input)) {\n pairs = input;\n }\n else {\n pairs = (input.split(','));\n }\n pairs.forEach((p, x) => {\n let [key, value] = p.replace(/[{}]/g, '').split(/[:=]/);\n if (!value) {\n returnObj[`${x}`] = key.trim();\n }\n else {\n if (isNaN(Number(value))) {\n returnObj[key.trim()] = value.trim();\n }\n else {\n returnObj[key.trim()] = Number(value);\n }\n }\n });\n return returnObj;\n}\n\nexport function extract(string, left, right = null, options = {}) {\n let f_left = string.indexOf(left);\n let f_right = string.indexOf(right, f_left);\n if ((f_left === -1) || !left) {\n if (!options.fuzzyLeft) { return null; }\n else {\n f_left = 0;\n left = '';\n }\n }\n if ((f_right === -1) || !right) {\n if (!options.fuzzyRight) { return null; }\n else {\n f_right = string.length;\n right = '';\n }\n }\n if (!options.includeLeft) { f_left += left.length; }\n if (options.includeRight) { f_right += right.length; }\n return string.slice(f_left, f_right);\n};\n\nexport function array_in_array(a1, a2) {\n if (!a1 || !a2) { return false; }\n // return true if any member of array 1 appears anywhere in array 2\n return a1.some(this_a => {\n return a2.includes(this_a);\n });\n}\n\nexport function titleCase(pString) {\n if (!pString) { return ''; }\n let words = pString.split(/(\\W+)/);\n let returnString = '';\n words.forEach((w, x) => {\n if (x === 0) { returnString += `${w.slice(0, 1).toUpperCase()}${w.slice(1)}`; }\n else if ((w.length < 3) || (w === 'and') || (w === 'the')) { returnString += w; }\n else if (w.toLowerCase() === 'ava') { returnString += 'AVA'; }\n else if (w.toLowerCase() === 'bbq') { returnString += 'BBQ'; }\n else if (w.toLowerCase() === 'ceo') { returnString += 'CEO'; }\n else { returnString += `${w.slice(0, 1).toUpperCase()}${w.slice(1)}`; }\n// returnString += ' ';\n });\n return returnString.trim();\n}\n\nexport function makeNumber(pNum) {\n if (!pNum) { return 0; }\n else {\n let pN = Number(pNum);\n if (isNaN(pN)) { return 0; }\n else { return pN; }\n }\n};\n\nexport function parseNumeric(pIn) {\n let pStr = pIn.toString();\n let t = pStr.replace(/\\d/g, '');\n let n = t.replace(/[\\s.]/g, '');\n let v = pStr.replace(/\\D/g, '');\n let p = parseFloat(pStr);\n if (p.toString().includes('.')) {\n // decimal point, not \"dot\" - in this case \n // remove the decimal point from t as it is part of the number, not the text\n t = t.replace(/[.]/g, '');\n }\n return ({\n isNumeric: !!p,\n hasNumbers: !!v,\n hasText: !!n,\n textValue: t.trim() || null,\n value: p || null\n });\n};\n\nexport async function getIcon(pIcon) {\n const imageBucket = 'ava-icons';\n const imageURI = `${pIcon}.png`;\n let oData;\n try {\n await s3.getObject({\n Bucket: imageBucket,\n Key: imageURI,\n }, function (error, data) {\n if (data) { oData = data; };\n })\n .promise();\n if (!oData || (oData.ContentLength === 0)) {\n return;\n };\n let gotImage =\n s3.getSignedUrl('getObject', {\n Bucket: imageBucket,\n Key: imageURI,\n Expires: 3600\n });\n iconObj[pIcon] = gotImage;\n return gotImage;\n }\n catch (e) {\n console.log(`error getting S3 image is ${e}`);\n return null;\n }\n};\n\n\nexport async function getObject64(pObj) {\n let imageBucket = 'theseus-medical-storage';\n let oPieces = pObj.split('/');\n let oFile = oPieces.pop();\n let myPiece = oPieces.findIndex(x => {\n return (x.includes('.s3'));\n });\n if (myPiece > -1) {\n imageBucket = oPieces[myPiece].substring(0, oPieces[myPiece].indexOf('.s3'));\n }\n let oData;\n try {\n let rawObject =\n await s3.getObject({\n Bucket: imageBucket,\n Key: oFile,\n }, function (error, data) {\n if (data) {\n oData = data;\n if (oData) {\n console.log('got oData');\n }\n };\n })\n .promise();\n console.log(rawObject);\n let gotURL =\n s3.getSignedUrl('getObject', {\n Bucket: imageBucket,\n Key: oFile,\n Expires: 3600\n });\n if (!gotURL || (gotURL.ContentLength === 0)) { throw new Error('No object returned'); }\n else {\n let gotObject =\n await s3.getObject({\n Bucket: imageBucket,\n Key: oFile,\n }).promise();\n if (!gotObject || (gotObject.ContentLength === 0)) {\n return;\n };\n let base64String = gotObject.Body.toString('base64');\n return \"data:image/jpeg;base64,\" + base64String;\n }\n }\n catch (e) {\n console.log(`error getting S3 image is ${e}`);\n return null;\n }\n};\n\nexport function getObject(pObjIn, pTyp) {\n let imageBucket, imageURI;\n let [pObj, fExt] = pObjIn.split(/\\.(.*)/);\n switch (pTyp) {\n case 'icon': {\n imageBucket = 'ava-icons';\n imageURI = `${pObj}.${fExt || 'png'}`;\n break;\n }\n case 'image': {\n imageBucket = 'theseus-medical-storage';\n if (fExt) {\n if (['png', 'jpg'].includes(fExt.toLowerCase())) {\n imageURI = `public/patients/${pObj}.${fExt}`;\n }\n else {\n imageURI = `public/patients/${pObj}.${fExt}.jpg`;\n }\n }\n else {\n imageURI = `public/patients/${pObj}.jpg`;\n }\n break;\n }\n default: {\n imageBucket = 'theseus-medical-storage';\n imageURI = pObjIn;\n }\n }\n try {\n let gotObject =\n s3.getSignedUrl('getObject', {\n Bucket: imageBucket,\n Key: imageURI,\n Expires: 3600\n });\n if (gotObject) { return gotObject; }\n else { throw new Error('No object returned'); }\n }\n catch (error) {\n cl({ 'error getting object': { pObjIn, pTyp, imageBucket, imageURI, pObj, fExt, error } });\n return null;\n }\n};\n\nexport async function updateACL(pObjIn, pTyp) {\n let imageBucket, imageURI;\n let [pObj, fExt] = pObjIn.split(/\\.(.*)/);\n switch (pTyp) {\n case 'icon': {\n imageBucket = 'ava-icons';\n imageURI = `${pObj}.${fExt || 'png'}`;\n break;\n }\n case 'image': {\n imageBucket = 'theseus-medical-storage';\n imageURI = `public/patients/${pObj}.${fExt || 'jpg'}`;\n break;\n }\n default: {\n imageBucket = 'theseus-medical-storage';\n imageURI = pObjIn;\n }\n }\n await s3\n .putObjectAcl({\n Bucket: imageBucket,\n Key: imageURI,\n ACL: 'public-read-write',\n })\n .promise()\n .catch(err => {\n cl(`ACL for ${imageURI} not updated in ${imageBucket}. Error is ${err}`);\n });\n};\n\nexport function isPromise(p) {\n return p && Object.prototype.toString.call(p) === \"[object Promise]\";\n}\n\nexport function isEmpty(o) {\n if (!o) { return true; }\n else if (Array.isArray(o)) { return (o.length === 0); }\n else if (o instanceof Date) { return isNaN(o); }\n else if (typeof (o) === 'object') { return (Object.keys(o).length === 0); }\n else if (typeof (o) === 'string') { return (o.trim().length === 0); }\n else if (typeof (o) === 'number') { return (o === 0); }\n else { return false; }\n}\n\nexport function isObject(a) {\n return (!!a) && (a.constructor === Object);\n};\n\nexport function uuid(pLen) {\n let key = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];\n if (!pLen || (pLen < 6)) { pLen = 6; }\n var d = new Date().getTime();\n let ans = [];\n for (let a = 0; a < pLen; a++) {\n var r = Math.random() * 16; //random number between 0 and 16\n if (d <= 0) { d = new Date().getTime(); }\n r = (d + r) % 16 | 0;\n d = Math.floor(d / 16);\n ans.push(key[r]);\n }\n return ans.join('');\n}\n\nexport async function deepResolve(pKey, pSession, options = {}) {\n if (typeof (pKey) !== 'string') {\n let workObj = deepCopy(pKey);\n for (let aKey in workObj) {\n workObj[aKey] = await deepResolve(workObj[aKey], pSession, options);\n }\n return workObj;\n }\n return resolveVariables(pKey, pSession, options);\n}\n\n\nexport async function resolveVariables(pKey, pSession, options = {}) {\n if (!pKey) { return ''; }\n // look for brackets in the key and deal with what's between them\n let response = [];\n do {\n let result = pKey.match(/(.*?)([<[])(.*?)([>\\]])(.*)/);\n if (!result) {\n response.push(pKey);\n break;\n }\n let [, front, d1, middle, d2, back] = result;\n if (middle.includes('%')) {\n let [, before, , variable_name, , after] = middle.match(/(.*?)(%)(.*?)(%)(.*)/);\n if (options.hasOwnProperty(variable_name)) {\n middle = `${before}${options[variable_name]}${after}`;\n d1 = '';\n d2 = '';\n }\n else if (pSession.hasOwnProperty(variable_name)) {\n middle = `${before}${pSession[variable_name]}${after}`;\n d1 = '';\n d2 = '';\n }\n response.push(front, d1, middle, d2);\n }\n else {\n let [instruction, dType] = middle.split(':');\n instruction = instruction.toLowerCase();\n switch (instruction) {\n case 'client': {\n response.push(front, pSession.client_id);\n break;\n }\n case 'name': {\n response.push(front, await makeName(pSession.patient_id));\n break;\n }\n case 'location': {\n let pMe = await getPerson(pSession.patient_id);\n response.push(front, pMe.location);\n break;\n }\n case 'local': {\n let pMe = await getPerson(pSession.patient_id);\n response.push(front, pMe.local_data ? pMe.local_data[dType] : '');\n break;\n }\n case 'person':\n case 'patient': {\n response.push(front, pSession.patient_id);\n break;\n }\n case 'user_id':\n case 'user': {\n response.push(front, pSession.user_id);\n break;\n }\n case 'user_name':\n case 'username': {\n response.push(front, await makeName(pSession.user_id));\n break;\n }\n case 'weekday': {\n if (dType) {\n if (dType.startsWith('today~')) {\n let now = new Date();\n let ttime = Number(instruction.split(/~/g)[1]);\n let tnow = (now.getHours() * 100) + now.getMinutes();\n if (tnow > ttime) { dType = 'tomorrow'; }\n else { dType = 'today'; }\n }\n let keyDate = makeDate(dType);\n response.push(front, keyDate.weekday);\n }\n break;\n }\n default: {\n if (instruction.startsWith('today~')) {\n let now = new Date();\n let ttime = Number(instruction.split(/~/g)[1]);\n let tnow = (now.getHours() * 100) + now.getMinutes();\n if (tnow > ttime) { instruction = 'tomorrow'; }\n else { instruction = 'today'; }\n }\n else if (instruction.startsWith('next_event~')) {\n let splitInstruction = instruction.split(/~/g);\n let oResponse = await getOccurenceList({\n client: pSession.client_id,\n event: splitInstruction[1],\n from_date: new Date(),\n number_of_occurrences: splitInstruction[2] || 1\n });\n instruction = oResponse.occArray[oResponse.occArray.length - 1];\n }\n let dateOptions = {};\n if (pSession.working_hours) {\n dateOptions.working_hours = deepCopy(pSession.working_hours);\n }\n let keyDate = makeDate(instruction, dateOptions);\n if (!keyDate.error) { response.push(front, keyDate[dType || 'obs']); }\n else {\n let iParts = [];\n if (typeof (instruction) === 'string') { iParts = instruction.split('~'); };\n if (iParts[2]) {\n let now = new Date();\n let tTime = Number(iParts[1]); // get time\n let tNow = (now.getHours() * 100) + now.getMinutes();\n if (tNow > tTime) { response.push(front, iParts[2]); }\n else { response.push(front, iParts[0]); }\n }\n else { response.push(front, d1, middle, d2); }\n }\n }\n }\n }\n pKey = back;\n } while (pKey);\n return response.join('');\n}\n\nexport function parseSpreadsheet(pWorkbook) {\n // take pWorkbook as raw XLSX data and return an array as returnObj[row] = { column: cellValue, ...}\n let returnObj = [];\n let cellValue, cellColumn, cellRow;\n pWorkbook.SheetNames.forEach((sheetName) => {\n let currentSheet = pWorkbook.Sheets[sheetName];\n for (const currentCell in currentSheet) {\n if (currentSheet[currentCell].w) { cellValue = currentSheet[currentCell].w.trim(); }\n else if (currentSheet[currentCell].v) { cellValue = currentSheet[currentCell].v.trim(); }\n else { continue; }\n cellColumn = currentCell.replace(/[^A-Z]+/, '');\n cellRow = Number(currentCell.replace(cellColumn, ''));\n if (!returnObj[cellRow]) { returnObj[cellRow] = {}; }\n returnObj[cellRow][cellColumn] = cellValue;\n }\n });\n return returnObj;\n}\n\nexport const isMobile = () => {\n return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);\n};\n\nexport const isSmallScreen = () => {\n return isMobile() || (window.window.innerWidth < 800);\n};\n\nexport async function switchActiveAccount(session, newClient, newPatient, options = {}) {\n await dbClient\n .update({\n Key: { session_id: session.user_id },\n UpdateExpression: 'set client_id = :c, patient_id = :p, patient_display_name = :d, user_homeClient = :h',\n ExpressionAttributeValues: {\n ':c': newClient,\n ':p': newPatient.id,\n ':d': (newPatient.name ? (`${newPatient.name.first} ${newPatient.name.last}`).trim() : (`${newPatient.first} ${newPatient.last}`).trim()),\n ':h': (session.user_homeClient || session.client_id)\n },\n TableName: \"SessionsV2\",\n })\n .promise()\n .catch(error => { console.log(`caught error updating SessionsV2; error is:`, error); });\n if (options && options.resetUser) {\n let sessionObject = JSON.parse(sessionStorage.getItem('AVASessionData'));\n sessionObject.currentProfile.client_id = newClient;\n sessionObject.currentProfile.person_id = newPatient.id;\n sessionStorage.setItem('AVASessionData', JSON.stringify(sessionObject));\n }\n else {\n sessionStorage.removeItem('AVASessionData');\n }\n let jumpTo = window.location.href.replace('refresh', 'theseus');\n window.location.replace(jumpTo);\n};\n\nexport async function updateDb(pData) {\n // pData in the form {[\"table\": , \"key\": {\"key1\": \"keydata1\", etc...}, \"data\": {\"field_name1\": \"new value\", \"field_name2\", \"new value\", ...}]}\n let response = [];\n pData_loop: for (let t = 0; t < pData.length; t++) {\n let k_num = 0;\n let aNamesObj = {};\n let aValuesObj = {};\n let expression = 'set';\n for (let pKey in pData[t].data) {\n // are you updating anything in the key?\n if (pData[t].key.hasOwnProperty(pKey)) {\n // this is a delete/add; not an update\n let oldRec = await dbClient\n .get({\n Key: pData[t].key,\n TableName: pData[t].table,\n })\n .promise()\n .catch(error => {\n console.log(`caught error getting ${pData[t].table}; error is:`, error);\n response.push(error);\n });\n let newRec;\n if (recordExists(oldRec)) {\n newRec = Object.assign({}, oldRec.Item, pData[t].data);\n await dbClient\n .delete({\n Key: pData[t].key,\n TableName: pData[t].table,\n })\n .promise()\n .catch(error => {\n console.log(`caught error deleting ${pData[t].table}; error is:`, error);\n response.push(error);\n });\n }\n else {\n newRec = Object.assign({}, pData[t].key, pData[t].data);\n }\n await dbClient\n .put({\n TableName: pData[t].table,\n Item: newRec\n })\n .promise()\n .catch(error => {\n console.log(`caught error putting to ${pData[t].table}; error is:`, error);\n response.push(error);\n });\n continue pData_loop; // this jumps out and doesn't add to the aNameObj and aValuesObj\n }\n let aKey = `n${k_num++}`;\n aNamesObj[`#${aKey}`] = pKey;\n aValuesObj[`:${aKey}`] = pData[t].data[pKey];\n if (k_num > 1) {\n expression += ', ';\n }\n expression += ` #${aKey} = :${aKey}`;\n }\n await dbClient\n .update({\n Key: pData[t].key,\n UpdateExpression: expression,\n ExpressionAttributeValues: aValuesObj,\n ExpressionAttributeNames: aNamesObj,\n TableName: pData[t].table,\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating ${pData[t].table}; error is:`, error);\n response.push(error);\n });\n response.push('OK');\n }\n return response;\n}\n\nexport async function deleteDbRec(pData) {\n // pData in the form {[\"table\": , \"key\": {\"key1\": \"keydata1\", etc...}]}\n let response = [];\n for (let t = 0; t < pData.length; t++) {\n await dbClient\n .delete({\n Key: pData[t].key,\n TableName: pData[t].table,\n })\n .promise()\n .catch(error => {\n console.log(`caught error deleting ${pData[t].table}; error is:`, error);\n response.push(error);\n });\n response.push('OK');\n }\n return response;\n}\n\nexport async function getDb(getSpec) {\n const foundDoc = await dbClient\n .get(getSpec)\n .promise()\n .catch(error => {\n cl(`Error reading ${getSpec.TableName} in getDb with key of ${getSpec.Key}: ${error}`);\n });\n if (recordExists(foundDoc)) {\n return foundDoc.Item;\n }\n else {\n return false;\n }\n}\n\nexport async function restAPI(pRequest, api_data) {\n let finalReturn = {};\n const TELSdefaults = {\n hostname: 'integrations.tels.net',\n path: '/workOrders/v1/workOrders',\n method: 'POST',\n headers: {\n \"X-API-Key\": \"Ej8NR7sTFj1TvpG1p2ADz9os9aIu5Q3n7E4QeaIU\",\n 'Content-Type': 'application/json'\n },\n };\n\n let requestHeaders = Object.assign({}, TELSdefaults.headers, pRequest.headers);\n let request = Object.assign({}, TELSdefaults, pRequest, { headers: requestHeaders });\n\n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:bookResourceReservation',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: ''\n };\n\n params.Payload = JSON.stringify({\n options: request,\n newTELSworkorder: api_data\n });\n\n let invokeFailed = false;\n const fResp = await lambda\n .invoke(params)\n .promise()\n .catch(err => {\n invokeFailed = true;\n });\n\n if (!invokeFailed) {\n let response = JSON.parse(fResp.Payload);\n if (response.status === 200) {\n finalReturn = response.Presponse;\n }\n };\n return finalReturn;\n\n}","import { titleCase } from '../util/AVAUtilities';\n\nexport function addDays(pDate, pDays) {\n let copy;\n try {\n copy = makeDate(pDate).date;\n if (copy.error) {\n return copy;\n }\n copy.setDate(copy.getDate() + pDays);\n }\n catch {\n console.log(`tried ${pDate} and failed`);\n }\n return copy;\n}\n\nexport function addMonths(pDate, pMonths) {\n let copy;\n copy = makeDate(pDate);\n if (copy.error) {\n return copy;\n }\n let cDate = copy.date;\n cDate.setMonth(cDate.getMonth() + pMonths);\n return makeDate(cDate);\n}\n\n\nexport function daysDiff(d1, d2) {\n let oneMinute = 1000 * 60;\n let one_day = 1000 * 60 * 60 * 24;\n let d1DST = d1.getTimezoneOffset();\n let d2DST = d2.getTimezoneOffset();\n return Math.abs(Math.floor((d2.getTime() - d1.getTime() - ((d2DST - d1DST) * oneMinute)) / one_day));\n}\n\nexport function makeDate(pInput, optionIn = {}) {\n if (!pInput) {\n return {\n 'error': true,\n 'relative': '', // next Tuesday\n 'absolute': '', // Tue, Aug 22\n 'absolute_full': '', // Tuesday, August 22, 2023\n 'dateOnly': '', // August 22\n 'timeOnly': '', // 2:45pm\n 'oaDate': '', // on Tue, Aug 22, 2023 at 2:45pm\n 'date': null,\n 'timestamp': 0,\n 'ymd': '2099.01.01',\n 'input': '2099-01-01',\n 'obs': '2099.1.1',\n 'numeric': 20990101,\n 'numeric$': '20990101',\n 'dayPart': 'day', // afternoon\n 'workingHours': 'day', // day, night, weekend\n 'dayOfWeek': 0, // Sun = 0, Mon = 1, ... , Sat = 6\n 'dayOfWeek_word': 'Sunday',\n 'weekday': '', // 'weekend' or 'weekday' \n 'textOut': pInput\n };\n }\n let options = {};\n if (typeof (optionIn) === 'string') {\n options[optionIn] = true;\n }\n else {\n options = Object.assign({}, optionIn);\n }\n if (!options.hasOwnProperty('timeZone')) {\n options.timeZone = 'America/New_York';\n }\n let originalInput = pInput;\n let targetDateStamp, targetDate;\n if (pInput instanceof Date) {\n if (options.noTime) {\n pInput.setHours(0, 0, 0, 0);\n }\n targetDateStamp = pInput.getTime();\n targetDate = new Date(pInput);\n }\n else {\n if (Number(pInput).toString() === pInput) { pInput = Number(pInput); } // convert a string that is all digits to its numeric equivalent\n if ((typeof pInput) === 'number') {\n // 101 - 1231 mm dd in logical year (see makedate)\n // 10101 - 123199 mm dd yy\n // 200101 - 991231 yy mm dd\n // 1010001 - 12312999 mm dd yyyy\n // 20200101 - 29991231 yyyy mm dd\n // > 29991231 java timestamp\n if (pInput <= 1231) {\n targetDate = buildDate(`${Math.floor(pInput / 100)}/${pInput % 100}`).date;\n }\n else if (pInput <= 123199) {\n targetDate = buildDate(`${Math.floor(pInput / 10000)}/${Math.floor((pInput % 10000) / 100)}/20${pInput % 100}`).date;\n }\n else if (pInput <= 991231) {\n targetDate = buildDate(`${Math.floor((pInput % 10000) / 100)}/${pInput % 100}/20${Math.floor(pInput / 10000)}`).date;\n }\n else if (pInput <= 12312999) {\n targetDate = buildDate(`${Math.floor(pInput / 1000000)}/${Math.floor((pInput % 1000000) / 10000)}/${pInput % 10000}`).date;\n }\n else if (pInput <= 29991231) {\n targetDate = buildDate(`${Math.floor((pInput % 10000) / 100)}/${pInput % 100}/${Math.floor(pInput / 10000)}`).date;\n }\n else { targetDate = new Date(pInput); }\n }\n else if ((typeof pInput) !== 'string') { targetDate = new Date(pInput); }\n else {\n let response = buildDate(pInput);\n targetDate = response.date;\n pInput = response.leftOver_text || '';\n }\n if (isDate(targetDate)) {\n targetDateStamp = targetDate.getTime();\n }\n else {\n return {\n 'error': true,\n 'relative': `${pInput} is not a valid date`,\n 'absolute': `${pInput} is not a valid date`,\n 'absolute_full': `${pInput} is not a valid date`,\n 'dateOnly': `${pInput} is not a valid date`,\n 'timeOnly': `${pInput} is not a valid date`,\n 'oaDate': `${pInput} is not a valid date`,\n 'date': null,\n 'timestamp': 0,\n 'ymd': '2099.01.01',\n 'input': '2099-01-01',\n 'obs': '2099.1.1',\n 'numeric': 20990101,\n 'numeric$': '20990101',\n 'dayPart': 'day',\n 'workingHours': `${pInput} is not a valid date`,\n 'dayOfWeek': 9,\n 'dayOfWeek_word': 'invalid',\n 'weekday': 'invalid',\n 'textOut': pInput\n };\n }\n }\n\n let currentDate = new Date();\n let beginningOfCurrentDay = currentDate.setHours(0, 0, 0, 0);\n\n if (options.noTime) {\n targetDate.setHours(0, 0, 0, 0);\n }\n\n // validation\n if (options.validation) {\n let foundError;\n switch (options.validation) {\n case 'noFuture': {\n if (targetDate > currentDate) {\n foundError =\n `${targetDate.toLocaleString([], { timeZone: options.timeZone, month: 'short', day: 'numeric', year: 'numeric' })} is in the future and not allowed here`;\n }\n break;\n }\n case 'noPast': {\n if (targetDateStamp < beginningOfCurrentDay) {\n foundError = `${originalInput} is in the past and not allowed here`;\n }\n break;\n }\n default: { }\n }\n if (foundError) {\n return {\n 'error': true,\n 'relative': foundError,\n 'absolute': foundError,\n 'absolute_full': foundError,\n 'dateOnly': foundError,\n 'timeOnly': foundError,\n 'oaDate': foundError,\n 'date': null,\n 'timestamp': 0,\n 'ymd': '2099.01.01',\n 'input': '2099-01-01',\n 'obs': '2099.1.1',\n 'numeric': 20990101,\n 'numeric$': '20990101',\n 'dayPart': 'day',\n 'workingHours': foundError,\n 'dayOfWeek': 9,\n 'dayOfWeek_word': 'invalid',\n 'weekday': 'invalid',\n 'textOut': pInput\n };\n }\n }\n\n // force this date to be in the future\n if (options.forceForward) {\n if (targetDate < currentDate) {\n targetDate.setFullYear(currentDate.getFullYear() + 1);\n }\n }\n\n // Make relative date\n let relDate, absDate, oaDate, dateOnly, absFull;\n let hours = 60 * 60 * 1000;\n if (targetDateStamp < beginningOfCurrentDay) {\n if (targetDateStamp > (beginningOfCurrentDay - (24 * hours))) {\n relDate = 'yesterday';\n }\n else if (targetDateStamp > (beginningOfCurrentDay - (7 * 24 * hours))) {\n let mWord = '';\n if ((currentDate.getTime() - targetDateStamp) > (4 * 24 * hours)) {\n mWord = 'last ';\n }\n relDate = `${mWord}${targetDate.toLocaleString([], { timeZone: options.timeZone, weekday: 'long' })}`;\n }\n }\n else if (targetDateStamp >= (beginningOfCurrentDay + (24 * hours))) {\n if (targetDateStamp < (beginningOfCurrentDay + (48 * hours))) {\n relDate = 'tomorrow';\n }\n else if (targetDateStamp < (beginningOfCurrentDay + (8 * 24 * hours))) {\n let mWord = '';\n if (targetDate.getDay() <= currentDate.getDay()) {\n mWord = 'next ';\n }\n relDate = `${mWord}${targetDate.toLocaleString([], { timeZone: options.timeZone, weekday: 'long' })}`;\n }\n }\n else {\n let hour = targetDate.getHours();\n if ((hour + targetDate.getMinutes()) === 0) { relDate = \"today\"; }\n else if (hour < 12) { relDate = \"this morning\"; }\n else if (hour < 17) { relDate = \"this afternoon\"; }\n else (relDate = \"this evening\");\n }\n // Make absolute date\n absDate = `${targetDate.toLocaleString([], { timeZone: options.timeZone, weekday: 'short', month: 'short', day: 'numeric' })}`;\n absFull = `${targetDate.toLocaleString([], { timeZone: options.timeZone, weekday: 'long', month: 'long', year: 'numeric', day: 'numeric' })}`;\n dateOnly = `${targetDate.toLocaleString([], { timeZone: options.timeZone, month: 'short', day: 'numeric' })}`;\n if (!relDate) { relDate = absDate; }\n if (targetDate.getFullYear() !== currentDate.getFullYear()) {\n absDate += ` ${targetDate.getFullYear()}`;\n if (daysDiff(targetDate, new Date()) > 21) { relDate += ` ${targetDate.getFullYear()}`; }\n }\n oaDate = `on ${absDate}`;\n if ((targetDate.getHours() > 0) || (targetDate.getMinutes() > 0)) {\n let tOfDay = ` at ${targetDate.toLocaleString([], { timeZone: options.timeZone, hour: 'numeric', minute: '2-digit' })}`;\n absDate += tOfDay;\n oaDate += tOfDay;\n relDate += tOfDay;\n }\n let dayPart = 'day';\n let workingHours = 'day';\n let hour = targetDate.getHours();\n if (hour < 12) { dayPart = \"morning\"; }\n else if (hour < 17) { dayPart = \"afternoon\"; }\n else (dayPart = \"evening\");\n if (options.working_hours) {\n if ((options.working_hours.hasOwnProperty('isHoliday')) && (options.working_hours.isHoliday)) {\n workingHours = \"holiday\";\n }\n else if ((options.working_hours.hasOwnProperty('weekend')) && (options.working_hours.weekend) && ((targetDate.getDay() % 6) === 0)) {\n workingHours = \"weekend\";\n }\n else {\n let startTime = 800;\n if (options.working_hours.hasOwnProperty('start')) {\n let try_start = Number(options.working_hours.start);\n if (!isNaN(try_start)) {\n if (try_start < 100) {\n try_start *= 100;\n }\n startTime = try_start;\n }\n }\n let endTime = 1800;\n if (options.working_hours.hasOwnProperty('end')) {\n let try_end = Number(options.working_hours.end);\n if (!isNaN(try_end)) {\n if (try_end < 100) {\n try_end *= 100;\n }\n endTime = try_end;\n }\n }\n if (((hour * 100) < startTime) || ((hour * 100) > endTime)) {\n workingHours = \"night\";\n };\n }\n }\n else {\n if ((targetDate.getDay() % 6) === 0) {\n workingHours = \"weekend\";\n }\n else if ((hour < 8) || (hour > 18)) {\n workingHours = \"night\";\n };\n }\n let targetDateYMD = targetDate.getFullYear()\n + '.' + (targetDate.getMonth() + 101).toString().slice(1)\n + '.' + (targetDate.getDate() + 100).toString().slice(1);\n let targetDateInput = targetDate.getFullYear()\n + '-' + (targetDate.getMonth() + 101).toString().slice(1)\n + '-' + (targetDate.getDate() + 100).toString().slice(1);\n let regEx = /\\.0/g;\n return {\n 'error': false,\n 'relative': titleCase(relDate),\n 'absolute': titleCase(absDate),\n 'absolute_full': titleCase(absFull),\n 'timeOnly': targetDate.toLocaleString([], { timeZone: options.timeZone, hour: 'numeric', minute: '2-digit', timeZoneName: 'short' }),\n 'dateOnly': dateOnly,\n 'oaDate': titleCase(oaDate),\n 'date': targetDate,\n 'timestamp': targetDateStamp,\n 'ymd': targetDateYMD,\n 'input': targetDateInput,\n 'obs': targetDateYMD.replace(regEx, '.'),\n 'numeric': Number(targetDateYMD.replace(/\\./g, '')),\n 'numeric$': targetDateYMD.replace(/\\./g, ''),\n 'dayPart': dayPart,\n 'workingHours': workingHours,\n 'dayOfWeek': targetDate.getDay(),\n 'dayOfWeek_word': `${targetDate.toLocaleString([], { timeZone: options.timeZone, weekday: 'long' })}`,\n 'weekday': (((targetDate.getDay() % 6) === 0) ? 'weekend' : 'weekday'),\n 'textOut': pInput\n };\n\n function buildDate(pString) {\n if (!pString) {\n return {\n date: new Date(),\n leftOver_text: ''\n };\n }\n // is this a string as yyyy-mm-dd?\n let test_me = pString.split('-');\n if (test_me.length === 3) {\n pString = `${test_me[1].trim()}/${test_me[2].trim()}/${test_me[0].trim()}`;\n }\n // is the text a good date on its own?\n let parsed = pString.match(/[+-]/);\n let datePart;\n let addendPart = 0;\n let delimiter = '+';\n if (parsed) {\n delimiter = parsed[0];\n [datePart, addendPart] = pString.split(delimiter);\n if (isNaN(addendPart)) {\n addendPart = 0;\n }\n }\n else {\n datePart = pString;\n }\n datePart = datePart.replace(/st|th|nd|rd/, '');\n const today = new Date(new Date().setHours(0, 0, 0, 0)); // midnight at the start of the current day\n let validateDate = new Date(datePart);\n if (isDate(validateDate)) { // if something came in (say \"Feb 20\" or \"2/20\") that is a good date, we'll use it\n // BUT... if there was no year, the default is 2001 (probably not what they want); check for that here\n let sixtyDaysAgo = addDays(today, -60);\n let finalAnswer = validateDate;\n if (validateDate < sixtyDaysAgo) {\n // this tries to take a date in the past and make it current year\n // note that we APPEND the year, so if the incoming date string had a year explicity stated, that year will be used\n let date_asCorrected = new Date(`${datePart} ${today.getFullYear()}`);\n // in some cases, however, that doesn't work (example: on Dec 15, you enter January 5 - you want the date to be next year)\n if (!isDate(date_asCorrected) || (date_asCorrected < sixtyDaysAgo)) {\n let try_me = new Date(`${datePart} ${today.getFullYear() + 1}`);\n if (isDate(try_me)) {\n finalAnswer = try_me;\n }\n }\n else if (isDate(date_asCorrected)) {\n finalAnswer = date_asCorrected;\n }\n else {\n finalAnswer = validateDate;\n }\n }\n return {\n date: addDays(finalAnswer, ((delimiter === '-') ? -1 : 1) * Number(addendPart)),\n leftOver_text: ''\n };\n }\n // the text is some odd combination\n let daysToAdd = 0;\n let words, plusMinus, days$;\n let timePart;\n let validString = pString.match(/(\\d+[/\\-.]\\s*\\d+[/\\-.]\\s*\\d+)\\s*(([+-])(.*))?/);\n if (validString) {\n [, words, , plusMinus, days$] = validString;\n }\n else {\n validString = pString.match(/(.*)([-+])(.*)/);\n if (validString) {\n [, words, plusMinus, days$] = validString;\n }\n }\n if (words) {\n pString = words.trim();\n }\n if (days$) {\n daysToAdd = parseInt(days$.trim(), 10) * (plusMinus.includes('-') ? -1 : 1);\n }\n if (/^\\d+$/.test(pString)) { pString = parseInt(pString, 10); } // a string that is all numbers\n else {\n // extract time if it is present (time will be in group 2)\n let mTime = pString.match(/([\\s\\w/]*)\\s((\\d+:*\\d*)\\s*([PpAa].*[Mm])*)/);\n if (mTime && mTime.length > 2) {\n timePart = makeTime(mTime[2]);\n timePart.exists = true;\n pString = pString.replace(mTime[2], '');\n }\n let pStringPieces = pString.split(/[./-]/gm);\n if (pStringPieces.length > 1) { // two or three strings separated by \".\" or \"-\" or \"/\"\n let yearAt = pStringPieces.findIndex(p => { return (p > 1900); });\n let yearPiece, monthPiece, dayPiece;\n if (yearAt < 0) {\n if (pStringPieces.length > 2) {\n let twoDigYr = parseInt(pStringPieces[2], 10);\n if (twoDigYr < 30) {\n yearPiece = twoDigYr + 2000;\n }\n else {\n yearPiece = twoDigYr + 1900;\n }\n }\n else {\n yearPiece = new Date().getFullYear();\n }\n }\n else {\n yearPiece = pStringPieces[yearAt];\n pStringPieces.splice(yearAt, 1);\n }\n monthPiece = pStringPieces[0];\n if (pStringPieces.length === 1) {\n dayPiece = 1;\n }\n else {\n dayPiece = pStringPieces[1];\n }\n pString = `${monthPiece}/${dayPiece}/${yearPiece}`;\n }\n }\n let goodDate = new Date(pString);\n if (!isDate(goodDate)) {\n let m = pString.match(/(\\d+:*\\d*)\\s*([PpAa].*[Mm])/);\n if (m) {\n pString = pString.replace(m[0], `${m[1]}${m[2]}`);\n }\n let pWords = pString.split(/\\s+/);\n let currentDate;\n pWords = pWords.filter(f => { // filter expression will consume words that successfully contribute to the date \n let culledDate = dateFromText(f);\n if (culledDate) {\n currentDate = culledDate;\n return false;\n }\n else {\n return true;\n }\n });\n if (!isDate(currentDate)) {\n return { date: null, leftOver_text: pString };\n }\n if (timePart && timePart.exists) {\n currentDate.setHours(timePart.hh24, timePart.mm);\n }\n let variant = 0;\n const foundAt = pWords.findIndex(value => /last|next/.test(value));\n if (foundAt > -1) {\n if (pWords[foundAt] === 'last') {\n variant = -7;\n }\n else { variant = 7; }\n pWords.splice(foundAt, 1);\n }\n return {\n date: addDays(currentDate, (variant + daysToAdd)),\n leftOver_text: pWords.join(' ')\n };\n }\n else {\n // the date passed in was a good date\n // if the year is more than 100 years from now, assume that no year was passed in\n // Adjust the year to be the year that makes the month and day closest to now\n goodDate = addDays(goodDate, daysToAdd);\n let today = new Date();\n let thisYear = today.getFullYear();\n let resolvedYear = goodDate.getFullYear();\n if ((Math.abs(resolvedYear - thisYear) < 5) || (options.noYearCorrection)) {\n return {\n date: goodDate,\n leftOver_text: null\n };\n }\n // If you arrive here, the date is 100 years from now. Set it to a more recent date automatically\n goodDate.setFullYear(thisYear);\n if ((goodDate > today) || (daysDiff(today, goodDate) <= 120)) {\n return {\n date: goodDate,\n leftOver_text: null\n };\n }\n // date is more than 120 days before today\n let resolvedMonth = goodDate.getMonth();\n if (resolvedMonth > 9) { goodDate.setFullYear(thisYear - 1); } // and date is October or later, then assume last year\n return {\n date: goodDate,\n leftOver_text: null\n };\n }\n }\n\n function dateFromText(pString) {\n if (pString.match(/\\d+\\/\\d+/)) { // pString is in the form nn/nn\n let dateFromString = new Date(pString);\n if (dateFromString.getFullYear() === 2001) {\n dateFromString.setFullYear(new Date().getFullYear());\n }\n return dateFromString;\n }\n else {\n let ordinal = pString.match(/(\\d+)(st|nd|rd|th)/); // pString looks like an ordinal (1st, 2nd, 3rd, etc) \n if (ordinal) {\n let n = ordinal[1]; // the numeric part is in array position 1 (array position 0 is the entire matched ordinal)\n let now = new Date();\n let thisMonth_target = new Date();\n thisMonth_target.setDate(n);\n if (thisMonth_target >= now) {\n let lastMonth_target = new Date();\n lastMonth_target.setMonth(now.getMonth() - 1, n);\n if (daysDiff(now, lastMonth_target) < 7) { return lastMonth_target; }\n else {\n return thisMonth_target;\n }\n }\n else {\n if ((daysDiff(thisMonth_target, now) < 7) || (options.noFuture)) {\n return thisMonth_target;\n }\n else {\n let nextMonth_target = new Date();\n nextMonth_target.setMonth(now.getMonth() + 1, n);\n return nextMonth_target;\n }\n }\n }\n }\n let currentDate = new Date();\n let pStringLower = pString.toLowerCase();\n if (pStringLower === 'now') {\n pString = 'today';\n pStringLower = 'today';\n }\n else { currentDate.setHours(0, 0, 0, 0); }\n if (pStringLower === 'tomorrow') {\n return addDays(currentDate, 1);\n }\n else if (pStringLower === 'today') {\n return currentDate;\n }\n else if (pStringLower === 'yesterday') {\n return addDays(currentDate, - 1);\n }\n else {\n let currentDofWeek = new Date().getDay();\n let requestedDofWeek = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'].indexOf(pStringLower.slice(0, 3));\n if (requestedDofWeek > -1) {\n let variant = requestedDofWeek - currentDofWeek;\n if (variant < 0) { variant += 7; }\n return addDays(currentDate, variant);\n }\n else {\n return null;\n }\n }\n }\n};\n\nexport function isDate(pIn) {\n return ((pIn instanceof Date) && !isNaN(pIn.getTime()));\n}\n\nexport function sameDate(d1, d2) {\n if (!d1 || !d2) { return false; }\n if (d1 === d2) { return true; }\n return (makeDate(d1).numeric === makeDate(d2).numeric);\n}\n\nexport function makeTime(pTime) {\n let inTime;\n let ampm, hh, hh$, mm$;\n let mm = 0;\n let error = false;\n let empty = false;\n if (isDate(pTime)) {\n hh = pTime.getHours();\n mm = pTime.getMinutes();\n }\n else {\n if (typeof (pTime) === 'string') {\n if (pTime.trim() === '') {\n empty = true;\n }\n if (pTime.replace(/\\D+/g, '') === '') {\n ampm = 'am';\n hh = 0;\n mm$ = '00';\n mm = 0;\n empty = true;\n }\n else {\n inTime = pTime.toLowerCase();\n if (inTime.includes('pm')) { ampm = 'pm'; }\n else if (inTime.includes('am')) { ampm = 'am'; }\n else if (inTime.includes('a')) { ampm = 'am'; }\n else if (inTime.includes('p')) { ampm = 'pm'; }\n else if (inTime.slice(0, 1) === '0') {\n ampm = 'am';\n if (inTime.slice(1, 2) === '0') { inTime = `12${inTime.slice(2)}am`; }\n } // support military times starting with zero\n [hh$, mm$] = inTime.split(':');\n const hhClean = hh$.replace(/\\D+/g, '');\n if (!hhClean) {\n error = true;\n }\n hh = Number(hhClean);\n if ((ampm === 'am') && (hh === 12)) { hh = 0; }\n else if ((ampm === 'pm') && (hh < 12)) { hh += 12; }\n }\n }\n else { hh = pTime; }\n if (hh >= 100) {\n if (!mm$) { mm = hh % 100; }\n hh = Math.floor(hh / 100);\n }\n if (!ampm && (hh < 7) && (hh > 0)) { hh += 12; }\n if (mm$) { mm = Number(mm$.replace(/\\D+/g, '')); }\n if (mm > 59) {\n error = true;\n let hAdd = Math.floor(mm / 60);\n mm -= (hAdd * 60);\n hh += hAdd;\n }\n if (hh > 23) {\n hh = hh % 24;\n }\n if (hh > 12) {\n hh -= 12;\n ampm = 'pm';\n }\n else if ((hh === 12) && (!ampm)) {\n ampm = 'pm';\n }\n else if (hh === 0) {\n hh = 12;\n ampm = 'am';\n }\n }\n if (!ampm) { ampm = ((hh >= 0) && (hh < 12)) ? 'am' : 'pm'; }\n let numeric24;\n if ((ampm === 'pm') && (hh < 12)) { numeric24 = ((hh + 12) * 100) + mm; }\n else if ((ampm === 'am') && (hh === 12)) { numeric24 = mm; }\n else { numeric24 = (hh * 100) + mm; }\n let dayPart;\n if (numeric24 < 1200) { dayPart = \"morning\"; }\n else if (numeric24 < 1700) { dayPart = \"afternoon\"; }\n else (dayPart = \"evening\");\n if (mm === 0) { mm$ = '00'; }\n else if (mm < 10) { mm$ = mm.toString().padStart(2, '0'); }\n else { mm$ = mm.toString(); }\n let hh24 = Math.floor(numeric24 / 100);\n return {\n 'time': `${hh}:${mm$} ${ampm}`,\n 'short': `${hh}:${mm$}`,\n 'hhmm': `${hh}${mm$}`,\n hh,\n hh24,\n mm,\n ampm,\n numeric24,\n minutesSinceMidnight: ((hh24 * 60) + mm),\n string24: `0000${numeric24}`.slice(-4),\n dayPart,\n empty,\n error,\n good: (!empty && !error)\n };\n}","import { isMemberOf } from './AVAGroups';\nimport { makeDate } from './AVADateTime';\nimport { cl, isObject, recordExists, resolveVariables, lambda, dbClient } from './AVAUtilities';\n\n// Functions\n\n/*\nexport function putMessage_nonAsync(body) {\n const goFunction = async () => {\n returnArray = await putMessage(...arguments);\n };\n let returnArray = [];\n goFunction();\n return returnArray;\n}\n*/\n\nexport async function getObservationItems(pObsKey) {\n if (!pObsKey) {\n return {};\n }\n let returnObj = {};\n let pObsQkey = {\n KeyConditionExpression: 'observation_key = :c',\n ExpressionAttributeValues: {\n ':c': pObsKey,\n },\n TableName: \"Observation_Items\",\n };\n let obsItemRec = await dbClient\n .query(pObsQkey)\n .promise()\n .catch(error => { cl('ERROR reading Observation_Items. Caught error is:', error); });\n if (recordExists(obsItemRec)) {\n obsItemRec.Items.forEach((oiRec) => {\n returnObj[oiRec.characteristic] = oiRec;\n });\n };\n return returnObj;\n}\n\nexport async function getObservationKeys(request) {\n let pObsQkey = {\n TableName: \"Observation_Items\",\n };\n if (typeof (request) === 'string') {\n pObsQkey.KeyConditionExpression = 'observation_key = :c';\n pObsQkey.ExpressionAttributeValues = {\n ':c': request\n };\n }\n else if (request.hasOwnProperty('characteristic')) {\n pObsQkey.IndexName = 'characteristic-index';\n pObsQkey.KeyConditionExpression = 'characteristic = :c';\n pObsQkey.ExpressionAttributeValues = {\n ':c': request.characteristic\n };\n }\n else if (request.hasOwnProperty('observation_key')) {\n pObsQkey.KeyConditionExpression = 'observation_key = :c';\n pObsQkey.ExpressionAttributeValues = {\n ':c': request.observation_key\n };\n }\n let obsItemRec = await dbClient\n .query(pObsQkey)\n .promise()\n .catch(error => { cl('ERROR reading Observation_Items. Caught error is:', error); });\n if (recordExists(obsItemRec)) {\n return obsItemRec.Items;\n };\n}\n\nexport async function getObservations(pClient, pKey, options = {}) {\n var observations;\n var valueList = [];\n var oList = [];\n var returnQual = {};\n if (options && options.date) {\n let pDate = makeDate(options.date);\n if (pDate.error) {\n return [valueList, returnQual];\n }\n observations = await dbClient\n .query({\n KeyConditionExpression: 'client_id = :c and date_key = :d',\n ExpressionAttributeValues: { ':c': pClient, ':d': pDate.ymd },\n TableName: \"Observations\",\n IndexName: \"date_key-index\"\n })\n .promise()\n .catch(error => { cl(`ERROR reading Observations by date *** caught error is: ${error}`); });\n }\n else if (options && options.always) {\n observations = await dbClient\n .query({\n KeyConditionExpression: 'client_id = :c and date_key = :d',\n ExpressionAttributeValues: { ':c': pClient, ':d': 'always' },\n TableName: \"Observations\",\n IndexName: \"date_key-index\"\n })\n .promise()\n .catch(error => { cl(`ERROR reading Observations by date *** caught error is: ${error}`); });\n }\n else {\n pKey = await resolveVariables(pKey, options.session);\n let qQ = {\n KeyConditionExpression: 'composite_key = :p',\n ExpressionAttributeValues: { ':p': `${pClient}~${pKey}` },\n TableName: \"Observations\",\n IndexName: \"sort_order-index\"\n };\n observations = await dbClient\n .query(qQ)\n .promise()\n .catch(error => { cl(`***getAct 956- ERR reading Observations*** caught error is: ${error}`, qQ); });\n }\n if (recordExists(observations)) {\n let oL = observations.Items.length;\n for (let o = 0; o < oL; o++) {\n let oRec = observations.Items[o];\n if (options && options.sort) {\n oRec.sort_key = oRec.sort_order.replace(/[\\W\\d]/g, '').replace('header', '.');\n }\n oList.push(oRec);\n valueList.push(oRec.observation_code);\n let qualObj = {};\n if (oRec.fee) {\n qualObj.fee = oRec.fee;\n }\n if (oRec.description) {\n qualObj.description = oRec.description;\n }\n if (oRec.image_url) {\n qualObj.image_url = oRec.image_url;\n }\n if ('qualifiers' in oRec) {\n if (oRec.qualifiers.minimum_required) { qualObj.minimum_required = oRec.qualifiers.minimum_required; }\n if (oRec.qualifiers.maximum_allowed) { qualObj.maximum_allowed = oRec.qualifiers.maximum_allowed; }\n if (oRec.qualifiers.options) { qualObj.qualifiers = oRec.qualifiers.options; }\n }\n if (oRec.observation_key && !('qualifiers' in qualObj)) {\n qualObj.qualifiers = [`~~key=${oRec.observation_key}`];\n }\n if (Object.keys(qualObj).length > 0) {\n if (!('qualifiers' in qualObj)) { qualObj.qualifiers = []; }\n qualObj.value = oRec.observation_code;\n returnQual[oRec.observation_code] = qualObj;\n }\n }\n if (options && options.sort) {\n oList.sort((a, b) => {\n if (a.sort_key > b.sort_key) { return 1; }\n else { return -1; }\n });\n if (!options || !options.return || !(['object', 'record', 'objects', 'records'].includes(options.return))) {\n valueList = oList.map(o => { return o.observation_code; });\n }\n }\n }\n if (options && options.return && (['object', 'record', 'objects', 'records'].includes(options.return))) {\n return [oList, returnQual];\n }\n return [valueList, returnQual];\n};\n\nexport async function makeObservationList(pObs, pSession, variables = {}, options = { clean: true }) {\n let returnList = [];\n let returnQObj = {};\n let activityRec;\n let assignedClient = pSession.client_id;\n if (typeof (pObs) === 'string') {\n if (pObs.includes('//')) { [assignedClient, pObs] = pObs.split('//'); }\n activityRec = await getActivity(assignedClient, pObs);\n }\n else { activityRec = Object.assign({}, pObs); }\n if (activityRec?.validation?.values) {\n let listLength = activityRec.validation.values.length;\n for (let v = 0; v < listLength; v++) {\n let this_entry = await resolveVariables(activityRec.validation.values[v], pSession, variables);\n if (!this_entry.startsWith('~')) { returnList.push(this_entry); }\n else {\n // deconstruct this_entry as ~. \n // ex. ~includeobservations.todaysdinner gives \n // oType = includeobservations and \n // oKey = todaysdinner\n let [oType, oKey] = this_entry.slice(1).split(/[.|:](.*)/);\n switch (true) {\n case (oType === 'includeObservations'): {\n let oClient = assignedClient;\n if (oKey.includes('//')) { [oClient, oKey] = oKey.split('//'); }\n let [cList, cQual] = await getObservations(oClient, oKey, { session: pSession });\n returnList.push(...cList);\n if (Object.keys(cQual).length > 0) { returnQObj = Object.assign(returnQObj, cQual); }\n break;\n }\n case (oType.startsWith('includeIfGroup=')): {\n // ~includeIfGroup=AVT_soft_entree:~includeObservations.soft_entree_[wednesday]\"\n let [, checkGroup] = oType.split(/[=|:]/g);\n if (await isMemberOf(pSession.client_id, pSession.patient_id, checkGroup) && oKey) {\n activityRec.validation.values[v] = oKey;\n v--;\n }\n break;\n }\n case (oType === 'lambda'): {\n let [cList, cQual] = await getLambda(oKey);\n returnList.push(...cList);\n if (Object.keys(cQual).length > 0) { returnQObj = Object.assign(returnQObj, cQual); }\n break;\n }\n case (oType === 'peopleList'): {\n break;\n }\n default: {\n returnList.push(this_entry);\n }\n }\n }\n }\n if (options && options.clean) {\n let cleanedList = [];\n let sortedSection = [];\n returnList.forEach(r => {\n if (r.startsWith('~')) {\n if (sortedSection.length > 0) {\n sortedSection.sort();\n cleanedList.push(...sortedSection);\n sortedSection = [];\n }\n cleanedList.push(r);\n }\n else {\n if (!sortedSection.includes(r)) {\n sortedSection.push(r);\n }\n }\n });\n if (sortedSection.length > 0) {\n sortedSection.sort();\n cleanedList.push(...sortedSection);\n }\n returnList = [...cleanedList];\n }\n activityRec.valid_values_list = returnList;\n activityRec.value_qualifiers = returnQObj;\n }\n return {\n 'activityRec': activityRec,\n 'rows': returnList,\n 'qualifiers': returnQObj\n };\n\n async function getLambda(lambdaString) {\n // execute a lambda function\n // the body of the call is specified on the line itself as\n // \"~lambda:%%{:,:,...\"\n // ex. getFileUpdateOptions%%{request_client:[client],author:[person]}\n let lCleaned = await resolveVariables(lambdaString, pSession);\n let [lFunction, lString] = lCleaned.replace(/[{|}]/g, '').split('%%');\n let rValues = [];\n let rQual = [];\n if (lString) {\n let lObj = {};\n lString.split(',').forEach(e => {\n let [key, value] = e.split(':');\n lObj[key] = value;\n });\n let payload = { body: lObj };\n const AWS = require('aws-sdk');\n let b64 = AWS.util.base64.encode(JSON.stringify('AVAObservations'));\n var params = {\n FunctionName: lFunction,\n ClientContext: b64,\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: JSON.stringify(payload)\n };\n let data = await lambda.invoke(params)\n .promise()\n .catch((err) => {\n cl('error on invoke', JSON.stringify(err));\n return [`~~${JSON.stringify(err)}`];\n });\n if (data) {\n let payloadObject = JSON.parse(data.Payload);\n if (payloadObject.response_code === 200) { rValues = [...payloadObject.response_values]; }\n if (payloadObject.response_qualifiers) { rQual = [...payloadObject.response_qualifiers]; }\n }\n }\n return [rValues, rQual];\n }\n}\n\nexport async function getObservationOptions(pObs) {\n let options = await dbClient\n .query({\n KeyConditionExpression: 'observation_key = :p AND characteristic = :o',\n ExpressionAttributeValues: { ':p': pObs, ':o': 'options' },\n TableName: \"Observation_Items\"\n })\n .promise()\n .catch(error => { cl(`Problem reading Observation_Items with key ${pObs} is: ${error}`); });\n if (recordExists(options)) { return options.Items[0].display_value; }\n else { return []; }\n}\n\nexport async function getActivity(pClient, pCode) {\n let qQ = {\n Key: { client_id: pClient, activity_code: pCode },\n TableName: \"Activities\"\n };\n let activityRec = await dbClient\n .get(qQ)\n .promise()\n .catch(error => { cl(`***ERR reading Activity*** caught error is: ${error}`, qQ); });\n if (recordExists(activityRec)) {\n return activityRec.Item;\n }\n return {};\n};\n\nexport async function getBulletinBoard(pClient, pGroup_id) {\n let response = {\n // group_id : {\n // groupRec,\n // section_name: {\n // section_sort,\n // generic_activities_list: [{\n // group_list_index, \n // link_address,\n // link_title\n // }, {}, ...]\n // }\n // }\n };\n let qQ = {\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': pClient },\n TableName: \"Groups\"\n };\n if (pGroup_id) {\n qQ.KeyConditionExpression += ' and group_id = :g';\n qQ.ExpressionAttributeValues[':g'] = pGroup_id;\n }\n let groupRecs = await dbClient\n .query(qQ)\n .promise()\n .catch(error => {\n cl(`***ERR reading Groups*** caught error is: ${error}`, qQ);\n });\n if (!recordExists(groupRecs)) {\n return {};\n }\n groupRecs.Items.forEach(groupRec => {\n let section_name = 'None';\n let section_sort = '';\n response[groupRec.group_id] = {\n groupRec\n };\n if (groupRec.common_activities && (groupRec.common_activities.length > 0)) {\n groupRec.common_activities.forEach((activity_line, aList_index) => {\n if ((typeof (activity_line) === 'string') && (activity_line.startsWith('~~'))) {\n let sectionKeys = activity_line.slice(2).split('~~');\n if (sectionKeys[1]) {\n section_name = sectionKeys[1].split('~')[0];\n section_sort = sectionKeys[0];\n }\n else {\n section_name = sectionKeys[0].split('~')[0];\n section_sort = '';\n }\n }\n else {\n let activity_name, link_address, link_title;\n if (isObject(activity_line)) {\n activity_name = activity_line.activity_code;\n link_address = activity_line.default?.link_address;\n link_title = activity_line.title;\n }\n else {\n let parsed;\n [activity_name, ...parsed] = activity_line.split('~');\n parsed.forEach(spec => {\n let [split_type, split_spec] = spec.split('=');\n if (split_type.includes('default')) {\n link_address = split_spec.trim().replace(']', '');\n }\n else if (split_type.includes('title')) {\n link_title = split_spec.trim().replace(']', '');\n }\n });\n }\n if (activity_name === 'render.generic') {\n let aObj = {\n group_list_index: aList_index,\n link_address,\n link_title\n };\n if (!response.hasOwnProperty(groupRec.group_id)) {\n response[groupRec.group_id] = {\n groupRec,\n [section_name]: {\n section_sort,\n generic_activities_list: [aObj]\n }\n };\n }\n else if (!response[groupRec.group_id].hasOwnProperty(section_name)) {\n response[groupRec.group_id][section_name] = {\n section_sort,\n generic_activities_list: [aObj]\n };\n }\n else {\n response[groupRec.group_id][section_name].generic_activities_list.push(aObj);\n }\n };\n }\n });\n }\n });\n return response;\n};\n\n","import { clt, cl, recordExists, getCustomizations, dbClient, makeArray, deepCopy, isObject, s3, sentenceCase } from '../util/AVAUtilities';\nimport { getActivity } from '../util/AVAObservations';\nimport { getPerson, makeName } from '../util/AVAPeople';\nimport { makeDate } from '../util/AVADateTime';\nimport { prepareMessage, sendMessages, resolveMessageVariables, messageHistory, factForm } from '../util/AVAMessages';\n\n// Functions\n\nexport function putServiceRequest_nonAsync(body) {\n const goFunction = async () => {\n return await putServiceRequest(...arguments);\n };\n let returnArray = goFunction();\n return returnArray;\n}\n\nexport async function getServiceRequests(body) {\n /*\n --- body can contain a sort key; if present, sortInstructions is prepared and results sorted per these instructions \n sort: OR object in the form {\n sort: true\n order: 'asc' or 'des' \n key: the field in the ServiceRequest record on which to sort\n }\n --- The following keys can be in the request body itself OR in a body.filter object\n request_id: 1) {\n for (let x = 1; x < rTarray.length; x++) {\n qQ.FilterExpression += ` or request_type = :t${x}`;\n qQ.ExpressionAttributeValues[`:t${x}`] = rTarray[x];\n };\n }\n qQ.FilterExpression += ')';\n if (rP) {\n qQ.FilterExpression += ' and requestor = :p';\n qQ.ExpressionAttributeValues[':p'] = rP;\n }\n }\n else if (rP) {\n qQ.FilterExpression += 'requestor = :p';\n qQ.ExpressionAttributeValues[':p'] = rP;\n }\n }\n else if (body.assigned_to) {\n qQ.IndexName = 'assigned_to-index';\n qQ.KeyConditionExpression = 'client_id = :c and assigned_to = :rA';\n qQ.ExpressionAttributeValues = { ':c': body.client_id, ':rA': body.assigned_to };\n if (rT) {\n let rTarray = makeArray(rT);\n if (rTarray.length === 1) {\n qQ.FilterExpression = 'request_type = :rT';\n qQ.ExpressionAttributeValues[':rT'] = rTarray[0];\n }\n else {\n qQ.FilterExpression = '(request_type = :rT';\n qQ.ExpressionAttributeValues[':rT'] = rTarray[0];\n if (rTarray.length > 1) {\n for (let x = 1; x < rTarray.length; x++) {\n qQ.FilterExpression += ` or request_type = :rT${x}`;\n qQ.ExpressionAttributeValues[`:rT${x}`] = rTarray[x];\n };\n }\n qQ.FilterExpression += ')';\n }\n }\n }\n else if (rP) {\n qQ.IndexName = 'requestor-type-index';\n qQ.KeyConditionExpression = 'requestor = :rP';\n qQ.ExpressionAttributeValues = { ':rP': rP };\n if (rT) {\n let rTarray = makeArray(rT);\n if (rTarray.length === 1) {\n qQ.KeyConditionExpression += ' and request_type = :rT';\n qQ.ExpressionAttributeValues[':rT'] = rTarray[0];\n }\n }\n }\n else if (rT) {\n qQ.IndexName = 'last_update-index';\n qQ.KeyConditionExpression = 'client_id = :c';\n qQ.Limit = 500;\n qQ.ScanIndexForward = false;\n let rTarray = makeArray(rT);\n if (rTarray.length === 1) {\n qQ.FilterExpression = 'request_type = :rT';\n qQ.ExpressionAttributeValues = { ':c': body.client_id, ':rT': rTarray[0] };\n }\n else {\n qQ.FilterExpression = '(request_type = :t';\n qQ.ExpressionAttributeValues = { ':c': body.client_id, ':t': rTarray[0] };\n if (rTarray.length > 1) {\n for (let x = 1; x < rTarray.length; x++) {\n qQ.FilterExpression += ` or request_type = :t${x}`;\n qQ.ExpressionAttributeValues[`:t${x}`] = rTarray[x];\n };\n }\n qQ.FilterExpression += ')';\n }\n }\n let loopCount = 0;\n let unSortedList = [];\n do {\n let qR = await dbClient\n .query(qQ)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n console.log(`Security Violation or no Internet Connection`);\n }\n console.log({ 'Error reading ServiceRequests': error, index: qQ.IndexName, qQ });\n });\n if (recordExists(qR)) {\n unSortedList = unSortedList.concat(qR.Items);\n qQ.ExclusiveStartKey = qR.LastEvaluatedKey;\n }\n loopCount++;\n } while (qQ.ExclusiveStartKey && (loopCount < 10) && (unSortedList.length < (body.limit || 100)));\n if (!sortInstructions.sort) {\n return unSortedList;\n }\n let sort_order = 1;\n if (sortInstructions.order.startsWith('des')) {\n sort_order = -1;\n }\n return unSortedList.sort((a, b) => {\n a.sort = a[sortInstructions.key] || Number(a.request_id.split(/~/g).pop());\n b.sort = b[sortInstructions.key] || Number(b.request_id.split(/~/g).pop());\n if (a.sort < b.sort) { return -1 * sort_order; }\n if (a.sort > b.sort) { return sort_order; }\n return 0;\n });\n}\n\nexport async function putServiceRequest(body) {\n /* request is an object with...\n body: {\n client: (required),\n author: (required),\n proxy_user: (optional - if present, this is the actual user that created the request)\n requestType: (required - maint, dining, transportation, etc....)\n requestDate: ,\n onBehalfOf: \n request: (required)\n messaging: \n history: \n attachments: \n local_key: \n foreign_key: \n update_time: \n requestStatus: ,\n notes: \n activity_key\n };\n */\n let currentTime = makeDate(new Date());\n let now = currentTime.timestamp;\n if (!body.requestDate) { body.requestDate = now; };\n body.requestID = `${body.proxy_user || body.author}~${body.requestDate}`;\n if (!body.local_key) {\n let sDate = now.toString();\n body.local_key = sDate.slice(2, 6) + '-' + sDate.slice(6, 13);\n }\n if (!body.onBehalfOf) { body.onBehalfOf = await getPerson(body.author, 'name'); }\n let historyArray = [];\n if (body.history) {\n if (Array.isArray(body.history)) { historyArray.push(...(body.history)); }\n else { historyArray.push(body.history); }\n }\n else { historyArray.push(`Request submitted ${currentTime.oaDate}`); }\n let serviceRequestRec = {\n \"client_id\": body.client,\n \"request_id\": body.requestID,\n \"requestor\": body.author,\n \"on_behalf_of\": body.onBehalfOf,\n \"request_type\": body.requestType,\n \"request_date\": body.requestDate,\n \"activity_key\": body.activity_key,\n \"original_request\": body.request || body.original_request,\n \"current_request\": body.request || body.original_request,\n \"history\": historyArray,\n \"local_key\": body.local_key,\n \"assigned_to\": body.assigned_to || body.assign_to || 'unassigned',\n \"foreign_key\": body.foreign_key || '',\n \"last_update\": body.update_time || now,\n \"type_date\": `${body.requestType}~${body.update_time || now}`,\n \"last_status\": body.requestStatus || body.last_status || 'submitted',\n \"last_note\": body.notes || null\n };\n if (body.attachments && (body.attachments.length > 0)) {\n serviceRequestRec.attachments = body.attachments.map(a => { return a.Location; });\n }\n serviceRequestRec.composite_key = '';\n if (serviceRequestRec.foreign_key !== '') {\n serviceRequestRec.composite_key = serviceRequestRec.foreign_key + '%';\n }\n serviceRequestRec.composite_key += `${serviceRequestRec.request_type}%${serviceRequestRec.last_status}`;\n\n // WRITE REQUEST\n let goodWrite = true;\n cl({ 'adding ServiceRequestRec as': serviceRequestRec });\n await dbClient\n .put({\n Item: serviceRequestRec,\n TableName: \"ServiceRequests\"\n })\n .promise()\n .catch(error => {\n clt({ 'Bad put to ServiceRequests - caught error is': error });\n goodWrite = false;\n });\n\n // WRITE REQUEST LOG\n let requestLogRec = {\n \"client_id\": serviceRequestRec.client_id,\n \"log_time\": serviceRequestRec.last_update,\n \"activity\": serviceRequestRec.history[0],\n \"assigned_to\": serviceRequestRec.assigned_to,\n \"last_status\": serviceRequestRec.last_status,\n \"request_id\": serviceRequestRec.request_id,\n \"person\": await makeName(serviceRequestRec.requestor),\n \"requestor\": serviceRequestRec.requestor,\n \"request_type\": serviceRequestRec.request_type\n };\n await dbClient\n .put({\n Item: requestLogRec,\n TableName: \"ServiceRequestLog\"\n })\n .promise()\n .catch(error => {\n clt({ 'Bad put to ServiceRequestLog - caught error is': error });\n goodWrite = false;\n });\n\n // HANDLE MESSAGING IF NEEDED\n let messageResult = `No message sent`;\n if (goodWrite && body.messaging) {\n messageResult = await handleServiceRequestMessaging(body, serviceRequestRec);\n }\n\n return {\n 'request_id': serviceRequestRec.request_id,\n 'requestRec': serviceRequestRec,\n 'body': body,\n 'message': (goodWrite\n ? sentenceCase(`${body.requestType} request added for ${serviceRequestRec.on_behalf_of} - ${messageResult}`)\n : 'Request not added'\n )\n };\n}\n\nexport async function handleServiceRequestMessaging(body, serviceRequestRec) {\n /*\n SERVICE REQUEST FLOW (NEW) -\n Messaging attribute will be an object;\n The object will be keyed by request_status, ie. {\n submitted: [ {\n document_type: , \n distribution_method: {message: {}, print: {}, ...},\n test: []\n }, ... ],\n assigned: [],\n in_process: [],\n ...\n }\n Each array entry represents a different output that is associated with the Activity.\n For each individual messaging entry:\n 1. document_type (string) tells how to prepare the request data\n output -> string containing html, string containing plain text, & encoding from which a PDF can be rendered\n factForm (default) - 8 1/2 x 11 sheet primarily to list selections and options (this is the default)\n mealOrder - 8 1/2 x 11 factForm with wording and sequencing specifically required for a meal order\n document - 8 1/2 x 11 built primarily around template with selections used as variables \n singleTicket - 3\" format primarily for selections and options\n mealTicket - same as singleTicket \n none - no document output\n 2. distribution_method (object) tells how to distribute the results\n message - send using AVA\n {\n subject: text with variables that can be pointed at selections and options\n attachment_method: \"attachment\" (default) or \"link\" (if \"link\", key S3_save is implied)\n message_body: text with variables that can be pointed at selections and options\n force_method: always send via \"phone\", \"email\", \"text\"\n recipient_list: [array of AVA IDs to receive this message] (these can be variables such as author or obo)\n }\n print - when complete, send the output to a printer or open the print dialog on user's device\n {\n target: \"pop-up\" or \n }\n S3_save - save the document in S3\n {\n filename: text with variables that can be pointed at selections and options\n file_type: \n bucket: text with variables that can be pointed at selections and options\n }\n local_save - save the document locally in default downloads folder\n {\n filename: text with variables that can be pointed at selections and options\n file_type: \n }\n */\n let rTime = makeDate(new Date().getTime());\n let rMsg;\n if (Array.isArray(body.messaging)) { // if messaging is an array, send everything in the array\n let preparedMessages = await prepareMessage(body, serviceRequestRec);\n if (preparedMessages.length > 0) {\n preparedMessages.forEach((m, x) => { preparedMessages[x].thread_id = `svc_${body.requestType}/${body.requestID}`; });\n serviceRequestRec.messages = preparedMessages;\n serviceRequestRec.last_update = rTime.timestamp;\n let sendResults = (await sendMessages(preparedMessages)).pop(); // send all the messages in the queue. THe service request status will reflect the results of the last message (pop)\n if (!sendResults.sent) {\n serviceRequestRec.last_status = 'Failed to send';\n rMsg = `Attempt to send this request was unsuccessful.`;\n }\n else {\n rMsg = sendResults.message || `Successfully sent!`;\n }\n }\n if (('history' in serviceRequestRec) && Array.isArray(serviceRequestRec.history)) {\n serviceRequestRec.history.unshift(`${rMsg} (${rTime.oaDate})`);\n }\n else { serviceRequestRec.history = [`${rMsg} (${rTime.oaDate})`]; }\n await updateServiceRequest(serviceRequestRec);\n return rMsg;\n }\n else { // if messaging is an object, send only the key that matches the current status\n // are there instructions for this status?\n if (!body.messaging.hasOwnProperty(serviceRequestRec.last_status)) {\n return;\n }\n // we have one or more instructions to follow for this status\n let instructionList = [];\n if (Array.isArray(body.messaging[serviceRequestRec.last_status])) {\n instructionList.push(...body.messaging[serviceRequestRec.last_status]);\n }\n else {\n instructionList = [body.messaging[serviceRequestRec.last_status]];\n }\n for (let instructionNumber = 0; instructionNumber < instructionList.length; instructionNumber++) {\n let this_instruction = instructionList[instructionNumber];\n if (this_instruction.hasOwnProperty('test')) {\n this_instruction = handleTest(this_instruction, serviceRequestRec);\n }\n let SRDocument = await prepareSRDocuments(this_instruction.document_type, serviceRequestRec);\n await sendSRDocuments(this_instruction.distribution_method, SRDocument, serviceRequestRec);\n }\n return null;\n }\n\n function handleTest(this_instruction, serviceRequestRec) {\n return;\n }\n\n async function prepareSRDocuments(documentType, serviceRequestRec) {\n let SRDocuments = {};\n switch (documentType) {\n /*\n factForm - 8 1/2 x 11 sheet primarily to list selections and options (this is the default)\n mealOrder - 8 1/2 x 11 factForm with wording and sequencing specifically required for a meal order\n document - 8 1/2 x 11 built primarily around template with selections used as variables \n singleTicket - 3\" format primarily for selections and options\n mealTicket - same as singleTicket \n none - no document output\n */\n case 'factForm': {\n SRDocuments = await factForm(serviceRequestRec);\n break;\n }\n default: {\n\n }\n }\n return SRDocuments;\n }\n\n async function sendSRDocuments(distribution_method, SRDocObj, serviceRequestRec) {\n let methodList = Object.keys(distribution_method);\n for (let k = 0; k < methodList.length; k++) {\n switch (methodList[k]) {\n case 'message': {\n /*\n message - send using AVA messaging\n {\n subject: text with variables that can be pointed at selections and options\n attachment_method: \"attachment\" (default) or \"link\" (if \"link\", key S3_save is implied)\n message_body: text with variables that can be pointed at selections and options\n force_method: always send via \"phone\", \"email\", \"text\"\n recipient_list: [array of AVA IDs to receive this message] (these can be variables such as author or obo)\n }\n */\n let messageObj = {\n client: serviceRequestRec.client_id,\n author: serviceRequestRec.requestor,\n testMode: false,\n messageText: SRDocObj.plainText,\n htmlMessageText: SRDocObj.html,\n recipientList: distribution_method.message.recipient_list,\n subject: distribution_method.message.subject\n };\n if (distribution_method.message.attachment_method === 'link') {\n let goodS3 = true;\n let s3Resp = await s3\n .upload({\n Bucket: 'theseus-medical-storage',\n Key: `AVA_${serviceRequestRec.request_id.replace('~', '_')}.pdf`,\n Body: SRDocObj.pdf.output('blob'),\n ACL: 'public-read-write',\n ContentType: 'application/pdf'\n })\n .promise()\n .catch(err => {\n cl(`PDF not saved by AVA. The reason is ${err.message}`);\n goodS3 = false;\n });\n if (goodS3) {\n messageObj.attachments = [s3Resp.Location];\n }\n }\n else {\n messageObj.attachment_data = {\n filename: `AVA_${serviceRequestRec.request_id.replace('~', '_')}.pdf`,\n content: SRDocObj.pdf.output('blob'),\n type: 'application/pdf',\n disposition: 'attachment',\n content_id: serviceRequestRec.local_key\n };\n }\n if (distribution_method.message.force_method) {\n messageObj.preffered_method = distribution_method.message.force_method;\n }\n sendMessages(messageObj);\n break;\n }\n default: {\n\n }\n }\n }\n }\n}\n\nexport async function printServiceRequest(serviceRequestRecsIn, options = {}) {\n let requestsIn = [];\n let requestList = [];\n if (Array.isArray(serviceRequestRecsIn)) { requestsIn.push(...serviceRequestRecsIn); }\n else { requestsIn.push(serviceRequestRecsIn); }\n let remembered_customizationsRec;\n let remembered_activityRec = {};\n for (let r = 0; r < requestsIn.length; r++) {\n let serviceRequestRec = requestsIn[r];\n if (!serviceRequestRec.activity_key) {\n if (!remembered_customizationsRec) {\n remembered_customizationsRec = await dbClient\n .get({\n Key: { client_id: serviceRequestRec.client_id, custom_key: 'service_request_types' },\n TableName: \"Customizations\"\n })\n .promise()\n .catch(error => { cl(`***ERR reading Customizations*** caught error is: ${error}`); });\n }\n if (recordExists(remembered_customizationsRec)) {\n serviceRequestRec.activity_key = remembered_customizationsRec.Item.customization_value[serviceRequestRec.request_type].activity_code;\n }\n }\n if (!remembered_activityRec.hasOwnProperty(serviceRequestRec.activity_key) || !remembered_activityRec[serviceRequestRec.activity_key]) {\n remembered_activityRec[serviceRequestRec.activity_key] = await getActivity(serviceRequestRec.client_id, serviceRequestRec.activity_key);\n }\n let activityRec = remembered_activityRec[serviceRequestRec.activity_key];\n if (!(activityRec.hasOwnProperty('activity_code'))) {\n return {\n 'success': false,\n 'message': `AVA could not find enough information for this request (key=${serviceRequestRec.activity_key})`\n };\n }\n let body = Object.assign({}, activityRec, serviceRequestRec, serviceRequestRec.original_request);\n if (body.alternate_messaging && options.request_type && body.alternate_messaging.hasOwnProperty(options.request_type)) {\n body.messaging = deepCopy(body.alternate_messaging[options.request_type]);\n }\n if (body.messaging) {\n requestList.push(Object.assign({}, body, options));\n }\n }\n if (requestList.length > 1) {\n requestList.forEach((r, x) => {\n requestList[x].multiPrint = {\n firstDoc: (x === 0),\n lastDoc: (x === (requestList.length - 1))\n };\n // requestList[x].overrideMethod = 'print';\n });\n }\n let success = true;\n if (requestList.length > 0) {\n let preparedMessages = await prepareMessage(requestList);\n if (preparedMessages.length > 0) {\n for (let x = 0; x < preparedMessages.length; x++) {\n let this_message = preparedMessages[x];\n this_message.thread_id = `svc_${requestList[0].request_type || requestList[0].requestType}/${requestList[0].request_id || requestList[0].requestID}`;\n if (this_message.preferred_method === 'email') {\n await sendMessages(this_message);\n }\n };\n return {\n success,\n preparedMessages, // ***** RAY ***** this is where we could merge output to a single document for later printing\n 'message': `Job complete! (${requestList.length} request${(requestList.length > 1) ? 's' : ''} prepared to print.)`\n };\n };\n }\n return {\n 'success': false,\n 'message': `Nothing to print`\n };\n}\n\nexport async function updateServiceRequest(body) {\n // body is a single, or an array of, service request records\n let unProcessed = [];\n let logRec = [];\n let x = 0;\n for (let r of makeArray(body)) {\n unProcessed.push({\n \"PutRequest\": {\n \"Item\": r\n }\n });\n logRec.push({\n \"PutRequest\": {\n \"Item\": {\n \"client_id\": r.client_id,\n \"log_time\": r.last_update + x++,\n \"activity\": r.history[0],\n \"assigned_to\": r.assigned_to,\n \"last_status\": r.last_status,\n \"request_id\": r.request_id,\n \"person\": await makeName(r.requestor),\n \"requestor\": r.requestor,\n \"request_type\": r.request_type,\n \"last_visited\": r.last_visited\n }\n }\n });\n };\n let initialCount = unProcessed.length;\n let finalCount = 0;\n let retryNeeded;\n let retryCount = 0;\n do {\n let this_Request_group = [];\n let this_Log_group = [];\n let failedItems = [];\n let r;\n for (r = 0; ((r < unProcessed.length) && (r < 10)); r++) {\n this_Request_group.push(unProcessed[r]);\n this_Log_group.push(logRec[r]);\n }\n unProcessed.splice(0, r);\n logRec.splice(0, r);\n retryNeeded = false;\n finalCount += r;\n let requestObject = {\n RequestItems: {\n 'ServiceRequests': this_Request_group,\n 'ServiceRequestLog': this_Log_group\n }\n };\n let goodWrite = true;\n let writeResponse = await dbClient\n .batchWrite(requestObject)\n .promise()\n .catch(error => {\n clt({ 'Bad batch write on ServiceRequests - caught error is': error });\n this_Request_group.forEach(k => {\n clt(`request_id = ${k.PutRequest.Item.request_id}`);\n });\n this_Log_group.forEach(k => {\n clt(`log_time = ${k.PutRequest.Item.log_time}`);\n });\n goodWrite = false;\n });\n if (writeResponse\n && ('UnprocessedItems' in writeResponse)\n && (Object.keys(writeResponse.UnprocessedItems)).length > 0) {\n failedItems.push(...writeResponse.UnprocessedItems);\n finalCount -= writeResponse.UnprocessedItems.length / 2;\n retryNeeded = true;\n }\n if (!goodWrite) {\n finalCount -= r;\n }\n if (unProcessed.length > 0) {\n retryNeeded = true;\n }\n if (retryNeeded) {\n retryCount++;\n }\n } while (retryNeeded && (retryCount < 5));\n let returnMessage = '';\n if (finalCount >= initialCount) {\n returnMessage = `Successfully updated ${initialCount} Request record${(initialCount > 1) ? 's' : ''}`;\n }\n else if (finalCount <= 0) {\n returnMessage = `Failed to update Request record${(initialCount > 1) ? 's' : ''}`;\n }\n else {\n returnMessage = `Updated ${finalCount} of ${initialCount} Request records`;\n }\n return returnMessage;\n}\n\nexport function formatServiceRequestDetails(pInput, options = {}) {\n let this_request;\n let total_fees = 0;\n /* \n TAKES INPUT IN THIS FORMAT\n { \n selections: [\n of the form \"selection (choice, choice, ...)\"\n ], \n qualifiers: {\n : {\n : [\n ,\n ,\n ...\n ],\n ...\n },\n ...\n },\n textInput: {\n : \n }, \n options: {\n : {\n : [\n : or ,\n ...\n ],\n ...\n }\n }\n }\n }\n\n AND PRODUCES OUTPUT AS\n {\n selection: [\n option1,\n option2,\n text,\n ...\n ],\n ...\n }\n */\n if (pInput.hasOwnProperty('request_id')) { // passed in pInput as an entire ServiceRequest record\n this_request = pInput.original_request;\n }\n else if (pInput.hasOwnProperty('rowDetails')) {\n /*\n rowDetails[\n {\n text: (the actual selection text, such as \"Chopped Steak\" or \"Pancake Platter\")\n isChecked: ,\n qualSelections: {\n option: {\n choice: or \n }\n },\n textValue: \n }, ...\n ],\n */ \n this_request = {\n selections: [],\n options: {},\n textInput: {},\n rowType: {},\n fees: {}\n };\n pInput.rowDetails.forEach(row => {\n if (row.isChecked || row.textValue) {\n let selection = row.text.trim();\n this_request.selections.push(selection);\n this_request.options[selection] = row.qualSelections;\n this_request.textInput[selection] = row.textValue;\n this_request.rowType[selection] = row.input;\n if (options.includeFees) {\n if (row.fee) {\n this_request.fees[selection] = row.fee;\n }\n if (row.moreInfo && row.moreInfo.fee) {\n this_request.fees[selection] = row.moreInfo.fee;\n }\n if (row.qualData) {\n row.qualData.forEach(type => {\n if (type.option && Array.isArray(type.option)) {\n type.option.forEach(option => {\n if (option.fee) {\n this_request.fees[`${selection}~${option.display}`] = option.fee;\n }\n });\n }\n });\n }\n }\n }\n });\n }\n else {\n this_request = pInput;\n }\n let requestDetailsObj = {};\n if (this_request.selections) {\n this_request.selections.forEach(s => {\n let selection = s;\n let choices = [];\n let qualifiers = [];\n if (!this_request.textInput[s]) {\n let unTrimmed_selection = s;\n // [unTrimmed_selection, ...choices] = s.split(/[();,]/);\n selection = unTrimmed_selection.trim();\n }\n if (this_request.qualifiers?.[selection]) {\n Object.values(this_request.qualifiers?.[selection]).forEach(v => {\n if (this_request.fees[`${selection}~${v}`]) {\n let this_fee = Number(this_request.fees[`${selection}~${v}`]);\n v += ' (' + new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n }).format(this_fee) + ')';\n total_fees += this_fee;\n }\n qualifiers.push(...v);\n });\n };\n for (let this_option in this_request.options?.[selection]) {\n for (let this_choice in this_request.options?.[selection][this_option]) {\n if (typeof (this_request.options?.[selection][this_option][this_choice]) === 'boolean') {\n if (this_request.options?.[selection][this_option][this_choice]) {\n if (this_request.fees[`${selection}~${this_choice}`]) {\n let this_fee = Number(Number(this_request.fees[`${selection}~${this_choice}`]));\n this_choice += ' (' + new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n }).format(this_fee) + ')';\n total_fees += this_fee;\n }\n qualifiers.push(this_choice);\n }\n }\n else {\n let pushIt = this_request.options?.[selection][this_option][this_choice];\n if (this_request.fees[`${selection}~${this_choice}`]) {\n let this_fee = Number(this_request.fees[`${selection}~${this_choice}`]);\n pushIt += ' (' + new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n }).format(this_fee) + ')';\n total_fees += this_fee;\n }\n qualifiers.push(pushIt);\n }\n };\n }\n let options = [];\n if (this_request.fees?.[selection]) {\n let this_fee = Number(this_request.fees?.[selection]);\n options.push(new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n }).format(this_fee));\n total_fees += this_fee;\n };\n (choices.concat(qualifiers)).forEach(e => {\n if (e && !options.includes(e.trim())) {\n options.push(e.trim());\n return;\n }\n });\n requestDetailsObj[selection] = options;\n\n });\n }\n for (let selection in this_request.textInput) {\n if (this_request.textInput[selection]) {\n if (!requestDetailsObj[selection]) {\n requestDetailsObj[selection] = [];\n };\n if ((this_request.rowType[selection] !== 'obo') || (requestDetailsObj[selection].length === 0)) {\n requestDetailsObj[selection].push(this_request.textInput[selection]);\n }\n }\n }\n if (total_fees > 0) {\n let fee_string = new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n }).format(total_fees)\n requestDetailsObj[`Total: ${fee_string}`] = [];\n }\n return requestDetailsObj;\n}\n\nexport async function formatServiceRequest(inboundRequest) {\n let requestList = [];\n if (Array.isArray(inboundRequest)) {\n requestList.push(...inboundRequest);\n }\n else {\n requestList = [inboundRequest];\n }\n let final_result = [];\n\n for (let rN = 0; rN < requestList.length; rN++) {\n let this_request = requestList[rN];\n let result = {\n print: {\n data: {},\n format: [],\n job: []\n },\n message_history: []\n };\n /*\n result: {\n error: ,\n print: {\n data: {\n title: \n client_name:\n logo:\n creator_id:\n creator_name:\n request_person_name:\n request_person_id:\n request_person_rec:\n created_time: \n onBehalfOf_name\n requestDetails: {\n selection: [\n option,\n ...\n ],\n ...\n }\n request_id\n },\n format: [, ...] \n },\n message_history: [\n {\n thread_id: \n recipients: [, ...]\n },\n ...\n ],\n request_status: {\n current:\n history: [, ...]\n }\n }\n */\n\n // what we find inside this_request could be a string, an array of stuff, or an object\n if (this_request.original_request || this_request.history || this_request.messages) {\n // assume that a good SR record was passed in\n }\n else if (this_request.rowDetails) {\n // assume that a SR under construction was passed in and let it build (if possible) from the data passed in\n }\n else {\n // assume that the args provided a reference to one or more SRs\n let returnedRequests = await getServiceRequests({\n client_id: this_request.client,\n request_id: this_request.requestID\n });\n if (returnedRequests.length === 0) {\n return { error: true };\n }\n else if (returnedRequests.length === 1) {\n this_request = deepCopy(returnedRequests[0]);\n }\n else {\n requestList.splice(rN, 1, ...returnedRequests);\n this_request = deepCopy(returnedRequests[0]);\n }\n }\n\n let sessionObject = JSON.parse(sessionStorage.getItem('AVASessionData'));\n if (!this_request.client_id && !this_request.client) {\n this_request.client_id = sessionObject?.currentSession?.client_id;\n this_request.client = sessionObject?.currentSession?.client_id;\n }\n if (this_request.request_type && !this_request.requestTypeRec) {\n this_request.requestTypeRec =\n await getCustomizations(\n 'service_request_types',\n this_request.client_id).customization_value?.[this_request.request_type];\n }\n if (!this_request.activityRec) {\n this_request.activityRec =\n await getActivity(\n this_request.client_id || this_request.client,\n (this_request.activity_key || this_request.activity_id || this_request.requestTypeRec?.activity_code));\n }\n\n result.print.data.request_id = this_request.request_id;\n\n result.print.data.title = this_request.title\n || this_request.pdf?.title\n || this_request.subject\n || this_request.format?.subject\n || this_request.requestTypeRec?.description\n || this_request.activityRec?.name\n || 'AVA Senior Living';\n result.print.data.title = (await resolveMessageVariables(result.print.data.title, this_request)).replace(/\\(.+\\)/g, '').trim();\n\n if (this_request.reprint) {\n result.print.data.title = `*** REPRINT ${result.print.data.title} ***`;\n };\n\n result.print.data.client_id = this_request.client_id;\n\n result.print.data.client_name = this_request.client_name\n || sessionObject?.currentSession?.client_name\n || `Client ${this_request.client_id}`;\n\n result.print.data.logo = this_request.client_logo\n || this_request.logo\n || sessionObject.currentSession?.client_logo\n || await getCustomizations('logo', this_request.client_id)?.icon;\n\n result.print.data.created = {};\n\n result.print.data.creator_id =\n (this_request.request_id ? this_request.request_id.split('~').shift() : null)\n || this_request.user_id\n || this_request.userID\n || this_request.requestor\n || this_request.session.user_id\n || sessionObject?.currentSession?.user_id;\n\n result.print.data.creator_name = this_request.author_name\n || this_request.user_name\n || this_request.userName\n || await makeName(result.print.data.creator_id);\n\n result.print.data.request_person_id = this_request.requestor\n || this_request.patient_id\n || this_request.patientID\n || this_request.session.patient_id\n || sessionObject?.currentSession?.patient_id;\n\n result.print.data.request_person_rec = await getPerson(result.print.data.request_person_id);\n result.print.data.request_person_name =\n await makeName(result.print.data.request_person_rec);\n\n result.print.data.created_time = makeDate(this_request.request_date);\n\n result.print.data.onBehalfOf_name = this_request.on_behalf_of\n || this_request.onBehalfOf;\n\n if (!result.print.data.onBehalfOf_name) {\n this_request.obo_key = this_request?.activityRec?.default_value?.onBehalfOf\n || this_request?.activityRec?.default_value?.global_defaults?.onBehalfOf\n || this_request?.activityRec?.default_value?.activities?.global_defaults?.onBehalfOf;\n result.print.data.onBehalfOf_name = this_request?.original_request?.textInput?.[this_request.obo_key];\n if (!result.print.data.onBehalfOf_name && this_request.rowDetails) {\n this_request.rowDetails.forEach(row => {\n if (row.isChecked && (row.text.trim() === this_request.obo_key)) {\n result.print.data.onBehalfOf_name = row.textValue;\n }\n });\n }\n else {\n result.print.data.onBehalfOf_name = result.print.data.request_person_name;\n };\n }\n\n result.print.data.requestDetails = formatServiceRequestDetails(this_request);\n\n result.print.format = [];\n makeArray(this_request.activityRec.messaging).forEach(m => {\n if (!result.print.format.includes(m.format.type)) {\n result.print.format.push(m.format.type);\n }\n });\n\n for (let m = 0; m < this_request.messages.length; m++) {\n if (this_request.messages[m].record_type === 'delivery') {\n result.message_history.push({\n thread_id: this_request.messages[m].thread_id,\n recipients: await messageHistory(this_request.messages[m])\n });\n }\n }\n\n result.request_status = {\n current: this_request.last_status,\n history: this_request.history\n };\n\n final_result.push(result);\n }\n return final_result;\n}\n\nexport function validRequestStatus(pRequestType, pStatus, currentSession) {\n // let rType = JSON.parse(sessionStorage.AVASessionData).currentSession?.service_request_types[pRequestType];\n let rType = currentSession.service_request_types[pRequestType];\n if (!rType || !rType.statusList) {\n return false;\n }\n else {\n return rType.statusList.some(v => {\n return (v.value.toLowerCase() === pStatus.toLowerCase());\n });\n }\n}\n","\nimport { clt, cl, s3, recordExists, titleCase, uuid, isObject, listFromArray, array_in_array, makeArray, sentenceCase, dbClient, deepCopy, getObject } from './AVAUtilities';\nimport { getPerson, makeName } from './AVAPeople';\nimport { getGroupsBelongTo } from './AVAGroups';\nimport { getCustomizations, getObject64 } from './AVAUtilities';\nimport { getServiceRequests, formatServiceRequestDetails } from './AVAServiceRequest';\nimport { getObservationItems } from './AVAObservations';\nimport { makeDate } from './AVADateTime';\n\nimport { jsPDF } from \"jspdf\";\n\nlet page = {};\nlet pdfCurrent = {};\nlet doc;\n\n// Functions\n\nexport async function getMessages(body) {\n let qT = body.thread_id || body.thread;\n let qQ = {\n TableName: 'TheseusMessages',\n KeyConditionExpression: 'thread_id = :t',\n ExpressionAttributeValues: { ':t': qT },\n ScanIndexForward: false\n };\n if (body.hasOwnProperty('key') || body.hasOwnProperty('composite_key')) {\n qQ.KeyConditionExpression += ' AND begins_with(composite_key, :c)';\n qQ.ExpressionAttributeValues[':c'] = body.key || body.composite_key;\n }\n if (body.hasOwnProperty('type') || body.hasOwnProperty('record_type')) {\n qQ.FilterExpression = 'record_type = :y';\n qQ.ExpressionAttributeValues[':y'] = body.type || body.record_type;\n }\n let qR = await dbClient\n .query(qQ)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n clt(`Security Violation or no Internet Connection`);\n }\n clt({ 'Error reading TheseusMessages': error });\n });\n if (recordExists(qR)) {\n return qR.Items;\n }\n else { return []; }\n}\n\nexport async function prepareMessage(inBodyData, requestRec = {}) {\n let bodyList = [];\n let messageList = [];\n let results;\n let returnResults = [];\n if (Array.isArray(inBodyData)) { bodyList.push(...inBodyData); }\n else { bodyList.push(inBodyData); }\n do {\n let inBody = bodyList.shift();\n messageList = [];\n if (Array.isArray(inBody.messaging)) { messageList.push(...inBody.messaging); }\n else { messageList.push(inBody.messaging); }\n // returnResults = []; why is this here?\n results = null;\n let requestInfo = Object.assign({}, inBody, {\n activityName: inBody.activityName || inBody.name,\n client: inBody.client || inBody.client_id,\n author: inBody.author || inBody.requestor,\n onBehalfOf: inBody.onBehalfOf || inBody.on_behalf_of,\n local_key: inBody.local_key,\n requestDate: inBody.requestDate || inBody.request_date,\n requestID: inBody.requestID || inBody.request_ID || inBody.request_id,\n selections: inBody.selections,\n qualifiers: inBody.qualifiers,\n textInput: inBody.textInput,\n reprint: inBody.reprint,\n overrideMethod: inBody.overrideMethod\n },\n inBody.original_request,\n inBody.request);\n // about Attachments...\n // \"attachments\" are URLs that will be hyperlinked to from the body of the message\n // these URLs may have come along with the message or be created below\n // This is our non-traditional way of sending links to resources in the body of a message\n // \"attachment_data\" is what is needed to create a traditional attached file in the message\n // and is only present when the activity lists attachment_method = 'file'\n if (inBody.hasOwnProperty('attachments')) {\n requestInfo.attachments = inBody.attachments.map(a => {\n if (typeof (a) === 'string') {\n return a;\n }\n else if (isObject(a)) {\n return a.Location;\n }\n else {\n return '';\n }\n });\n }\n let needMultiPrint = (messageList.length > 1);\n let firstDoc = true;\n // if multi print, put types that need to be bundled together at the bottom of the list \n messageList.sort((a, b) => {\n if (!a.format || ['mealOrder', 'checklist', 'factForm'].includes(a.format.type)) {\n return 1;\n }\n return -1;\n });\n do {\n let this_request = Object.assign({}, requestInfo, messageList.shift()); // this removes the message from the messageList\n if (needMultiPrint) {\n this_request.multiPrint = {\n firstDoc,\n lastDoc: (messageList.length === 0)\n };\n }\n results = {};\n if (Array.isArray(this_request.recipientList)) { results.recipientList = [...this_request.recipientList]; }\n else { results.recipientList = [this_request.recipientList]; }\n for (let i = 0; i < results.recipientList.length; i++) {\n results.recipientList[i] = await resolveMessageVariables(results.recipientList[i], this_request);\n }\n results.client = this_request.client;\n results.author = this_request.author;\n results.preferred_method = this_request.overrideMethod || this_request.format?.method || this_request.method;\n if (!('format' in this_request)) {\n this_request.format = { 'type': 'factForm' };\n }\n if (this_request.format.method === 'hold') {\n continue;\n }\n if ('subject' in this_request.format) {\n results.subject = this_request.format.subject;\n }\n switch (this_request.format.type) {\n case 'mealOrder':\n case 'checklist':\n case 'factForm': {\n [results.htmlText, results.messageText, results.pdfInfo] = await formatRequestDetails(this_request, this_request.format.type);\n firstDoc = false;\n if ((this_request.messaging.hasOwnProperty('attachment_method')\n && (this_request.messaging.attachment_method === 'file')) ||\n (this_request.hasOwnProperty('attachment_method')\n && (this_request.attachment_method === 'file'))) {\n results.attachment_data = {\n filename: results.pdfInfo.key,\n content: results.pdfInfo.data,\n type: 'application/pdf',\n disposition: 'attachment',\n content_id: this_request.local_key\n };\n // results.htmlText = 'See attached';\n // results.messageText = 'See attached';\n }\n break;\n }\n case 'document': {\n [results.htmlText, results.messageText, results.pdfInfo] = await buildDocument(this_request);\n results.attachments = deepCopy(results.pdfInfo);\n requestInfo.attachments = results.pdfInfo;\n if ((this_request.messaging.hasOwnProperty('attachment_method')\n && (this_request.messaging.attachment_method === 'file')) ||\n (this_request.hasOwnProperty('attachment_method')\n && (this_request.attachment_method === 'file'))) {\n results.attachment_data = {\n filename: results.pdfInfo.key,\n content: results.pdfInfo.data,\n type: 'application/pdf',\n disposition: 'attachment',\n content_id: this_request.local_key\n };\n // results.htmlText = 'See attached';\n // results.messageText = 'See attached';\n }\n break;\n }\n case 'singleTicket':\n case 'mealTicket': {\n [results.htmlText, results.messageText, results.attachments] = await mealTicketFormat(this_request, requestRec);\n if (results.attachments) {\n requestInfo.attachments = results.attachments;\n if (this_request.messaging.hasOwnProperty('attachment_method')\n && (this_request.messaging.attachment_method === 'file')) {\n results.attachment_data = {\n filename: `MealTicket-${this_request.local_key}.pdf`,\n content: results.attachments.data,\n type: 'application/pdf',\n disposition: 'attachment',\n content_id: this_request.local_key\n };\n }\n }\n break;\n }\n case 'inBody': {\n results.htmlText = inBody.htmlText;\n results.messageText = inBody.messageText;\n break;\n }\n case 'plainText':\n default: {\n results.messageText = await resolveMessageVariables(this_request.format.text, this_request) + ' ** AVA **';\n results.htmlText = results.messageText;\n }\n }\n if ('test' in this_request) {\n let ruleStatus = await processRules(this_request);\n if (ruleStatus === 'cancel') { continue; }\n }\n if (results.subject) {\n results.subject = await resolveMessageVariables(results.subject, this_request);\n }\n results.messageText = results.messageText.replace('** AVA **', '').trim();\n results.htmlText = results.htmlText.replace('** AVA **', '').trim();\n\n if (requestInfo.hasOwnProperty('attachments')) {\n results.htmlText += '
';\n if (!(Array.isArray(requestInfo.attachments))) {\n if (requestInfo.attachments.hasOwnProperty('Location')) {\n results.messageText += `\\r\\n\\nAttachment ${requestInfo.attachments.Key}: ${requestInfo.attachments.Location}`;\n results.htmlText += `
Attachment: ${requestInfo.attachments.Key}`;\n }\n }\n else {\n // eslint-disable-next-line\n requestInfo.attachments.forEach((a, x) => {\n let fNArr = a.split('/').pop().split('.');\n fNArr.pop();\n let fName = decodeURI(fNArr.join('.'));\n results.messageText += `\\r\\n\\nAttachment ${fName}: ${a}`;\n results.htmlText += `
Attachment: ${fName}`;\n });\n }\n }\n\n returnResults.push(results);\n } while (messageList.length > 0);\n } while (bodyList.length > 0);\n\n return returnResults;\n\n /**************************/\n\n async function processRules(requestToTest) {\n let skipTo = false;\n for (let b = 0; b < requestToTest.test.length; b++) {\n let t = requestToTest.test[b];\n if (skipTo) {\n if (!requestToTest.id || skipTo !== requestToTest.id) { continue; }\n else { skipTo = false; }\n }\n let thenArray = [];\n let passedTest = false;\n if (!t.test) { // No test condition? Testing to see if the t.check was selected\n if (requestToTest.selections) {\n if (makeArray(requestToTest.selections).some(s => {\n return s.includes(t.check);\n })) {\n passedTest = true;\n }\n }\n else if (requestToTest.textInput && requestToTest.textInput.hasOwnProperty(t.check)) { passedTest = true; }\n }\n // there is a test condition\n else if (requestToTest.textInput && (requestToTest.textInput.hasOwnProperty(t.check))) { // checking text input against t.test\n if (requestToTest.textInput[t.check].toLowerCase().includes(t.test.toLowerCase())) { passedTest = true; }\n }\n else if (t.check) { // resolve whatever is being checked and test it against t.test (or array of t.tests)\n let resolved = await resolveMessageVariables(t.check, requestToTest);\n if (resolved) {\n if (Array.isArray(t.test)) {\n passedTest = t.test.some(v => {\n if (!(resolved.toLowerCase().includes(v.value.toLowerCase()))) { return false; }\n t.then = v.then;\n t.else = v.else;\n return true;\n });\n }\n else if (resolved.toLowerCase().includes(t.test.toLowerCase())) { passedTest = true; }\n }\n }\n else { passedTest = false; }\n if (passedTest && ('then' in t)) {\n if (!Array.isArray(t.then)) { thenArray = [t.then]; }\n else { thenArray = t.then; }\n }\n else if (!passedTest && ('else' in t)) {\n if (!Array.isArray(t.else)) { thenArray = [t.else]; }\n else { thenArray = t.else; }\n }\n for (let i = 0; i < thenArray.length; i++) {\n let rule = thenArray[i];\n switch (rule.instruction) {\n case 'add_recipient':\n case 'add_recipients': {\n if (Array.isArray(rule.value)) { results.recipientList.push(...rule.value); }\n else { results.recipientList.push(rule.value); }\n break;\n }\n case 'replace_recipient':\n case 'replace_recipients': {\n if (Array.isArray(rule.value)) {\n if (rule.value.length === 0) { results.recipientList = []; }\n else { results.recipientList = [...rule.value]; }\n }\n else {\n if (!rule.value) { results.recipientList = []; }\n else { results.recipientList = [rule.value]; }\n }\n break;\n }\n case 'remove_recipient':\n case 'remove_recipients': {\n if (Array.isArray(rule.value)) {\n rule.value.forEach(v => {\n let foundAt = results.recipientList.indexOf(v);\n if (foundAt >= 0) { results.recipientList.splice(foundAt, 1); }\n });\n }\n else {\n let foundAt = results.recipientList.indexOf(rule.value);\n if (foundAt >= 0) { results.recipientList.splice(foundAt, 1); }\n }\n break;\n }\n case 'urgency': {\n results.urgent = rule.value;\n break;\n }\n case 'subject': {\n results.subject = rule.value;\n break;\n }\n case 'method':\n case 'override_method': {\n results.preferred_method = rule.value;\n break;\n }\n case 'add_message': {\n let custom_text = await resolveMessageVariables(rule.value, requestToTest);\n results.messageText = results.messageText.replace('** AVA **', `${custom_text} ** AVA **`);\n results.htmlText = results.htmlText.replace('** AVA **', `${custom_text} ** AVA **`);\n break;\n }\n case 'skip_to': {\n skipTo = rule.value;\n break;\n }\n case 'replace_message':\n case 'create_message': {\n messageList.push(rule.value);\n break;\n }\n case 'cancel_message': {\n return 'cancel';\n }\n default: { }\n }\n }\n }\n };\n\n}\n\nexport async function resolveMessageVariables(inString = '', body) {\n // extract first variable\n let workString = inString;\n let loopCount = 0;\n while (workString.includes('<') && (loopCount < 10)) {\n let [front, rest] = workString.split(/<(.*)/);\n let [variable, back] = rest.split(/>(.*)/);\n switch (variable) {\n case 'client': {\n workString = `${front}${body.client}${back}`;\n break;\n }\n case 'author': {\n workString = `${front}${await makeName(body.author)}${back}`;\n break;\n }\n case 'person':\n case 'patient':\n case 'name': {\n workString = `${front}${body.onBehalfOf || await makeName(body.author)}${back}`;\n break;\n }\n case 'activityName':\n case 'activity': {\n workString = `${front}${body.activityName}${back}`;\n break;\n }\n case 'env':\n case 'environment': {\n let env = window.location.href.split('//')[1].charAt(0).toLowerCase();\n workString = `${front}${env}${back}`;\n break;\n }\n case 'memberOf': {\n let gList = await getGroupsBelongTo(body.client, body.author);\n workString = `${front}${Object.keys(gList).join(' ~ ')}${back}`;\n break;\n }\n case 'location': {\n let pMe = await getPerson(body.author);\n workString = `${front}${pMe.location}${back}`;\n break;\n }\n case 'event_location': {\n if (body.location) { workString = `${front}${body.location}${back}`; };\n break;\n }\n case 'event_description': {\n if (body.description) { workString = `${front}${body.description}${back}`; };\n break;\n }\n case 'event_date': {\n if (body.event) { workString = `${front}${makeDate(body.event.split('#')[1]).absolute}${back}`; };\n break;\n }\n case 'person_id':\n case 'patient_id':\n case 'requestor':\n case 'self':\n case 'user': {\n if (body.hasOwnProperty('requestID')) {\n workString = `${front}${body.requestID.split('~')[0]}${back}`;\n }\n else { workString = `${front}${body.author}${back}`; }\n break;\n }\n case 'selections': {\n workString = `${front}${listFromArray(body.selections)}${back}`;\n break;\n }\n default: {\n if (body.hasOwnProperty(variable)) {\n workString = `${front}${body[variable]}${back}`;\n }\n else if (variable.trim().toLowerCase().startsWith('date=')) {\n let [dDate, dType] = variable.split('=')[1].split(':');\n if (body.hasOwnProperty(dDate)) {\n dDate = body[dDate];\n }\n let keyDate = makeDate(dDate);\n if (!keyDate.error) { workString = `${front}${keyDate[dType || 'absolute']}${back}`; }\n else { workString = `${front}\"${variable}\"${back}`; }\n }\n else if (variable.trim().toLowerCase().startsWith('if ')) {\n let [if$, then$] = variable.trim().slice(2).split(':');\n if (body.selections.includes(if$.trim())) { workString = then$.trim(); }\n else { workString = ''; }\n }\n else if (body.hasOwnProperty('textInput') || body.hasOwnProperty('qualifiers')) {\n if (variable.startsWith('value')) { variable = variable.split(':')[1]; }\n let r = '';\n if (body.hasOwnProperty('textInput') && (variable in body.textInput)) {\n r = body.textInput[variable];\n }\n else if (body.hasOwnProperty('qualifiers')) {\n let qObj = {};\n for (let q in body.qualifiers) {\n Object.assign(qObj, body.qualifiers[q]);\n }\n if (variable in qObj) { r = listFromArray(qObj[variable]); };\n }\n workString = `${front}${r}${back}`;\n }\n else {\n let [dDate, dType] = variable.split(':');\n if (body.hasOwnProperty(dDate)) {\n dDate = body[dDate];\n }\n let keyDate = makeDate(dDate);\n if (!keyDate.error) { workString = `${front}${keyDate[dType || 'absolute']}${back}`; }\n else { workString = `${front}\"${variable}\"${back}`; }\n }\n }\n }\n loopCount++;\n }\n return workString;\n};\n\nexport async function formatRequestDetails(body, summaryType) {\n // Standard 8.5 x 11 output for a Request of any type\n // Prep the PDF output\n if (!body.margin) { body.margin = {}; }\n await pdfLaunch(Object.assign({}, body, { client_id: (body.client || body.client_id) }));\n\n let textInput = {};\n if (body.textInput && (Object.keys(body.textInput).length > 0)) {\n textInput = Object.assign({}, body.textInput);\n }\n\n let htmlMessage = `

${page.title}

`;\n let rawMessage = `${page.title}\\n\\r`;\n pdfLine(' ', { align: 'center', image: pdfCurrent.logo });\n pdfLine(page.title, { style: 'bold', size: 'large', align: 'center', after: 1 });\n\n // Person\n let pRec = await getPerson(body.author);\n\n let authorName = await makeName(body.author);\n let pName = (body.onBehalfOf || authorName).replace(/\\(.+\\)/g, '').trim(); // this removes anything inside parenthesis\n // does the title contain all of the words in the obo?\n let tLower = page.title.toLowerCase();\n let oboWords = pName.toLowerCase().split(/\\s+/);\n let allWordsAppear = oboWords.every(oboWord => {\n return (tLower.includes(oboWord));\n });\n if (!allWordsAppear) {\n htmlMessage += `

${pName}`;\n rawMessage += `${pName}\\n`;\n pdfLine(`for ${pName}`, { style: 'normal', align: 'center', size: 'large' });\n }\n\n if (pRec.location) {\n // let locNum = parseNumeric(pRec.location);\n // if (locNum.hasNumbers) {\n // pRec.location = `Apt ${locNum.value}`;\n // }\n htmlMessage += `
${pRec.location}`;\n rawMessage += `${pRec.location}\\n`;\n pdfLine(pRec.location, { align: 'center' });\n }\n htmlMessage += `

`;\n\n if (!body.requestDate) { body.requestDate = new Date(); }\n let pDateTime = makeDate(body.requestDate).absolute;\n\n // get creator info - most reliable spot is first characters of the request id\n let creator_id = (body.request_id || body.requestID || body.author).split('~')[0];\n if (creator_id !== body.author) {\n pDateTime += ` by ${await makeName(creator_id)}`;\n }\n htmlMessage += `

created: ${pDateTime}`;\n rawMessage += `${pDateTime}\\n\\r`;\n pdfLine(`created: ${pDateTime}`, { size: 'medium', align: 'center' });\n\n for (let cTyp in pRec.messaging) {\n if ((pRec[cTyp]) && (pRec[cTyp].trim() !== '')) {\n let cLab;\n switch (cTyp) {\n case 'sms': { cLab = 'cell'; break; }\n case 'voice': { cLab = 'home'; break; }\n case 'email': { cLab = 'e-Mail'; break; }\n default: { cLab = cTyp; }\n }\n htmlMessage += `
${cLab}: ${pRec[cTyp]}`;\n pdfLine(`${pRec[cTyp]}`, { align: 'center' });\n }\n }\n pdfDown(2);\n\n htmlMessage += '

** AVA **

';\n rawMessage += '\\n\\r** AVA **\\n\\r';\n\n let spaceBetweenLines = 25;\n if (body.selections.length > 7) { spaceBetweenLines = 125 / (body.selections.length - 2); }\n\n let renderCheckBox = '';\n if (summaryType === 'mealOrder') {\n // special selections\n body.selections = body.selections.filter(aVal => {\n if (['dinner', 'lunch', 'pick-up', 'deliver'].includes(aVal.split(/\\s+/)[0].toLowerCase())) {\n htmlMessage += `

${aVal.trim()}

`;\n rawMessage += `${aVal}\\r\\n`;\n pdfLine(aVal);\n return false;\n }\n else {\n return true;\n }\n });\n renderCheckBox = '⃞ ';\n htmlMessage += '

';\n rawMessage += `\\n\\n`;\n htmlMessage += `

Order Details

`;\n pdfLine('Order Details', { style: 'bold', before: 3, align: 'left' });\n }\n else {\n if (textInput && (Object.keys(textInput).length > 0)) {\n pdfStyle('reset');\n for (let topic in textInput) {\n if (!body.selections.includes(topic)) {\n let sVal = sentenceCase(topic.trim());\n rawMessage += `\\n${sVal}\\n${textInput[topic]}\\n`;\n htmlMessage += `

${sVal}

`;\n htmlMessage += `
${textInput[topic]}
`;\n pdfLine(sVal, { before: 1 });\n pdfLine(textInput[topic], { noNewLine: true, before: 1, indent: 15, size: 'small' });\n pdfStyle('reset');\n delete textInput[topic];\n }\n }\n }\n if (body.selections.length > 0) {\n htmlMessage += `

Options Selected

`;\n // pdfLine('Options Selected', {style: 'bold', before: 1, align: 'left'});\n }\n }\n pdfStyle('reset');\n\n let lineSpacing = '0px';\n if (!textInput) { textInput = {}; }\n body.selections.forEach((aVal) => {\n let aVal_raw = aVal.split(' (').shift();\n let sVal = sentenceCase(aVal.trim());\n if ((body.options) && (body.options.hasOwnProperty(aVal_raw))) {\n sVal = sentenceCase(aVal_raw);\n }\n if ((body.images) && (body.images.hasOwnProperty(aVal_raw))) {\n pdfLine(' ', { align: 'left', image: body.images[aVal_raw] });\n rawMessage += `\\n`;\n htmlMessage += ``;\n }\n else {\n htmlMessage += `
${renderCheckBox}   ${sVal}
`;\n rawMessage += `\\n${sVal}\\n`;\n pdfStyle('reset');\n pdfLine(sVal, { before: 1 });\n if (textInput[aVal]) {\n pdfLine(textInput[aVal], { noNewLine: true, before: 1, indent: 15, size: 'small' });\n htmlMessage += `
${textInput[aVal]}
`;\n rawMessage += `${textInput[aVal]}\\n`;\n delete textInput[aVal];\n }\n }\n /* Check for qualifiers */\n if ((body.qualifiers) && (body.qualifiers.hasOwnProperty(aVal))) {\n for (let qual in body.qualifiers[aVal]) {\n let tOut = listFromArray(body.qualifiers[aVal][qual]) || 'No selection';\n htmlMessage += `
${sentenceCase(qual)}: ${tOut}
`;\n rawMessage += `${sentenceCase(qual)}: ${tOut}\\n`;\n pdfLine(`${sentenceCase(qual)}: ${tOut}`, { noNewLine: true, before: 1, indent: 15, size: 'small' });\n }\n }\n /* Check for options */\n if ((body.options) && (body.options.hasOwnProperty(aVal_raw))) {\n for (let this_option in body.options[aVal_raw]) {\n for (let this_choice in body.options[aVal_raw][this_option]) {\n if (typeof (body.options[aVal_raw][this_option][this_choice]) === 'boolean') {\n if (body.options[aVal_raw][this_option][this_choice]) {\n htmlMessage += `
${titleCase(this_choice)}
`;\n rawMessage += `${titleCase(this_choice)}\\n`;\n pdfLine(`${titleCase(this_choice)}`, { noNewLine: true, italic: true, before: 1, indent: 15, size: 'small' });\n }\n }\n else {\n htmlMessage += `
${body.options[aVal_raw][this_option][this_choice]}
`;\n rawMessage += `${body.options[aVal_raw][this_option][this_choice]}\\n`;\n pdfLine(`${body.options[aVal_raw][this_option][this_choice]}`, { noNewLine: true, italic: true, before: 1, indent: 15, size: 'small' });\n }\n }\n }\n }\n lineSpacing = `${spaceBetweenLines}px`;\n });\n pdfStyle('reset');\n\n if (textInput && (Object.keys(textInput).length > 0)) {\n pdfDown(2);\n htmlMessage += '

';\n rawMessage += `\\n\\n`;\n for (let topic in textInput) {\n if (!body.images || !body.images.hasOwnProperty(topic)) {\n let sVal = sentenceCase(topic.trim());\n htmlMessage += `
${sVal}   ${textInput[topic]}
`;\n rawMessage += `\\n${sVal}\\n${textInput[topic]}\\n`;\n pdfStyle('reset');\n pdfLine(sVal, { before: 1 });\n pdfLine(textInput[topic], { noNewLine: true, before: 1, indent: 15, size: 'small' });\n lineSpacing = `${spaceBetweenLines}px`;\n }\n }\n }\n\n htmlMessage += `

`;\n\n // Finish\n if (summaryType === 'mealOrder') {\n pdfStyle('reset');\n pdfLine('Order filled by: ________________________', { before: 4, after: 1 });\n htmlMessage += `

Order filled by: _______________________

`;\n rawMessage += '\\n\\nOrder filled by: ________________________\\n\\n';\n }\n\n let refText = `AVA reference: ${body.client || body.client_id}/${body.requestID} (${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()})`;\n if (body.local_key) {\n htmlMessage += `
AVA request number: ${body.local_key}
`;\n rawMessage += `\\n\\rAVA request number: ${body.local_key}`;\n pdfLine(`AVA request number: ${body.local_key}`, { size: 'tiny', after: 1, yPos: 'footer', align: 'center' });\n pdfLine(refText, { noNewPage: true, noNewLine: true, before: 1, align: 'center' });\n }\n else {\n pdfLine(refText, { noNewPage: true, yPos: 'footer', align: 'center' });\n }\n\n htmlMessage += `
${refText}
`;\n htmlMessage += `
***** END *****

`;\n rawMessage += `\\n\\r${refText}\\n***** END *****`;\n\n if (body.fileName && body.fileName.slice(-4) !== '.pdf') {\n body.fileName += '.pdf';\n }\n let pdfInfo = {\n s3Key: (body.fileName || `AVA_${body.requestID.replace('~', '_')}.pdf`),\n s3Bucket: (body.S3_bucket || 'theseus-medical-storage')\n };\n if (!body.multiPrint || body.multiPrint.lastDoc) {\n pdfLine(`***** END *****`, { noNewPage: true, noNewLine: true, before: 1 });\n let this_method = body.overrideMethod || body.messaging?.format?.method || body.messaging[0].format.method;\n let pdfResp = await savePDF(doc, pdfInfo, { local: false, S3: true, onSave: this_method });\n if (pdfResp.responseData.s3Resp) {\n pdfInfo.s3Location = pdfResp.responseData.s3Resp.Location;\n }\n }\n return [htmlMessage, rawMessage, pdfInfo];\n}\n\n\nexport async function printDocument({ docData, docValues, docDocument, docID, client_id, title }) {\n // Prep the PDF output\n await pdfLaunch({ client_id });\n page.title = title;\n page.document_id = docID;\n page.client_id = client_id;\n page.footerText = `AVA reference: ${page.client_id}/${page.document_id}`;\n // pdfLine(' ', { align: 'center', image: pdfCurrent.logo });\n pdfLine(title, { style: 'bold', size: 'large', align: 'center', after: 1 });\n\n // docData.sections.forEach((sectionObj, sectionNdx) => {\n for (const sectionObj of docData.sections) {\n pdfLine(sectionObj.section_name, { protectOrphan: true, style: 'bold', size: 'medium', align: 'left', before: 2, after: 1 });\n // sectionObj.fields.forEach((this_field, fieldNdx) => {\n for (const this_field of sectionObj.fields) {\n if (docData.fields.hasOwnProperty(this_field) && !(docData.fields.ignore) && !(docData.fields.hidden)) {\n let printType = (docData.fields[this_field].value.type === 'view') ? docData.fields[this_field].prompt.type : docData.fields[this_field].value.type;\n switch (printType) {\n case 'image': {\n pdfLine('', { image: docValues[this_field].valueText, style: 'normal', size: 'medium', align: 'left', after: 1 });\n break;\n }\n case 'select&text':\n case 'select': {\n if (!docData.fields[this_field].prompt.noPrint) {\n if (page.line_was_compressed) {\n pdfDown(1);\n page.line_was_compressed = false;\n }\n if (docData.fields[this_field].prompt.compressPrint) {\n docData.fields[this_field].prompt.value += ':';\n }\n pdfLine(docData.fields[this_field].prompt.ref, { style: 'normal', size: 'medium', indent: 0, align: 'left', after: 0 });\n docData.fields[this_field].value.selection.selectionList.forEach((text, tIndex) => {\n if (docData.fields[this_field].value && docData.fields[this_field].prompt.compressPrint) {\n if (docData.fields[this_field].value.includes(text)) {\n pdfLine(text, { style: 'normal', indent: 2, after: 0, noNewLine: true });\n }\n }\n else {\n let radioSelected = docValues[this_field].valueList.includes(text);\n if (tIndex === 0) {\n pdfLine(text, { radio: true, radioSelected, style: 'normal', size: 'medium', align: 'left', indent: 2, after: 0, noNewPage: true });\n }\n else {\n pdfLine(text, { radio: true, radioSelected, style: 'normal', size: 'medium', align: 'left', indent: 10, after: 0, noNewLine: true, noNewPage: true });\n }\n }\n });\n pdfDown(1);\n pdfStyle('reset');\n }\n break;\n }\n case 'header': {\n pdfLine((docData.fields[this_field].prompt.ref || docData.fields[this_field].prompt.value), { protectOrphan: true, style: 'italic', size: 'medium', align: 'left', before: 2, after: 1 });\n break;\n }\n\n case 'html': {\n await pdfHTML(docData.fields[this_field].prompt.ref || docData.fields[this_field].prompt.value,\n Object.assign({}, docData.fields[this_field]?.prompt, {\n before: -2,\n printed_height: docData.fields[this_field]?.prompt?.printed_height || null,\n print_scale: docData.fields[this_field].prompt.print_scale || 1,\n html: true,\n style: 'normal',\n size: 'medium',\n align: 'left',\n after: 1\n }));\n break;\n }\n case 'signature': {\n await pdfImage(docData.fields[this_field].prompt.ref, { image: docDocument[this_field] || docDocument.signature, style: 'normal', size: 'medium', align: 'left', after: 1 });\n break;\n }\n case 'legacy_signature': {\n pdfLine(docData.fields[this_field].prompt.ref, { image: docDocument[this_field] || docDocument.signature, style: 'normal', size: 'medium', align: 'left', after: 1 });\n break;\n }\n default: {\n if (docValues.hasOwnProperty(this_field)) {\n if (docData.fields[this_field].prompt.compressPrint) {\n pdfLine(docValues[this_field].valueText,\n { style: 'normal', size: 'medium', align: 'left', after: 0 });\n }\n else if (docData.fields[this_field].prompt.ref.includes(docValues[this_field].valueText)) {\n pdfLine(`${docData.fields[this_field].prompt.ref}`,\n { style: 'normal', size: 'medium', align: 'left', after: 1 });\n }\n else {\n pdfLine(`${docData.fields[this_field].prompt.ref}: ${docValues[this_field].valueText}`,\n { style: 'normal', size: 'medium', align: 'left', after: 1 });\n }\n }\n }\n }\n }\n };\n };\n\n // Finish\n pdfLine(page.footerText, { size: 'tiny', after: 1, yPos: 'footer', align: 'center' });\n doc.save(docDocument.document_id);\n}\n\nexport async function consolidatePDFs({ documentList, options = {} }) {\n\n}\n\nfunction okToShowSection(this_sectionObj, fields) {\n if (this_sectionObj.hasOwnProperty('show_if')) {\n for (const this_test of this_sectionObj.show_if) {\n if (this_test.hasOwnProperty('pertainsTo_memberOf')) {\n return true;\n }\n else if (this_test.hasOwnProperty('memberOf')) {\n return true;\n }\n else {\n const this_value = fields[this_test.field].value;\n if (!this_value) { return true; }\n if (array_in_array(this_test.values, this_value)) {\n return true;\n }\n }\n }\n return false;\n }\n else {\n return true;\n }\n}\n\nexport async function printDocumentB({ documentList, options = {} }) {\n let response = [];\n if (!Array.isArray(documentList)) {\n documentList = [documentList];\n }\n let numberOfDocuments = documentList.length;\n // Prep the PDF output\n let docIndex = 0;\n for (const docInfo of documentList) {\n docIndex++;\n let { sections, fields, docID, client_id, title, signatures } = docInfo;\n await pdfLaunch({ client_id });\n page.title = title;\n page.document_id = docID;\n page.client_id = client_id;\n page.footerText = `AVA reference: ${page.client_id}_${page.document_id}`;\n pdfLine(' ', { align: 'center', image: pdfCurrent.logo });\n pdfLine(title, { style: 'bold', size: 'large', align: 'center', after: 1 });\n\n // sections.forEach((sectionObj, sectionNdx) => {\n for (const sectionObj of sections) {\n if (okToShowSection(sectionObj, fields)) {\n pdfLine(sectionObj.section_name, { protectOrphan: true, style: 'bold', size: 'medium', align: 'left', before: 2, after: 1 });\n // sectionObj.fields.forEach((this_field, fieldNdx) => {\n for (const this_field of sectionObj.fields) {\n if (fields.hasOwnProperty(this_field) && !(fields[this_field].ignore) && !(fields[this_field].hidden)) {\n let printType = fields[this_field].type;\n switch (printType) {\n case 'image': {\n pdfLine('', { image: fields[this_field].valueText, style: 'normal', size: 'medium', align: 'left', after: 1 });\n break;\n }\n case 'select&text':\n case 'select': {\n if (!fields[this_field].prompt.noPrint) {\n if (page.line_was_compressed) {\n pdfDown(1);\n page.line_was_compressed = false;\n }\n if (fields[this_field].prompt.compressPrint) {\n fields[this_field].prompt.value += ':';\n }\n pdfLine(fields[this_field].prompt.value, { style: 'normal', size: 'medium', indent: 0, align: 'left', after: 0 });\n fields[this_field].selectionObj.selectionList.forEach((text, tIndex) => {\n if (fields[this_field].value && fields[this_field].prompt.compressPrint) {\n if (fields[this_field].value.includes(text)) {\n pdfLine(text, { style: 'normal', indent: 2, after: 0, noNewLine: true });\n }\n }\n else {\n let radioSelected = fields.hasOwnProperty(this_field) && fields[this_field].value && fields[this_field].value.includes(text);\n if (tIndex === 0) {\n pdfLine(text, { radio: true, radioSelected, style: 'normal', size: 'medium', align: 'left', indent: 2, after: 0, noNewPage: true });\n }\n else {\n pdfLine(text, { radio: true, radioSelected, style: 'normal', size: 'medium', align: 'left', indent: 10, after: 0, noNewLine: true, noNewPage: true });\n }\n }\n });\n if (fields[this_field].bonusText) {\n const text = `${fields[this_field].prompt.other || 'Other'}: ${fields[this_field].bonusText}`;\n pdfLine(text, { radio: true, radioSelected: true, style: 'normal', size: 'medium', align: 'left', indent: 10, after: 0, noNewLine: true, noNewPage: true });\n }\n pdfDown(1);\n pdfStyle('reset');\n }\n break;\n }\n case 'header': {\n pdfLine(fields[this_field].prompt.value, { protectOrphan: true, style: 'italic', size: 'medium', align: 'left', before: 2, after: 1 });\n break;\n }\n case 'html': {\n await pdfHTML(`${fields[this_field].prompt.value}`,\n Object.assign({}, fields[this_field].prompt, {\n before: -2,\n printed_height: fields[this_field].prompt.printed_height,\n print_scale: fields[this_field].prompt.print_scale || 1,\n html: true,\n style: 'normal',\n size: 'medium',\n align: 'left',\n after: 1\n }));\n break;\n }\n case 'signature': {\n await pdfImage(fields[this_field].prompt.value, { image: signatures[fields[this_field].options.sigRefNumber], style: 'normal', size: 'medium', align: 'left', after: 1 });\n break;\n }\n case 'legacy_signature': {\n pdfLine(fields[this_field].prompt.value, { image: signatures[fields[this_field].options.sigRefNumber], style: 'normal', size: 'medium', align: 'left', after: 1 });\n break;\n }\n default: {\n if (fields.hasOwnProperty(this_field)) {\n if ((fields[this_field].valueText.length === 0) && fields[this_field].prompt.showNA) {\n fields[this_field].valueText = 'n/a';\n }\n if (fields[this_field].prompt.compressPrint) {\n pdfLine(fields[this_field].valueText,\n { style: 'normal', size: 'medium', align: 'left', after: 0 });\n }\n else if (fields[this_field].prompt.value.includes(fields[this_field].valueText)) {\n pdfLine(`${fields[this_field].prompt.value}`,\n { style: 'normal', size: 'medium', align: 'left', after: 1 });\n }\n else {\n pdfLine(`${fields[this_field].prompt.value}: ${fields[this_field].valueText}`,\n { style: 'normal', size: 'medium', align: 'left', after: 1 });\n }\n }\n }\n }\n }\n };\n }\n };\n\n // Finish\n pdfLine(page.footerText, { size: 'tiny', after: 1, yPos: 'footer', align: 'center' });\n doc.save(docID);\n if (!options.multiPrint || (numberOfDocuments === docIndex)) {\n let pdfInfo = {\n s3Key: (`${page.client_id}_${page.document_id}.pdf`),\n s3Bucket: (options.S3_bucket || 'theseus-medical-storage')\n };\n pdfLine(`***** END *****`, { noNewPage: true, noNewLine: true, before: 1 });\n let pdfResp = await savePDF(doc, pdfInfo, { local: false, S3: true, onSave: false });\n if (pdfResp.responseData.s3Resp) {\n pdfInfo.s3Location = pdfResp.responseData.s3Resp.Location;\n }\n response.push(pdfInfo);\n }\n }\n return response;\n}\n\nexport async function printEmptyDocument({ documentList, options = {} }) {\n let response = [];\n if (!Array.isArray(documentList)) {\n documentList = [documentList];\n }\n let numberOfDocuments = documentList.length;\n // Prep the PDF output\n let docIndex = 0;\n for (const docInfo of documentList) {\n docIndex++;\n let { sections, fields, docID, client_id, title } = docInfo;\n await pdfLaunch({ client_id });\n page.title = title;\n page.document_id = docID;\n page.client_id = client_id;\n page.footerText = `AVA reference: ${page.client_id}_${page.document_id}`;\n pdfLine(' ', { align: 'center', image: pdfCurrent.logo });\n pdfLine(title, { style: 'bold', size: 'large', align: 'center', after: 1 });\n // eslint-disable-next-line\n // sections.forEach((sectionObj) => {\n for (const sectionObj of sections) {\n pdfLine(sectionObj.section_name, { protectOrphan: true, style: 'bold', size: 'medium', align: 'left', before: 2, after: 1 });\n // sectionObj.fields.forEach((this_field) => {\n for (const this_field of sectionObj.fields) {\n if (fields.hasOwnProperty(this_field) && !(fields[this_field].ignore) && !(fields[this_field].hidden)) {\n let printType = fields[this_field].type;\n switch (printType) {\n case 'image': {\n pdfLine('', { image: fields[this_field].valueText, style: 'normal', size: 'medium', align: 'left', after: 1 });\n break;\n }\n case 'select&text':\n case 'select': {\n if (!fields[this_field].prompt.noPrint) {\n pdfLine(fields[this_field].prompt.value, { style: 'normal', size: 'medium', indent: 0, align: 'left', after: 0 });\n fields[this_field].selectionObj.selectionList.forEach((text, tIndex) => {\n let radioSelected = false;\n if (tIndex === 0) {\n pdfLine(text, { radio: true, radioSelected, style: 'normal', size: 'medium', align: 'left', indent: 2, after: 0, noNewPage: true });\n }\n else {\n pdfLine(text, { radio: true, radioSelected, style: 'normal', size: 'medium', align: 'left', indent: 10, after: 0, noNewLine: true, noNewPage: true });\n }\n });\n if (printType === 'select&text') {\n const text = `${fields[this_field].prompt.other || 'other'}:`;\n pdfLine(text, { style: 'normal', size: 'medium', align: 'left', indent: 10, after: 0, noNewLine: true, noNewPage: true });\n let endX = pdfCurrent.xPos + doc.getTextWidth('Sample text thats not too long');\n doc.line(pdfCurrent.xPos - 6, pdfCurrent.yPos + 1, endX, pdfCurrent.yPos + 1, 'DF');\n pdfCurrent.xPos = endX;\n }\n pdfDown(1);\n pdfStyle('reset');\n }\n break;\n }\n case 'header': {\n pdfLine(fields[this_field].prompt.value, { protectOrphan: true, style: 'italic', size: 'medium', align: 'left', before: 2, after: 1 });\n break;\n }\n case 'html': {\n await pdfHTML(`${fields[this_field].prompt.value}`,\n Object.assign({}, fields[this_field].prompt, {\n before: -2,\n printed_height: fields[this_field].prompt.printed_height,\n print_scale: fields[this_field].prompt.print_scale || 1,\n html: true,\n style: 'normal',\n size: 'medium',\n align: 'left',\n after: 1\n }));\n break;\n }\n case 'signature': {\n pdfCurrent.yPos += 12;\n pdfLine(`${fields[this_field].prompt.value}: `, { style: 'normal', size: 'medium', align: 'left', after: 1 });\n pdfCurrent.xPos = page.margin.left;\n let endX = doc.getTextWidth('Sample text long enough to accomodate most situations');\n doc.rect(pdfCurrent.xPos, pdfCurrent.yPos - 4, endX, 40, 'S');\n pdfCurrent.xPos += endX;\n pdfCurrent.yPos += 42;\n break;\n }\n default: {\n if (fields.hasOwnProperty(this_field)) {\n const this_text = fields[this_field].prompt.value.split(/%%.*?%%/gm).join(\"\").replace(\" \", \" \");\n pdfCurrent.yPos += 12;\n pdfLine(`${this_text}: `, { style: 'normal', size: 'medium', align: 'left', after: 1 });\n let promptWidth = doc.getTextWidth(`${this_text}: `);\n pdfCurrent.xPos += promptWidth;\n let endX = pdfCurrent.xPos + doc.getTextWidth('Sample text long enough to accomodate most situations');\n if (endX > (page.right)) {\n pdfDown(2);\n pdfCurrent.xPos += 10;\n endX = pdfCurrent.xPos + doc.getTextWidth('Sample text long enough to accomodate most situations');\n }\n doc.line(pdfCurrent.xPos, pdfCurrent.yPos - 8, endX, pdfCurrent.yPos - 8, 'DF');\n pdfCurrent.xPos = endX;\n }\n }\n }\n }\n };\n };\n\n // Finish\n pdfLine(page.footerText, { size: 'tiny', after: 1, yPos: 'footer', align: 'center' });\n doc.save(docID);\n if (!options.multiPrint || (numberOfDocuments === docIndex)) {\n let pdfInfo = {\n s3Key: (`${page.client_id}_${page.document_id}.pdf`),\n s3Bucket: (options.S3_bucket || 'theseus-medical-storage')\n };\n pdfLine(`***** END *****`, { noNewPage: true, noNewLine: true, before: 1 });\n let pdfResp = await savePDF(doc, pdfInfo, { local: false, S3: true, onSave: false });\n if (pdfResp.responseData.s3Resp) {\n pdfInfo.s3Location = pdfResp.responseData.s3Resp.Location;\n }\n response.push(pdfInfo);\n }\n }\n return response;\n}\n\nexport async function printDocumentHybrid({ documentList, options = {} }) {\n let response = [];\n if (!Array.isArray(documentList)) {\n documentList = [documentList];\n }\n let numberOfDocuments = documentList.length;\n // Prep the PDF output\n let docIndex = 0;\n for (const docInfo of documentList) {\n docIndex++;\n let { sections, fields, docID, client_id, title, signatures } = docInfo;\n await pdfLaunch({ client_id });\n page.title = title;\n page.document_id = docID;\n page.client_id = client_id;\n page.line_was_compressed = false;\n page.footerText = `AVA reference: ${page.client_id}_${page.document_id}`;\n pdfLine(' ', { align: 'center', image: pdfCurrent.logo });\n pdfLine(title, { style: 'bold', size: 'large', align: 'center', after: 1 });\n // eslint-disable-next-line\n // sections.forEach((sectionObj, sectionNdx) => {\n for (const sectionObj of sections) {\n if (okToShowSection(sectionObj, fields)) {\n pdfLine(sectionObj.section_name, { protectOrphan: true, style: 'bold', size: 'medium', align: 'left', before: 4, after: 1 });\n for (const this_field of sectionObj.fields) {\n if (fields.hasOwnProperty(this_field) && !(fields[this_field].ignore) && !(fields[this_field].hidden)) {\n let printType = fields[this_field].type;\n switch (printType) {\n case 'image': {\n pdfLine('', { image: fields[this_field].valueText, style: 'normal', size: 'medium', align: 'left', after: 1 });\n break;\n }\n case 'select&text':\n case 'select': {\n if (!fields[this_field].prompt.noPrint) {\n if (page.line_was_compressed) {\n pdfDown(1);\n page.line_was_compressed = false;\n }\n if (fields[this_field].prompt.compressPrint) {\n fields[this_field].prompt.value += ':';\n }\n pdfLine(fields[this_field].prompt.value, { style: 'normal', size: 'medium', indent: 0, align: 'left', after: 0 });\n fields[this_field].selectionObj.selectionList.forEach((text, tIndex) => {\n if (fields[this_field].value && fields[this_field].prompt.compressPrint) {\n if (fields[this_field].value.includes(text)) {\n pdfLine(text, { style: 'normal', indent: 2, after: 0, noNewLine: true });\n }\n }\n else {\n let radioSelected = fields[this_field].value && fields[this_field].value.includes(text);\n if (tIndex === 0) {\n pdfLine(text, { radio: true, radioSelected, style: 'normal', size: 'medium', align: 'left', indent: 2, after: 0, noNewPage: true });\n }\n else {\n pdfLine(text, { radio: true, radioSelected, style: 'normal', size: 'medium', align: 'left', indent: 10, after: 0, noNewLine: true, noNewPage: true });\n }\n }\n });\n if (fields[this_field].bonusText) {\n const text = `${fields[this_field].prompt.other || 'Other'}: ${fields[this_field].bonusText}`;\n pdfLine(text, { radio: true, radioSelected: true, style: 'normal', size: 'medium', align: 'left', indent: 10, after: 0, noNewLine: true, noNewPage: true });\n\n }\n pdfDown(1);\n pdfStyle('reset');\n }\n break;\n }\n case 'header': {\n pdfLine(fields[this_field].prompt.value, { protectOrphan: true, style: 'italic', size: 'medium', align: 'left', before: 2, after: 1 });\n break;\n }\n case 'html': {\n await pdfHTML(`${fields[this_field].prompt.value}`,\n Object.assign({}, fields[this_field].prompt, {\n before: -2,\n printed_height: fields[this_field].prompt.printed_height,\n print_scale: fields[this_field].prompt.print_scale || 1,\n html: true,\n style: 'normal',\n size: 'medium',\n align: 'left',\n after: 1\n }));\n break;\n }\n case 'signature': {\n if (signatures[fields[this_field].options.sigRefNumber]) {\n await pdfImage(fields[this_field].prompt.value, { image: signatures[fields[this_field].options.sigRefNumber], style: 'normal', size: 'medium', align: 'left', after: 1 });\n }\n else {\n pdfCurrent.yPos += 12;\n pdfLine(`${fields[this_field].prompt.value}: `, { style: 'normal', size: 'medium', align: 'left', after: 1 });\n pdfCurrent.xPos = page.margin.left;\n let endX = doc.getTextWidth('Sample text long enough to accomodate most situations');\n doc.rect(pdfCurrent.xPos, pdfCurrent.yPos - 4, endX, 40, 'S');\n pdfCurrent.xPos += endX;\n pdfCurrent.yPos += 42;\n }\n break;\n }\n default: {\n if (fields.hasOwnProperty(this_field)) {\n if (page.line_was_compressed && !fields[this_field].prompt.compressPrint) {\n pdfDown(1);\n page.line_was_compressed = false;\n }\n if (fields[this_field].valueText.length > 0) {\n if (fields[this_field].prompt.compressPrint) {\n pdfLine(fields[this_field].valueText,\n { style: 'normal', size: 'medium', align: 'left', noNewLine: fields[this_field].prompt.noNewLine || false });\n page.line_was_compressed = true;\n }\n else if (fields[this_field].prompt.value.includes(fields[this_field].valueText)) {\n pdfLine(`${fields[this_field].prompt.value}`,\n { style: 'normal', size: 'medium', align: 'left', before: 1, after: 1 });\n }\n else {\n pdfLine(`${fields[this_field].prompt.value}: ${fields[this_field].valueText}`,\n { style: 'normal', size: 'medium', align: 'left', before: 1, after: 1 });\n }\n }\n else {\n const this_text = fields[this_field].prompt.value.split(/%%.*?%%/gm).join(\"\").replace(\" \", \" \");\n pdfCurrent.yPos += 12;\n pdfLine(`${this_text}: `, { style: 'normal', size: 'medium', align: 'left', after: 1 });\n let promptWidth = doc.getTextWidth(`${this_text}: `);\n pdfCurrent.xPos += promptWidth;\n let endX = pdfCurrent.xPos + doc.getTextWidth('Sample text long enough to accomodate most situations');\n if (endX > (page.right)) {\n pdfDown(2);\n pdfCurrent.xPos += 10;\n endX = pdfCurrent.xPos + doc.getTextWidth('Sample text long enough to accomodate most situations');\n }\n doc.line(pdfCurrent.xPos, pdfCurrent.yPos - 8, endX, pdfCurrent.yPos - 8, 'DF');\n pdfCurrent.xPos = endX;\n }\n }\n }\n }\n }\n };\n }\n };\n\n // Finish\n pdfLine(page.footerText, { size: 'tiny', after: 1, yPos: 'footer', align: 'center' });\n doc.save(docID);\n if (!options.multiPrint || (numberOfDocuments === docIndex)) {\n let pdfInfo = {\n s3Key: (`${page.client_id}_${page.document_id}.pdf`),\n s3Bucket: (options.S3_bucket || 'theseus-medical-storage')\n };\n pdfLine(`***** END *****`, { noNewPage: true, noNewLine: true, before: 1 });\n let pdfResp = await savePDF(doc, pdfInfo, { local: false, S3: true, onSave: false });\n if (pdfResp.responseData.s3Resp) {\n pdfInfo.s3Location = pdfResp.responseData.s3Resp.Location;\n }\n response.push(pdfInfo);\n }\n }\n return response;\n}\n\n\nexport async function factForm(serviceRequestRec) {\n /*\n serviceRequestRec.original_request: {\n selections,\n options,\n textInput,\n image_location,\n images\n },\n */\n // Standard 8.5 x 11 output for a Request of any type\n // Prep the PDF output\n let page = {};\n await pdfLaunch(Object.assign({}, { client_id: serviceRequestRec.client_id }));\n\n let htmlMessage = `

${page.title}

`;\n let rawMessage = `${page.title}\\n\\r`;\n pdfLine(' ', { align: 'center', image: pdfCurrent.logo });\n pdfLine(page.title, { style: 'bold', size: 'large', align: 'center', after: 1 });\n\n // Person\n let pRec = await getPerson(serviceRequestRec.requestor);\n\n let authorName = await makeName(serviceRequestRec.requestor);\n let pName = (serviceRequestRec.onBehalfOf || authorName).replace(/\\(.+\\)/g, '').trim(); // this removes anything inside parenthesis\n // does the title contain all of the words in the obo?\n let tLower = page.title.toLowerCase();\n let oboWords = pName.toLowerCase().split(/\\s+/);\n let allWordsAppear = oboWords.every(oboWord => {\n return (tLower.includes(oboWord));\n });\n if (!allWordsAppear) {\n htmlMessage += `

${pName}`;\n rawMessage += `${pName}\\n`;\n pdfLine(`for ${pName}`, { style: 'normal', align: 'center', size: 'large' });\n }\n\n if (pRec.location) {\n htmlMessage += `
${pRec.location}`;\n rawMessage += `${pRec.location}\\n`;\n pdfLine(pRec.location, { align: 'center' });\n }\n htmlMessage += `

`;\n\n if (!serviceRequestRec.requestDate) {\n serviceRequestRec.requestDate = new Date();\n }\n let pDateTime = makeDate(serviceRequestRec.requestDate).absolute;\n\n // get creator info - most reliable spot is first characters of the request id\n let creator_id = serviceRequestRec.request_id.split('~')[0];\n if (creator_id !== serviceRequestRec.author) {\n pDateTime += ` by ${await makeName(creator_id)}`;\n }\n htmlMessage += `

created: ${pDateTime}`;\n rawMessage += `${pDateTime}\\n\\r`;\n pdfLine(`created: ${pDateTime}`, { size: 'medium', align: 'center' });\n\n for (let cTyp in pRec.messaging) {\n if ((pRec[cTyp]) && (pRec[cTyp].trim() !== '')) {\n let cLab;\n switch (cTyp) {\n case 'sms': { cLab = 'cell'; break; }\n case 'voice': { cLab = 'home'; break; }\n case 'email': { cLab = 'e-Mail'; break; }\n default: { cLab = cTyp; }\n }\n htmlMessage += `
${cLab}: ${pRec[cTyp]}`;\n pdfLine(`${pRec[cTyp]}`, { align: 'center' });\n }\n }\n pdfDown(2);\n\n htmlMessage += '

** AVA **

';\n rawMessage += '\\n\\r** AVA **\\n\\r';\n\n let spaceBetweenLines = 25;\n let renderCheckBox = '';\n\n let formattedRequestObj = formatServiceRequestDetails(serviceRequestRec);\n for (const [this_selection, optionList] of Object.entries(formattedRequestObj)) {\n htmlMessage += `
${renderCheckBox}   ${sentenceCase(this_selection)}
`;\n rawMessage += `\\n${this_selection}\\n`;\n pdfStyle('reset');\n pdfLine(this_selection, { before: 1 });\n // eslint-disable-next-line\n optionList.forEach(this_option => {\n htmlMessage += `
${titleCase(this_option)}
`;\n rawMessage += `${titleCase(this_option)}\\n`;\n pdfLine(`${titleCase(this_option)}`, { noNewLine: true, italic: true, before: 1, indent: 15, size: 'small' });\n });\n if ((serviceRequestRec.original_request.images) && (serviceRequestRec.original_request.images.hasOwnProperty(this_selection))) {\n pdfLine(' ', { align: 'left', image: serviceRequestRec.original_request.images[this_selection] });\n rawMessage += `\\n`;\n htmlMessage += ``;\n }\n };\n\n pdfStyle('reset');\n\n htmlMessage += `

`;\n\n // Finish\n let refText = `AVA reference: ${serviceRequestRec.client_id}/${serviceRequestRec.request_id} (${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()})`;\n if (serviceRequestRec.local_key) {\n htmlMessage += `

AVA request number: ${serviceRequestRec.local_key}
`;\n rawMessage += `\\n\\rAVA request number: ${serviceRequestRec.local_key}`;\n pdfLine(`AVA request number: ${serviceRequestRec.local_key}`, { size: 'tiny', after: 1, yPos: 'footer', align: 'center' });\n pdfLine(refText, { noNewPage: true, noNewLine: true, before: 1, align: 'center' });\n }\n else {\n pdfLine(refText, { noNewPage: true, yPos: 'footer', align: 'center' });\n }\n\n htmlMessage += `
${refText}
`;\n htmlMessage += `
***** END *****

`;\n rawMessage += `\\n\\r${refText}\\n***** END *****`;\n\n return {\n html: htmlMessage,\n plainText: rawMessage,\n pdf: doc\n };\n}\n\nexport async function buildDocument(body) {\n // instructions for the document lines are in body.format.source\n let printInstructions = deepCopy(body.format.source);\n if (printInstructions.length === 0) {\n return [];\n }\n // Standard 8.5 x 11 output for a Request of any type\n // Prep the PDF output\n if (!body.margin) { body.margin = {}; }\n let callBody = Object.assign({}, body, body.selections, body.images);\n\n await pdfLaunch(Object.assign({}, body, { client_id: (body.client || body.client_id) }));\n\n let htmlMessage = '';\n let rawMessage = '';\n\n if (body.format.logo) {\n htmlMessage += `
`;\n let logo_dimensions = [150, 100];\n if (body.logo_dimensions) {\n logo_dimensions = body.logo_dimensions;\n }\n htmlMessage += ``;\n htmlMessage += `
`;\n let image64 = await getObject64(pdfCurrent.logo);\n pdfLine(' ', { image: image64, align: 'center' });\n pdfStyle('reset');\n }\n\n if (body.format.title) {\n htmlMessage += `

${body.format.title}

`;\n rawMessage = `${body.format.title}\\n\\r`;\n pdfLine(pdfLine(body.format.title, { size: 'medium', bold: true }));\n }\n\n let ignoreNextLine = false;\n do {\n let this_instruction = printInstructions.shift();\n if (this_instruction.charAt(0) === '~') {\n let [instruction_type, instruction_key] = this_instruction.substring(1).split('=');\n if (instruction_type === 'if') {\n ignoreNextLine = true;\n if (body.request.selections.includes(instruction_key)) {\n // test is true, so respect the next lines (don't ignore)\n ignoreNextLine = false;\n }\n else {\n for (let selection in body.request.options) {\n for (let option in body.request.options[selection]) {\n if (body.request.options[selection][option][instruction_key]) {\n ignoreNextLine = false;\n }\n }\n }\n if (body.textInput[instruction_key]) {\n ignoreNextLine = false;\n }\n }\n }\n else if (instruction_type === 'else') {\n ignoreNextLine = !ignoreNextLine;\n }\n else if (instruction_type === 'end') {\n ignoreNextLine = false;\n }\n else if (!ignoreNextLine) {\n switch (instruction_type) {\n case 'includeObservationItems': {\n let lines = await getObservationItems(instruction_key);\n if (lines) {\n let lineKeys = Object.keys(lines).sort((a, b) => {\n if (Number(a.split(\":\")[1]) > Number(b.split(\":\")[1])) {\n return 1;\n }\n else {\n return -1;\n }\n });\n // eslint-disable-next-line\n lineKeys.forEach(lineKey => {\n htmlMessage += `
${lines[lineKey].display_value}
`;\n rawMessage += lines[lineKey].display_value;\n pdfLine(lines[lineKey].display_value, { html: true, size: 'medium' });\n });\n }\n break;\n }\n case 'down': {\n pdfDown(Number(instruction_key));\n break;\n }\n case 'if': {\n let testSucceeded = false;\n if (body.request.selections.includes(instruction_key)) {\n // test is true, so respect the next lines (don't ignore)\n testSucceeded = true;\n }\n else {\n for (let selection in body.request.options) {\n for (let option in body.request.options[selection]) {\n if (body.request.options[selection][option][instruction_key]) {\n testSucceeded = true;\n }\n }\n }\n if (body.textInput[instruction_key]) {\n testSucceeded = true;\n }\n }\n // all tests failed; this test is false; ignore subsequent lines\n ignoreNextLine = !testSucceeded;\n break;\n }\n case 'image': {\n let outImage = await resolveMessageVariables(instruction_key, callBody);\n pdfLine(' ', { image: outImage });\n htmlMessage += `
`;\n htmlMessage += ``;\n htmlMessage += `
`;\n break;\n }\n default: { }\n }\n }\n }\n else if (!ignoreNextLine) {\n let outText = await resolveMessageVariables(this_instruction, callBody);\n pdfLine(outText, { size: 'medium' });\n }\n } while (printInstructions.length > 0);\n\n // Finish\n\n let refText = `AVA reference: ${body.client || body.client_id}/${body.requestID} (${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()})`;\n if (body.local_key) {\n htmlMessage += `
AVA request number: ${body.local_key}
`;\n rawMessage += `\\n\\rAVA request number: ${body.local_key}`;\n pdfLine(`AVA request number: ${body.local_key}`, { size: 'tiny', after: 1, yPos: 'footer', align: 'center' });\n pdfLine(refText, { noNewPage: true, noNewLine: true, before: 1, align: 'center' });\n }\n else {\n pdfLine(refText, { noNewPage: true, yPos: 'footer', align: 'center' });\n }\n\n htmlMessage += `
${refText}
`;\n htmlMessage += `
***** END *****

`;\n rawMessage += `\\n\\r${refText}\\n***** END *****`;\n\n if (body.fileName && body.fileName.slice(-4) !== '.pdf') {\n body.fileName += '.pdf';\n }\n\n let pdfInfo = {\n s3Key: (body.fileName || `AVA_${body.requestID.replace('~', '_')}.pdf`),\n s3Bucket: (body.S3_bucket || 'theseus-medical-storage')\n };\n\n let s3Resp;\n if (!body.multiPrint || body.multiPrint.lastDoc) {\n pdfLine(`***** END *****`, { noNewPage: true, noNewLine: true, before: 1 });\n\n let this_method = body.overrideMethod || body.messaging?.format?.method || body.messaging[0].format.method;;\n let pdfResp = await savePDF(doc, pdfInfo, { local: !body.PDF, S3: true, onSave: this_method });\n if (pdfResp.responseData.s3Resp) {\n pdfInfo.s3Location = pdfResp.responseData.s3Resp.Location;\n }\n\n let pBlob = doc.output('blob');\n let data64 = (doc.output('datauri')).split(';base64,')[1];\n let fileName = `${body.client || body.client_id}_${body.local_key}_${body.fileName || 'document'}.pdf`;\n s3Resp = await s3\n .upload({\n Bucket: 'theseus-medical-storage',\n Key: fileName,\n Body: pBlob,\n ACL: 'public-read-write',\n ContentType: 'application/pdf'\n })\n .promise()\n .catch(err => {\n cl(`PDF not saved by AVA. The reason is ${err.message}`);\n });\n s3Resp.data = data64;\n\n }\n return [htmlMessage, rawMessage, s3Resp];\n}\n\n\nexport async function savePDF(doc, pdfInfo, options = {}) {\n let s3Resp;\n let responseStatus = 400;\n let responseData = { message: [] };\n if (options.S3) {\n let goodS3 = true;\n s3Resp = await s3\n .upload({\n Bucket: pdfInfo.s3Bucket,\n Key: pdfInfo.s3Key,\n Body: doc.output('blob'),\n ACL: 'public-read-write',\n ContentType: 'application/pdf'\n })\n .promise()\n .catch(err => {\n cl(`PDF not saved by AVA. The reason is ${err.message}`);\n goodS3 = false;\n responseStatus = 401;\n responseData.message = err.message;\n });\n if (goodS3) {\n if (options.onSave === 'print') {\n window.open(s3Resp.Location);\n }\n responseStatus = 200;\n responseData.message.push(`S3 saved at ${s3Resp.Location}`);\n responseData.s3Resp = s3Resp;\n }\n }\n if (options.local) {\n doc.save(pdfInfo.s3Key);\n responseStatus++;\n responseData.message.push(`Locally saved as ${pdfInfo.s3Key}`);\n responseData.saveName = pdfInfo.s3Key;\n }\n return {\n responseStatus,\n responseData\n };\n\n}\n\nexport async function mealTicketFormat(body, requestRec = {}) {\n\n // *********** GET ALL REQ THAT MATCH LOCAL_KEY IN THE BODY *********** //\n let seat_key = body.tableNumberKey || 'Seat Assignment';\n if (!body.local_key) {\n let keyRequest = await getServiceRequests({\n request_id: body.request_id,\n client_id: body.client || body.client_id\n });\n if (keyRequest.length === 0) { return null; }\n body.local_key = keyRequest[0].local_key;\n }\n let requestList = await getServiceRequests({\n local_key: body.local_key,\n client_id: body.client || body.client_id\n });\n if (requestList.length === 0) {\n if (Object.keys(requestRec).length > 0) {\n requestList.push(requestRec);\n }\n else {\n return null;\n }\n }\n // Sort the requests\n requestList.sort((a, b) => {\n let aSort, bSort;\n if (a.original_request.textInput && a.original_request.textInput[seat_key]) {\n aSort = a.original_request.textInput[seat_key];\n }\n if (b.original_request.textInput && b.original_request.textInput[seat_key]) {\n bSort = b.original_request.textInput[seat_key];\n }\n return ((aSort < bSort) ? -1 : 1);\n });\n\n // Prep the PDF output\n let htmlText = [];\n let plainText = [];\n if (!body.margin) { body.margin = {}; }\n let page = {\n width: body.pageWidth || 160,\n border: body.border || true,\n font: {\n family: 'Helvetica',\n size: { large: 14, medium: 12, small: 10, tiny: 8 }\n },\n layout: body.orientation || 'portrait',\n info: { author: 'AVA Senior Living', title: 'Meal Ticket' },\n margin: {\n top: body.margin.top || 42,\n bottom: body.margin.bottom || 14,\n left: body.margin.left || 4,\n right: body.margin.right || 4\n }\n };\n page.printableArea = page.width - page.margin.left - page.margin.right;\n let yPos = page.margin.top;\n let style = `\"padding-top: ${page.margin.top}px; padding-bottom: ${page.margin.bottom}px; width: ${page.width}px; font-family: ${page.font.family}; ${page.border ? 'border: 2px solid black;' : ''} color: black; padding-left: ${page.margin.left}px; padding-right: ${page.margin.right}px\"`;\n const doc = new jsPDF({\n orientation: \"portrait\",\n unit: \"px\",\n // format: [page.width, page.width * 3]\n format: [page.width, page.width * Math.max(3, requestList.length * 1.15)]\n });\n\n htmlText.push(``);\n\n // ********** LOGO ********** //\n if (body.logo) {\n htmlText.push(`
`);\n let logo_dimensions = [150, 100];\n if (body.logo_dimensions) {\n logo_dimensions = body.logo_dimensions;\n }\n htmlText.push(``);\n htmlText.push(`
`);\n }\n\n htmlText.push(`

`);\n\n // ********** TITLE ********** //\n let titleWords = body.subject || body?.format?.subject || body.activityName || 'Meal Ticket';\n titleWords = await resolveMessageVariables(titleWords, body);\n if (body.reprint) { titleWords = '*** REPRINT ' + titleWords + ' ***'; };\n style = `\"text-align:center; font-size: ${page.font.size.large};\"`;\n let outTitle = titleCase(titleWords);\n pdfLineMealTicket(outTitle, page.font.size.large, 'normal', 0, 0, 0, { align: 'center' });\n htmlText.push(`

${outTitle}
`);\n plainText.push(outTitle);\n if (body.client_name) {\n let outClientName = titleCase(body.client_name);\n pdfLineMealTicket(outClientName, page.font.size.large, 'normal', 0, 0, 0, { align: 'center' });\n htmlText.push(`
${outClientName}
`);\n plainText.push(outClientName);\n }\n\n htmlText.push(`
`);\n plainText.push(' ');\n\n // ********** HEADER ********** //\n // Pick-off the first request for Header info for the ticket\n let this_request = requestList[0];\n let [author_id, order_timestamp] = this_request.request_id.split('~');\n let author_name = await makeName(author_id);\n let table_key = body.tableNumberKey || 'Table Number';\n let location_key = body.locationKey || 'Room Number';\n style = `\"text-align:center; font-size: ${page.font.size.small};\"`;\n let outAuthor = titleCase(author_name);\n pdfLineMealTicket(`Created by: ${outAuthor}`, page.font.size.small, 'normal', 0, -0.2, 0, { align: 'center' });\n htmlText.push(`
Created by: ${outAuthor}
`);\n plainText.push(outAuthor);\n let outTime = makeDate(order_timestamp).absolute;\n pdfLineMealTicket(`${outTime}`, page.font.size.small, 'normal', 0, 0, 0, { align: 'center' });\n htmlText.push(`
${outTime}
`);\n plainText.push(outTime);\n if (this_request.original_request.textInput && this_request.original_request.textInput[table_key]) {\n pdfLineMealTicket(`Table: ${this_request.original_request.textInput[table_key]}`, page.font.size.small, 'bold', 0, 0, 0, { align: 'center' });\n htmlText.push(`
Table: ${this_request.original_request.textInput[table_key]}
`);\n plainText.push(`Table: ${this_request.original_request.textInput[table_key]}`);\n }\n if (this_request.original_request.textInput && this_request.original_request.textInput[location_key]) {\n pdfLineMealTicket(`Room: ${this_request.original_request.textInput[location_key]}`, page.font.size.small, 'bold', 0, 0, 0, { align: 'center' });\n htmlText.push(`
Room: ${this_request.original_request.textInput[location_key]}
`);\n plainText.push(`Room: ${this_request.original_request.textInput[location_key]}`);\n }\n\n htmlText.push(`

`);\n\n // ********** ORDERS ********** //\n for (let r = 0; r < requestList.length; r++) {\n let this_request = requestList[r];\n let requestor = this_request.on_behalf_of;\n if (!requestor) { requestor = await makeName(this_request.requestor); }\n htmlText.push(`

`);\n plainText.push(' ');\n style = `\"font-size: ${page.font.size.medium}; padding-top: 0.5em;\"`;\n let outSeat = '';\n if (this_request.original_request.textInput && this_request.original_request.textInput[seat_key]) {\n outSeat = this_request.original_request.textInput[seat_key] + ' - ';\n }\n let outRequestor = outSeat + titleCase(requestor);\n pdfLineMealTicket(outRequestor, page.font.size.medium, 'bold', 0, 1);\n htmlText.push(`

${outRequestor}
`);\n plainText.push(outRequestor);\n // eslint-disable-next-line\n this_request.original_request.selections.forEach(s => {\n style = `\"font-size: ${page.font.size.medium}; padding-top: 0.5em; padding-left: 0;\"`;\n let [selection, ...options] = s.split(/[();,]/);\n if (this_request.original_request.hasOwnProperty('qualifiers')\n && this_request.original_request.qualifiers.hasOwnProperty(selection.trim())\n ) {\n Object.values(this_request.original_request.qualifiers[selection.trim()]).forEach(choiceList => {\n choiceList.forEach(choice => {\n if (!options.includes(choice)) {\n options.push(choice);\n }\n });\n });\n }\n pdfLineMealTicket(selection, page.font.size.medium, 'normal');\n htmlText.push(`
${selection}
`);\n plainText.push(selection);\n if (options.length > 0) {\n style = `\"font-size: ${page.font.size.medium}; padding-left: 2em;\"`;\n options.forEach((o, i) => {\n let outO = titleCase(o.trim());\n if (outO !== '') {\n pdfLineMealTicket(outO, page.font.size.small, 'normal', 1, (i === 0 ? -0.2 : -0.1), ((i === (options.length - 1)) ? 0.2 : 0));\n htmlText.push(`
${outO}
`);\n plainText.push(outO);\n }\n });\n }\n });\n for (let field in this_request.original_request.textInput) {\n if ((field !== table_key) && (field !== seat_key) && (field !== location_key)) {\n let tLine = `>>> ${this_request.original_request.textInput[field]} <<<`;\n pdfLineMealTicket(tLine, page.font.size.medium, 'normal', 0, 1);\n style = `\"font-size: ${page.font.size.medium}; padding-top: 0.5em;\"`;\n htmlText.push(`
${tLine}
`);\n plainText.push(`--${tLine}`);\n }\n }\n htmlText.push(`

`);\n }\n\n // ********** INITIALS ********** //\n if (body.initials) {\n pdfLineMealTicket('Initials _________', page.font.size.medium, 'normal', 0, 2, 1);\n htmlText.push(`

Initials _________

`);\n plainText.push(' ');\n plainText.push(' ');\n plainText.push('Initials _________');\n }\n\n // ********** FOOTERS ********** //\n pdfLineMealTicket('AVA Senior Living', page.font.size.tiny, 'normal', 0, 2, 0, { align: 'center' });\n pdfLineMealTicket(`ID ${this_request.local_key}`, page.font.size.tiny, 'normal', 0, 0, 0, { align: 'center' });\n pdfLineMealTicket('****** END ******', page.font.size.tiny, 'normal', 0, 0, 4, { align: 'center' });\n htmlText.push(`

`);\n style = `\"font-size: ${page.font.size.tiny}; text-align:center;\"`;\n htmlText.push(`

${this_request.local_key}/${this_request.request_id}
`);\n htmlText.push(`
AVA Senior Living
`);\n htmlText.push(`
****** END ******
`);\n htmlText.push(`

`);\n plainText.push(' ');\n plainText.push(' ');\n plainText.push(`${this_request.local_key}/${this_request.request_id}`);\n plainText.push(`AVA Senior Living`);\n plainText.push(`****** END ******`);\n\n htmlText.push(``);\n\n doc.rect(page.margin.left - 2, page.margin.top - page.font.size.large - 2, page.width - 4, yPos - page.margin.top);\n\n let pBlob = doc.output('blob');\n let data64 = (doc.output('datauri')).split(';base64,')[1];\n let fileName = `${body.client || body.client_id}_${this_request.local_key}_mealticket.pdf`;\n let s3Resp = await s3\n .upload({\n Bucket: 'theseus-medical-storage',\n Key: fileName,\n Body: pBlob,\n ACL: 'public-read-write',\n ContentType: 'application/pdf'\n })\n .promise()\n .catch(err => {\n cl(`PDF not saved by AVA. The reason is ${err.message}`);\n });\n // await doc.save(fileName, { returnPromise: true });\n s3Resp.data = data64;\n\n return [htmlText.join(''), plainText.join('\\n'), s3Resp];\n\n function pdfLineMealTicket(text, size, style, indent = 0, before, after, options) {\n if (style) { doc.setFont(page.font.family, style); }\n let lastSize = page.font.size.medium;\n if (size) {\n doc.setFontSize(size);\n lastSize = size;\n }\n if (before) { yPos += before * size; }\n let i = 0;\n if (indent) { i = indent * page.font.size.medium; }\n do {\n let nextLine;\n if (doc.getTextWidth(text) > page.printableArea) {\n let OGtext = text;\n let tWords = text.split(/\\s+/);\n let firstLine = text;\n do {\n tWords.pop();\n firstLine = tWords.join(' ');\n } while (doc.getTextWidth(firstLine) > (page.printableArea - 15));\n text = firstLine;\n nextLine = OGtext.slice(text.length + 1);\n }\n if (options) {\n if (options.align === 'center') { doc.text(text, page.width / 2, yPos, options); }\n else { doc.text(text, page.margin.left + i, yPos, options); }\n }\n else { doc.text(text, page.margin.left + i, yPos); }\n yPos += lastSize;\n text = nextLine;\n } while (text);\n if (after) { yPos += (after * size); }\n return;\n }\n}\n\nasync function pdfLaunch(body) {\n if (!body.hasOwnProperty('pdf')) { body.pdf = {}; }\n if (!doc || !body.multiPrint || body.multiPrint.firstDoc) {\n doc = new jsPDF({\n orientation: \"portrait\",\n unit: \"px\",\n format: ((body.pdf.pageWidth) ? [body.pdf.pageWidth, (body.pdf.pageHeight || 9999)] : [563, 750])\n });\n }\n else {\n doc.addPage({\n orientation: \"portrait\",\n format: ((body.pdf.pageWidth) ? [body.pdf.pageWidth, (body.pdf.pageHeight || 9999)] : [563, 750])\n });\n }\n // doc.autoPrint();\n page = {\n width: doc.internal.pageSize.width,\n height: doc.internal.pageSize.height,\n center: (doc.internal.pageSize.width / 2),\n border: (body.pdf.hasOwnProperty('border')) ? body.pdf.border : true,\n font: {\n family: 'Helvetica',\n size: { large: 14, medium: 12, small: 10, tiny: 8 }\n },\n layout: (body.pdf.hasOwnProperty('orientation')) ? body.pdf.orientation : 'portrait',\n info: { author: 'AVA Senior Living' },\n margin: {\n top: (body.pdf.margin && body.pdf.margin.top) || (doc.internal.pageSize.height / 20),\n bottom: (body.pdf.margin && body.pdf.margin.bottom) || (doc.internal.pageSize.height / 15),\n left: (body.pdf.margin && body.pdf.margin.left) || (doc.internal.pageSize.width / 12),\n right: (body.pdf.margin && body.pdf.margin.right) || (doc.internal.pageSize.width / 12)\n }\n };\n page.bottom = page.height - (2 * page.margin.bottom);\n page.right = page.width - page.margin.right;\n page.centerPoint = page.width / 2;\n page.printableArea = page.width - page.margin.left - page.margin.right;\n\n if (body.pdf?.title) {\n page.title = (await resolveMessageVariables(body.pdf.title, body)).replace(/\\(.+\\)/g, '').trim();\n }\n else if (body.subject) {\n page.title = (await resolveMessageVariables(body.subject, body)).replace(/\\(.+\\)/g, '').trim();\n }\n else if (body.format?.subject) {\n page.title = (await resolveMessageVariables(body.format.subject, body)).replace(/\\(.+\\)/g, '').trim();\n }\n else if (body.activityName) {\n page.title = await resolveMessageVariables(body.activityName, body);\n }\n else {\n page.title = 'AVA Senior Living';\n }\n if (body.reprint) {\n page.title = `*** REPRINT ${page.title} ***`;\n };\n page.info.title = page.title;\n clt({ page });\n\n let nowTime = makeDate(new Date());\n pdfCurrent = {\n yPos: page.margin.top,\n xPos: page.margin.left,\n pageNumber: ((body.multiPrint && !body.multiPrint.firstDoc) ? doc.internal.getNumberOfPages() + 1 : 1),\n indent: 0,\n reportTime: nowTime.absolute,\n timestamp: nowTime.numeric24\n };\n let customizations = await getCustomizations('*all', body.client || body.client_id);\n if (customizations['client_name']) {\n pdfCurrent.client_name = customizations['client_name'];\n }\n else {\n pdfCurrent.client_name = `Client = ${body.client || body.client_id}`;\n };\n if (customizations['print']) {\n let print_specs = customizations['print'];\n if (print_specs.size) {\n page.font.size = {\n large: ((print_specs.size <= 5) ? 20 * print_specs.size : print_specs.size),\n medium: ((print_specs.size <= 5) ? 16 * print_specs.size : print_specs.size),\n small: ((print_specs.size <= 5) ? 12 * print_specs.size : print_specs.size),\n tiny: ((print_specs.size <= 5) ? 8 * print_specs.size : print_specs.size),\n };\n }\n }\n else {\n pdfCurrent.client_name = `Client = ${body.client || body.client_id}`;\n };\n if (customizations['logo']) {\n pdfCurrent.logo = getObject(customizations['logo'], 'logo');\n // pdfCurrent.logo64 = await getObject64(customizations['logo'], 'logo');\n if (customizations['logo_dimensions']) {\n pdfCurrent.logo_width = customizations['logo_dimensions'][0] / 2;\n pdfCurrent.logo_height = customizations['logo_dimensions'][1] / 2;\n }\n else {\n pdfCurrent.logo_width = 75;\n pdfCurrent.logo_height = 75;\n }\n }\n pdfStyle('reset');\n}\n\nfunction pdfHeader(pageN) {\n clt({ pdfCurrent });\n let savedStyle = Object.assign({}, pdfCurrent);\n pdfCurrent.yPos = page.margin.top;\n if (pageN > 1) {\n pdfStyle('reset');\n doc.addPage({\n orientation: \"portrait\",\n unit: \"px\",\n format: (page.width ? [page.width, page.height] : 'letter')\n });\n pdfDown(2);\n }\n else if (pdfCurrent.logo) {\n // doc.addImage(pdfCurrent.logo, 'PNG', page.center - (pdfCurrent.logo_width / 2), pdfCurrent.yPos, pdfCurrent.logo_width, pdfCurrent.logo_height);\n // pdfCurrent.yPos += pdfCurrent.logo_height;\n }\n pdfStyle({ size: 'large', align: 'center', style: 'bold' });\n doc.text(page.title, page.center, pdfCurrent.yPos, { align: 'center' });\n pdfDown(1);\n if (pageN > 1) {\n pdfStyle({ size: 'small', before: 1 });\n doc.text(`Page ${pdfCurrent.pageNumber}`, page.width / 2, pdfCurrent.yPos - 3, { align: 'center' });\n pdfDown(4);\n if (pdfCurrent.key) {\n pdfStyle({ size: 'medium', align: 'left', style: 'bold' });\n doc.text(titleCase(pdfCurrent.key), page.margin.left, pdfCurrent.yPos);\n let newX = page.margin.left + doc.getTextWidth(titleCase(pdfCurrent.key)) + 5;\n pdfStyle({ size: 'small', style: 'normal' });\n doc.text('(continued)', newX, pdfCurrent.yPos);\n }\n pdfStyle('reset');\n pdfCurrent = Object.assign({}, savedStyle, { yPos: pdfCurrent.yPos });\n pdfStyle(pdfCurrent);\n }\n else {\n pdfStyle('reset');\n pdfDown(2);\n }\n}\n\nasync function pdfHTML(text, options = {}) {\n clt({ pdfLine: text, options });\n if (options) { pdfStyle(options); }\n if (options.before) { pdfDown(options.before); }\n if (options.yPos && !isNaN(options.yPos)) {\n pdfCurrent.yPos = options.yPos;\n }\n else if (options.yPos && (options.yPos === 'footer')) {\n pdfCurrent.yPos = page.height - page.margin.bottom - 20;\n pdfCurrent.xPos = page.margin.left;\n options.noNewPage = true;\n }\n else if (options.yPos && (options.yPos === 'header')) {\n pdfCurrent.yPos = page.margin.top;\n options.noNewPage = true;\n }\n else if (!options.noNewLine) {\n pdfDown(1);\n }\n if (!options.noNewPage && (pdfCurrent.yPos >= page.bottom)) {\n let savedStyle = Object.assign({}, pdfCurrent);\n pdfLine(page.footerText, { size: 'tiny', after: 1, yPos: 'footer', align: 'center' });\n pdfCurrent = Object.assign({}, savedStyle, { yPos: pdfCurrent.yPos });\n pdfStyle(pdfCurrent);\n pdfHeader(++pdfCurrent.pageNumber);\n }\n /** calculate the imgWidth, imgHeight to print on PDF \n * so it can scale in equal proportions*/\n let estimated_rows_needed;\n if (options.printed_height) {\n estimated_rows_needed = options.printed_height + 2;\n }\n else {\n let sizeEstimate = doc.getTextWidth(text);\n estimated_rows_needed = Math.ceil(sizeEstimate / page.width) + (text.split(' (page.height - page.margin.top - page.margin.bottom)) {\n let remaining_y_units = page.height - page.margin.bottom - pdfCurrent.yPos;\n scale_factor = remaining_y_units / estimated_y_units_needed;\n if (scale_factor < 0.6) { // if we are going to shrink too much, jump to next page and reset scale\n let savedStyle = Object.assign({}, pdfCurrent);\n pdfLine(page.footerText, { size: 'tiny', after: 1, yPos: 'footer', align: 'center' });\n pdfCurrent = Object.assign({}, savedStyle, { yPos: pdfCurrent.yPos });\n pdfStyle(pdfCurrent);\n pdfHeader(++pdfCurrent.pageNumber);\n scale_factor = 1;\n }\n }\n\n const BOLD = ''; // \"\\x1b[1m\";\n const NORMAL = ''; // \"\\x1b[22m\";\n\n let noNewLine = false;\n text = text.replace(//gi, '');\n text = text.replace(//gi, '');\n text = text.replace(//ig, BOLD);\n text = text.replace(/<\\/strong>/ig, NORMAL);\n text = text.replace(/<\\/div>/ig, '\\n');\n text = text.replace(/<\\/li>/ig, '\\n');\n text = text.replace(/
  • /ig, ' * ');\n text = text.replace(/<\\/ul>/ig, '\\n');\n text = text.replace(/<\\/p>/ig, '\\n');\n text = text.replace(//gi, \"\\n\");\n text = text.replace(/<[^>]+>/ig, '');\n text = text.replace('%%', '');\n pdfLine(text, { size: 'medium', align: 'left', noNewLine });\n noNewLine = true;\n\n\n /*\n await doc.html(`

    ${text}

    `, {\n // await doc.html(`

    ${text}

    `, {\n callback: function (doc) {\n return doc;\n },\n width: final_width,\n height: final_height,\n windowWidth: page.width,\n html2canvas: {\n width: final_width,\n scale: scale_factor * 0.8\n },\n margin: [page.margin.left, page.margin.top, page.margin.right, page.margin.bottom],\n x: (options.print_xpos || 0),\n y: ((this_page - 1) * page.height) + pdfCurrent.yPos,\n autoPaging: 'text'\n });\n */\n\n if (!options.noNewPage && ((pdfCurrent.yPos >= page.bottom))) {\n let savedStyle = Object.assign({}, pdfCurrent);\n pdfLine(page.footerText, { size: 'tiny', after: 1, yPos: 'footer', align: 'center' });\n pdfCurrent = Object.assign({}, savedStyle, { yPos: pdfCurrent.yPos });\n pdfStyle(pdfCurrent);\n pdfHeader(++pdfCurrent.pageNumber);\n }\n pdfCurrent.xPos = page.margin.left;\n\n if (options.after) { pdfDown(options.after); }\n}\n\nfunction pdfLine(text, options = {}) {\n clt({ pdfLine: text, options });\n if (options) { pdfStyle(options); }\n if (options.before) { pdfDown(options.before); }\n if (options.yPos && !isNaN(options.yPos)) {\n pdfCurrent.yPos = options.yPos;\n }\n else if (options.yPos && (options.yPos === 'footer')) {\n pdfCurrent.yPos = Math.max((page.height - page.margin.bottom - 20), pdfCurrent.yPos);\n pdfCurrent.xPos = page.margin.left;\n options.noNewPage = true;\n }\n else if (options.yPos && (options.yPos === 'header')) {\n pdfCurrent.yPos = page.margin.top;\n options.noNewPage = true;\n }\n else if (!options.noNewLine) {\n pdfDown(1);\n }\n if (!options.noNewPage && ((pdfCurrent.yPos + ((options.protectOrphan ? 2 : 0) * pdfCurrent.fontSize)) >= page.bottom)) {\n let savedStyle = Object.assign({}, pdfCurrent);\n pdfLine(page.footerText, { size: 'tiny', after: 1, yPos: 'footer', align: 'center' });\n pdfCurrent = Object.assign({}, savedStyle, { yPos: pdfCurrent.yPos });\n pdfStyle(pdfCurrent);\n pdfHeader(++pdfCurrent.pageNumber);\n }\n if (options.image) {\n var imageWidth, imageHeight;\n if (options.image.includes('base64')) {\n var img = new Image();\n img.src = options.image;\n img.onload = function () {\n imageWidth = img.naturalWidth;\n imageHeight = img.naturalHeight;\n };\n }\n else {\n imageWidth = pdfCurrent.fontSize * 2 * (pdfCurrent.fontSize / page.font.size['medium']);\n imageHeight = imageWidth;\n }\n let xOffset;\n try {\n switch (pdfCurrent.align) {\n case 'center': {\n xOffset = page.centerPoint - (imageWidth / 2);\n doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos, imageWidth, imageHeight);\n pdfCurrent.xPos = page.centerPoint + (imageWidth / 2);\n break;\n }\n case 'right': {\n xOffset = page.width - page.margin.right - imageWidth;\n doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos, imageWidth, imageHeight);\n pdfCurrent.xPos = page.width - page.margin.right;\n break;\n }\n default: {\n xOffset = pdfCurrent.xPos + pdfCurrent.indent;\n // let imageProps = doc.getImageProperties(options.image);\n doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos, imageWidth, imageHeight);\n pdfCurrent.yPos += imageHeight;\n pdfDown(1);\n }\n }\n }\n catch {\n doc.html(``);\n switch (pdfCurrent.align) {\n case 'center': {\n pdfCurrent.xPos = page.centerPoint + (imageWidth / 2);\n break;\n }\n case 'right': {\n pdfCurrent.xPos = page.width - page.margin.right;\n break;\n }\n default: {\n pdfCurrent.xPos = xOffset + imageWidth;\n }\n }\n }\n }\n if (options.radio) {\n if (((pdfCurrent.xPos + doc.getTextWidth(text) + pdfCurrent.indent + 8) > page.printableArea)) {\n pdfDown(1);\n pdfCurrent.xPos += 8;\n }\n doc.circle(pdfCurrent.xPos + pdfCurrent.indent, pdfCurrent.yPos - 1, 3, (options.radioSelected ? 'F' : 'S'));\n doc.setFontSize(pdfCurrent.fontSize * 0.8);\n doc.text(text, pdfCurrent.xPos + pdfCurrent.indent + 8, pdfCurrent.yPos + 1);\n pdfCurrent.xPos = (pdfCurrent.xPos + pdfCurrent.indent + 8) + doc.getTextWidth(text) + pdfCurrent.fontSize;\n doc.setFontSize(pdfCurrent.fontSize);\n }\n else if (options.html) {\n console.log(`html at right:${pdfCurrent.xPos}; top:${pdfCurrent.yPos}; width:${page.width - page.margin.right}`);\n doc.html(text, {\n callback: function (doc) {\n return doc;\n },\n width: page.width - page.margin.right,\n windowWidth: page.width,\n html2canvas: {\n width: page.width,\n },\n x: pdfCurrent.xPos,\n y: pdfCurrent.yPos,\n autoPaging: 'text'\n });\n }\n else if (text && (text.length > 0)) {\n // this little chunk deals with text overflow\n let tWords = [];\n let split_lines = text.split(//gi);\n for (let this_line of split_lines) {\n if ((pdfCurrent.align === 'center') && (doc.getTextWidth(this_line) > page.printableArea)) {\n let pWords = doc.splitTextToSize(this_line, page.printableArea);\n tWords.push(...pWords);\n }\n else if ((pdfCurrent.align !== 'center') && ((doc.getTextWidth(this_line) + pdfCurrent.xPos + pdfCurrent.indent) > page.right)) {\n let pWords = doc.splitTextToSize(this_line, (page.right - (pdfCurrent.xPos + pdfCurrent.indent)));\n tWords.push(...pWords);\n }\n if (this_line !== split_lines[split_lines.length - 1]) {\n tWords.push(' ');\n }\n }\n if (tWords.length > 0) {\n for (let t = 0; t < tWords.length - 1; t++) {\n pdfDown(1);\n pdfLine(tWords[t], Object.assign({}, options, { noNewLine: true, after: 0 }));\n }\n pdfDown(1);\n text = tWords[tWords.length - 1];\n }\n if (pdfCurrent.align === 'center') {\n let xOffset = page.centerPoint - (doc.getTextWidth(text) / 2);\n doc.text(text, xOffset, pdfCurrent.yPos);\n pdfCurrent.xPos = page.centerPoint + (doc.getTextWidth(text) / 2) + (pdfCurrent.fontSize / 4);\n }\n else if (pdfCurrent.align === 'right') {\n doc.text(text, page.width - page.margin.right, pdfCurrent.yPos, { align: 'right' });\n pdfCurrent.xPos = page.margin.right;\n }\n else if (options.noNewLine) {\n doc.text(text, pdfCurrent.xPos, pdfCurrent.yPos);\n pdfCurrent.xPos += doc.getTextWidth(text) + (pdfCurrent.fontSize / 4);\n }\n else {\n doc.text(text, pdfCurrent.xPos + pdfCurrent.indent, pdfCurrent.yPos);\n pdfCurrent.xPos = (pdfCurrent.xPos + pdfCurrent.indent) + doc.getTextWidth(text) + (pdfCurrent.fontSize / 4);\n }\n }\n if (options.after) { pdfDown(options.after); }\n return;\n}\n\n\nasync function pdfImage(text, options = {}) {\n clt({ pdfLine: text, options });\n if (options) { pdfStyle(options); }\n if (options.before) { pdfDown(options.before); }\n if (options.yPos && !isNaN(options.yPos)) {\n pdfCurrent.yPos = options.yPos;\n }\n else if (options.yPos && (options.yPos === 'footer')) {\n pdfCurrent.yPos = Math.max((page.height - page.margin.bottom - 20), pdfCurrent.yPos);\n pdfCurrent.xPos = page.margin.left;\n options.noNewPage = true;\n }\n else if (options.yPos && (options.yPos === 'header')) {\n pdfCurrent.yPos = page.margin.top;\n options.noNewPage = true;\n }\n else if (!options.noNewLine) {\n pdfDown(1);\n }\n if (!options.noNewPage && ((pdfCurrent.yPos + ((options.protectOrphan ? 2 : 0) * pdfCurrent.fontSize)) >= page.bottom)) {\n let savedStyle = Object.assign({}, pdfCurrent);\n pdfLine(page.footerText, { size: 'tiny', after: 1, yPos: 'footer', align: 'center' });\n pdfCurrent = Object.assign({}, savedStyle, { yPos: pdfCurrent.yPos });\n pdfStyle(pdfCurrent);\n pdfHeader(++pdfCurrent.pageNumber);\n }\n if (options.image) {\n var imageWidth, imageHeight;\n if (options.image.includes('base64')) {\n var img = new Image();\n img.src = options.image;\n await getImageSize(img);\n imageWidth = img.naturalWidth;\n imageHeight = img.naturalHeight;\n }\n else {\n imageWidth = pdfCurrent.fontSize * 2 * (pdfCurrent.fontSize / page.font.size['medium']);\n imageHeight = imageWidth;\n }\n if (imageWidth === 0) {\n imageWidth = pdfCurrent.fontSize * 2 * (pdfCurrent.fontSize / page.font.size['medium']);\n imageHeight = imageWidth;\n }\n else if (imageWidth > (page.width / 4)) {\n var shrinkFactor = (page.width / 4) / imageWidth;\n imageWidth = page.width / 4;\n imageHeight = imageHeight *= shrinkFactor;\n }\n let xOffset;\n try {\n switch (pdfCurrent.align) {\n case 'center': {\n xOffset = page.centerPoint - (imageWidth / 2);\n doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos, imageWidth, imageHeight);\n pdfCurrent.xPos = page.centerPoint + (imageWidth / 2);\n break;\n }\n case 'right': {\n xOffset = page.width - page.margin.right - imageWidth;\n doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos, imageWidth, imageHeight);\n pdfCurrent.xPos = page.width - page.margin.right;\n break;\n }\n default: {\n xOffset = pdfCurrent.xPos + pdfCurrent.indent;\n // let imageProps = doc.getImageProperties(options.image);\n doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos, imageWidth, imageHeight);\n pdfCurrent.yPos += imageHeight;\n pdfDown(1);\n }\n }\n }\n catch {\n doc.html(``);\n switch (pdfCurrent.align) {\n case 'center': {\n pdfCurrent.xPos = page.centerPoint + (imageWidth / 2);\n break;\n }\n case 'right': {\n pdfCurrent.xPos = page.width - page.margin.right;\n break;\n }\n default: {\n pdfCurrent.xPos = xOffset + imageWidth;\n }\n }\n }\n }\n if (text && (text.length > 0)) {\n // this little chunk deals with text overflow\n let tWords = [];\n if ((pdfCurrent.align === 'center') && (doc.getTextWidth(text) > page.printableArea)) {\n tWords = doc.splitTextToSize(text, page.printableArea);\n }\n else if ((pdfCurrent.align !== 'center') && ((doc.getTextWidth(text) + pdfCurrent.xPos + pdfCurrent.indent) > page.right)) {\n tWords = doc.splitTextToSize(text, (page.right - (pdfCurrent.xPos + pdfCurrent.indent)));\n }\n if (tWords.length > 0) {\n for (let t = 0; t < tWords.length - 1; t++) {\n pdfLine(tWords[t], Object.assign({}, options, { after: 0 }));\n }\n pdfDown(1);\n text = tWords[tWords.length - 1];\n }\n if (pdfCurrent.align === 'center') {\n let xOffset = page.centerPoint - (doc.getTextWidth(text) / 2);\n doc.text(text, xOffset, pdfCurrent.yPos);\n pdfCurrent.xPos = page.centerPoint + (doc.getTextWidth(text) / 2) + pdfCurrent.fontSize;\n }\n else if (pdfCurrent.align === 'right') {\n doc.text(text, page.width - page.margin.right, pdfCurrent.yPos, { align: 'right' });\n pdfCurrent.xPos = page.margin.right;\n }\n else if (pdfCurrent.noNewLine) {\n doc.text(text, pdfCurrent.xPos + pdfCurrent.indent, pdfCurrent.yPos);\n pdfCurrent.xPos += doc.getTextWidth(text) + pdfCurrent.fontSize;\n }\n else {\n doc.text(text, pdfCurrent.xPos + pdfCurrent.indent, pdfCurrent.yPos);\n pdfCurrent.xPos = (pdfCurrent.xPos + pdfCurrent.indent) + doc.getTextWidth(text) + pdfCurrent.fontSize;\n }\n }\n if (options.after) { pdfDown(options.after); }\n return;\n\n function getImageSize(img) {\n return new Promise(res => {\n img.onload = () => res();\n img.onerror = () => res();\n });\n }\n}\n\nfunction pdfDown(n = 1) {\n pdfCurrent.yPos += ((isNaN(n) ? 1 : n) * (pdfCurrent.fontSize * 0.75));\n pdfCurrent.xPos = page.margin.left;\n}\n\nfunction pdfStyle(options = {}) {\n if (options === 'reset') {\n pdfCurrent.style = 'normal';\n doc.setFont(page.font.family, 'normal');\n pdfCurrent.fontSize = page.font.size['medium'];\n doc.setFontSize(pdfCurrent.fontSize);\n pdfCurrent.indent = 0;\n pdfCurrent.align = '';\n }\n else {\n if (options.style) {\n pdfCurrent.style = options.style;\n doc.setFont(page.font.family, options.style);\n }\n if (options.size) {\n if (isNaN(options.size)) {\n if (page.font.size.hasOwnProperty(options.size)) {\n pdfCurrent.fontSize = page.font.size[options.size];\n }\n }\n else { pdfCurrent.fontSize = options.size; }\n doc.setFontSize(pdfCurrent.fontSize);\n }\n if (options.fontSize) {\n pdfCurrent.fontSize = options.fontSize;\n doc.setFontSize(pdfCurrent.fontSize);\n }\n if (options.hasOwnProperty('indent')) { // different because when options.indent === 0, options.indent is false\n pdfCurrent.indent = options.indent;\n }\n if (options.align) {\n pdfCurrent.align = options.align;\n }\n }\n}\n\nexport async function sendMessage(body) { return await sendMessages(body); }\n\nexport async function sendMessages(body) {\n /* Expect body as an object or array of objects with the following structure\n client: ,\n author: \n testMode: (if true, everything will happen EXCEPT the message will not be put in the PostOffice - and therefore not sent)\n messageText: (if present, messageTextthis will override any messageText in the values attribute)\n htmltext: \n recipientList: \" as well>\n subject: \n attachments: [, , ...]\n attachment_data: exists when the attahment(s) are actual file attachments and not links\n preffered_method: \n thread_id: \n */\n cl({ 'in send messages': body });\n let results = [];\n let postTime = new Date().getTime();\n let toSend = [];\n let mCount = 0;\n if (Array.isArray(body)) {\n toSend = body;\n mCount = body.length;\n }\n else {\n toSend = [body];\n mCount = 1;\n }\n for (let m = 0; m < mCount; m++) {\n let currentTime = makeDate(new Date());\n let env = toSend[m];\n if (!('thread_id' in env)) { env.thread_id = `${postTime}.${uuid(6)}`; }\n // clean up recipientList before proceeding\n if (!('recipientList' in env)) { // skip this, no recipients\n results.push({ sent: false, message: `failed - no recipients specified` });\n continue;\n }\n var PostOfficeRec = {\n Item: {\n 'client_id': env.client,\n 'thread_id': env.thread_id,\n 'message_id': `${env.thread_id}.${m}~AVAMessages`,\n 'deliver_time': postTime += m,\n 'patient_id': env.person_id || env.author,\n 'from': env.author,\n 'message_text': env.messageText,\n 'html_message_text': env.htmlText,\n 'preferred_method': env.preferred_method,\n 'subject': env.subject.replace(/\\n/g, \" \").trim() // dont allow invlid characters in the message subject\n },\n TableName: \"PostOffice\"\n };\n if (env.testMode) { PostOfficeRec.TableName = \"TestPostOffice\"; };\n if (env.attachments) {\n PostOfficeRec.Item.attachments = makeArray(env.attachments);\n if (env.attachment_data) {\n PostOfficeRec.Item.attachment_data = Object.assign({}, env.attachment_data);\n }\n }\n if (env.voiceMail) { PostOfficeRec.Item.voice_mail = env.voiceMail; }\n if (env.allowReplyAll) { PostOfficeRec.Item.allowReplyAll = env.allowReplyAll; }\n if (!('subject' in PostOfficeRec.Item)) {\n PostOfficeRec.Item[\"subject\"] = `Message from ${await makeName(env.author)}`;\n }\n let to = [];\n let ind = [];\n if (Array.isArray(env.recipientList)) { to = env.recipientList; }\n else to = [env.recipientList];\n for (let r = 0; r < to.length; r++) {\n PostOfficeRec.Item['message_id'] = `${env.thread_id}.${m}.${r}~AVAMessages`;\n if (to[r].startsWith('GRP//')) {\n let gCode = to[r].split('//')[1];\n if (gCode.includes('/')) {\n let [cl, gr] = gCode.split(/[/]+/);\n PostOfficeRec.Item[\"client_id\"] = cl;\n gCode = gr;\n }\n PostOfficeRec.Item[\"recipient_base\"] = 'group';\n PostOfficeRec.Item[\"recipient_key\"] = gCode;\n let goodSend = true;\n await dbClient\n .put(PostOfficeRec)\n .promise()\n .catch(error => {\n console.log(`Message Engine caught error at 268 adding a Message; error is ${error}`);\n results.push({ sent: false, message: `Unable to send message to group ${gCode} ${currentTime.oaDate}. Error was ${error}` });\n goodSend = false;\n });\n if (goodSend) { results.push({ sent: true, message: `Sent message to group ${gCode} ${currentTime.oaDate}` }); }\n }\n else { ind.push(to[r]); }\n }\n if (ind.length > 0) {\n PostOfficeRec.Item[\"recipient_base\"] = 'list';\n PostOfficeRec.Item[\"recipient_key\"] = ind;\n let goodPost = true;\n await dbClient\n .put(PostOfficeRec)\n .promise()\n .catch(error => {\n cl(`Error writing to Post Office; error is ${error}`);\n results.push({ sent: false, message: `Unable to send message ${currentTime.oaDate}. Error was ${error}` });\n goodPost = false;\n });\n if (goodPost) {\n if (ind.length === 1) {\n let sName = await makeName(ind[0]);\n results.push({ sent: true, message: `Successfully sent to ${sName}` });\n }\n else {\n results.push({ sent: true, message: `Successfully sent to ${ind.length} recipients` });\n }\n }\n }\n }\n return results;\n}\n\nexport async function messageHistory(body) {\n // body should include thread_id\n let mRecs = await getMessages(body);\n let returnArray = [];\n let returnObj = {};\n if (!mRecs) { returnArray.push(`No message history`); }\n else {\n let headerLine = false;\n if (body.in_out && (body.in_out === 'in') && (mRecs.length > 1) && (!body.was_held)) {\n headerLine = `From ${mRecs[0].author.author_name} to ${mRecs.length} addresses`;\n returnArray.push(headerLine);\n }\n mRecs.forEach(mR => {\n let mTime = mR.posted_time || mR.created_time;\n let mInfo = '';\n let mLine = (mR.deliver_method === 'hold') ? 'Held message ' : 'Sent ';\n if (!headerLine && (body.in_out && (body.in_out === 'in'))) {\n mLine += `from ${mR.author.author_name} `;\n }\n mLine += `to ${mR.recipient_list.name.first} ${mR.recipient_list.name.last}`;\n switch (mR.deliver_method) {\n case 'sms': {\n mLine += ' via text message';\n break;\n }\n case 'voice':\n case 'office': {\n mLine += ' via phone call';\n break;\n }\n case 'email': {\n mLine += ' via e-Mail';\n if (mR.composite_key.endsWith('alt_email')) {\n mLine += ' (to alt e-Mail)';\n }\n break;\n }\n case 'hold': {\n break;\n }\n default: { mLine += ` via ${mR.deliver_method}`; }\n }\n if (mR.recipient_list && mR.recipient_list.rule_used) {\n mLine += ` as per rule \"${mR.recipient_list.rule_used}\"`;\n }\n if (mR.results) {\n let mRLast;\n if ((mR.results[0].result === 'callComplete') && (mR.results.length > 0)) { mRLast = mR.results[1]; }\n else { mRLast = mR.results[0]; }\n mTime = mRLast.posted_time;\n switch (mRLast.result) {\n case 'reply': {\n mLine += '. Reply received';\n mInfo = ` Reply is \"${mRLast.update_contents.replace(':', ' -')}\"`;\n break;\n }\n case 'submitted': {\n break;\n }\n case 'replyReceived': {\n mLine += `. ${mR.recipient_list.name.first} replied`;\n break;\n }\n case 'delivery':\n case 'delivered': {\n mLine += '. Delivered';\n break;\n }\n case 'open': {\n mLine += '. Opened';\n break;\n }\n default: {\n mLine += `. ${sentenceCase(mRLast.result)}`;\n }\n }\n }\n mLine += ` ${makeDate(mTime).oaDate}`;\n mLine += mInfo;\n if (!returnObj.hasOwnProperty(mR.deliver_to)) {\n returnObj[mR.deliver_to] = {\n name: `${mR.recipient_list.name.first} ${mR.recipient_list.name.last}`,\n composite_key: mR.composite_key,\n history: (headerLine ? [{\n time: new Date().getTime() + (60 * 60 * 1000), // make sure tis is the most recent date (and displayed first) by setting it an hour in the future\n line: headerLine\n }] : [])\n };\n }\n returnObj[mR.deliver_to].history.push({\n time: mTime,\n line: mLine\n });\n returnArray.push(mLine);\n });\n returnArray.push(' ', `(${body.thread_id})`);\n if (body.returnObject) {\n return returnObj;\n }\n else {\n return returnArray;\n }\n }\n}","import { clt, cl, deepCopy, recordExists, getCustomizations, makeArray, makeString, makeNumber, uuid, dbClient, titleCase, isEmpty, isObject, array_in_array } from './AVAUtilities';\nimport { makeName, getPerson, formatPhone } from './AVAPeople';\nimport { addDays, daysDiff, makeDate, makeTime, addMonths } from './AVADateTime';\nimport { sendMessages, resolveMessageVariables } from './AVAMessages';\n\nimport { jsPDF } from \"jspdf\";\nimport { getGroupsBelongTo } from './AVAGroups';\n\nlet eventCache = {};\n\n// Functions\n\nexport async function addEvent(body) {\n /* request body is\n {\n \"clientId\": patient.client_id,\n \"eventID (optional)\": \"Use this eventID\" (if existing ID, this will override the existing event)\n \"calendar_info\": {\n \"groups\": \n \"description\"\n \"image\"\n \"event_date\",\n \"last_date\"\n \"schedule_type\"\n \"time_from\": time_from_display_string,\n \"time_to\": time_to_display_string,\n \"location\"\n \"owner\"\n \"restrictions\"\n \"signup_type\"\n \"slots\" (24h based time slots)\n \"slot_max_seats\": slot_max_seats,\n \"slot_interval\": slot_interval,\n \"slot_visibility\":\n \"reminder_minutes_Enrolled\"\n \"reminder_minutes_NotEnrolled\"\n }\n }\n */\n // Prepare Event record\n let eventID = `${body.calendar_info.description.replace(/\\W/g, '').slice(0, 8)}_${uuid(6)}`.toLowerCase();\n let occPattern = Object.assign({}, setRecurrence(body.calendar_info.schedule_type));\n\n body.calendar_info.timeObj = Object.assign(\n {\n allDay: body.calendar_info.allDay,\n from: body.calendar_info.time_from,\n to: body.calendar_info.time_to,\n from_minutesSinceMidnight: body.calendar_info.from_minutesSinceMidnight,\n duration: body.calendar_info.time_duration || body.calendar_info.duration\n },\n body.calendar_info.timeObj\n );\n // if allDay sent in, ignore everything else\n if (body.calendar_info.timeObj.allDay) {\n body.calendar_info.timeObj = {\n from_minutesSinceMidnight: 0,\n allDay: true,\n duration: 1440\n };\n }\n else {\n body.calendar_info.timeObj.allDay = false;\n let fromObj = makeTime(body.calendar_info.timeObj.from);\n let toObj = makeTime(body.calendar_info.timeObj.to);\n // if duration sent in, use it instead of both from and to\n if (body.calendar_info.timeObj.duration) {\n if (fromObj.good) {\n let tempTime = fromObj.minutesSinceMidnight + body.calendar_info.timeObj.duration;\n if (tempTime > 1440) {\n tempTime -= 1440;\n }\n toObj = makeTime(`${(Math.floor(tempTime / 60) * 100)}:${(tempTime % 60)}`);\n body.calendar_info.timeObj.from_minutesSinceMidnight = fromObj.minutesSinceMidnight;\n body.calendar_info.timeObj.from = fromObj.time;\n body.calendar_info.timeObj.to = toObj.time;\n }\n // from not good, is \"to\" good?\n else if (toObj.good) {\n let tempTime = toObj.minutesSinceMidnight - body.calendar_info.timeObj.duration;\n if (tempTime < 0) {\n tempTime += 1440;\n }\n fromObj = makeTime(`${(Math.floor(tempTime / 60) * 100)}:${(tempTime % 60)}`);\n body.calendar_info.timeObj.from_minutesSinceMidnight = fromObj.minutesSinceMidnight;\n body.calendar_info.timeObj.from = fromObj.time;\n body.calendar_info.timeObj.to = toObj.time;\n }\n else {\n // we got a duration without EITHER from or to-time being good\n // create an event that goes for \"duration\" minutes, half before and half after 12noon\n let tempTime = 720 - (body.calendar_info.timeObj.duration / 2);\n fromObj = makeTime(`${(Math.floor(tempTime / 60) * 100)}:${(tempTime % 60)}`);\n tempTime = 720 + (body.calendar_info.timeObj.duration / 2);\n toObj = makeTime(`${(Math.floor(tempTime / 60) * 100)}:${(tempTime % 60)}`);\n body.calendar_info.timeObj.from_minutesSinceMidnight = fromObj.minutesSinceMidnight;\n body.calendar_info.timeObj.from = fromObj.time;\n body.calendar_info.timeObj.to = toObj.time;\n }\n }\n else {\n // no duration sent in; calculate what we need\n if (fromObj.good) {\n body.calendar_info.timeObj.from_minutesSinceMidnight = fromObj.minutesSinceMidnight;\n body.calendar_info.timeObj.from = fromObj.time;\n if (toObj.good) {\n body.calendar_info.timeObj.to = toObj.time;\n body.calendar_info.timeObj.duration = toObj.minutesSinceMidnight - fromObj.minutesSinceMidnight;\n if (body.calendar_info.timeObj.duration < 0) {\n body.calendar_info.timeObj.duration += 1440;\n }\n }\n else {\n // good from, no good to-time, set duration as from-time to midnight\n body.calendar_info.timeObj.duration = 1440 - fromObj.minutesSinceMidnight;\n }\n }\n else {\n // from is bad\n if (!toObj.good) {\n // from is bad, to is bad, no duration... nothing to do here except make an all day\n body.calendar_info.timeObj = {\n from_minutesSinceMidnight: 0,\n allDay: true,\n duration: 1440\n };\n }\n else {\n body.calendar_info.timeObj.from_minutesSinceMidnight = 0;\n body.calendar_info.timeObj.duration = toObj.minutesSinceMidnight;\n body.calendar_info.timeObj.to = toObj.time;\n body.calendar_info.timeObj.from = 'Midnight';\n }\n }\n }\n }\n let eventRec = {\n client: body.clientId,\n event_key: eventID,\n event_id: eventID,\n schedule_key: 'event_master',\n record_type: 'event',\n default_forms: body.calendar_info.default_forms,\n customizations: body.calendar_info.customizations,\n eventData: {\n defaultSlotOwners: body.calendar_info.defaultSlotOwners,\n messaging: [],\n event_data: {\n description: body.calendar_info.description,\n owner: makeArray(body.calendar_info.owner),\n groups: setRestrictions(body.calendar_info.restrictions),\n type: body.calendar_info.personal_event ? 'personal' : body.calendar_info.signup_type,\n image: body.calendar_info.image,\n location: {\n // code: (future)\n description: body.calendar_info.location\n },\n time: body.calendar_info.timeObj\n },\n occPattern,\n start_Date: occPattern.first_date || (occPattern.specified ? occPattern.specified[0] : makeDate('today').numeric),\n end_date: occPattern.last_date || (occPattern.specified ? occPattern.specified[occPattern.specified.length - 1] : makeDate('today').numeric),\n last_written_occurrence: 0,\n reminders: {\n reminder_minutes_Enrolled: body.calendar_info.reminder_minutes_Enrolled,\n reminder_minutes_NotEnrolled: body.calendar_info.reminder_minutes_NotEnrolled\n },\n sign_up: {\n name_security: (body.calendar_info.slot_visibility && (body.calendar_info.slot_visibility !== 'show_name')),\n type: body.calendar_info.signup_type,\n },\n slotPattern: setSlots(body.calendar_info),\n slot_object_list: body.calendar_info.slot_object_list\n }\n };\n await dbClient\n .put({\n Item: eventRec,\n TableName: \"Calendar\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Calendar; error is:`, error);\n return false;\n });\n eventCache[eventID] = eventRec;\n let occRecords = await getOccurenceList({\n client: body.clientId,\n event: eventID,\n from_date: eventRec.eventData.occPattern.first_date,\n number_of_occurrences: 30\n });\n if (occRecords) {\n eventRec.occRecords = occRecords;\n }\n return eventRec;\n\n // **********\n\n function setRestrictions(inR) {\n if ((inR) && (inR.length > 0)) { return inR; }\n else { return ['*all']; }\n }\n\n function setRecurrence(inR) {\n let first_date = makeDate(body.calendar_info.event_date);\n if (!body.calendar_info.last_date) {\n body.calendar_info.last_date = addDays(first_date.date, 365);\n }\n let last_date = makeDate(body.calendar_info.last_date).numeric;\n switch (inR) {\n case 'yearly':\n case 'annually_on': {\n return {\n recurrence: 'yearly',\n first_date: first_date.numeric,\n last_date,\n day_of_year: [first_date.numeric % 10000]\n };\n }\n case 'semiannually_on': {\n return {\n recurrence: 'semi_annual',\n first_date: first_date.numeric,\n last_date,\n };\n }\n case 'daily': {\n return {\n recurrence: 'daily',\n first_date: first_date.numeric,\n last_date,\n day_of_week: [0, 1, 2, 3, 4, 5, 6]\n };\n }\n case 'weekdays_only': {\n return {\n recurrence: 'daily',\n first_date: first_date.numeric,\n last_date,\n day_of_week: [1, 2, 3, 4, 5]\n };\n }\n case 'weekends_only': {\n return {\n recurrence: 'daily',\n first_date: first_date.numeric,\n last_date,\n day_of_week: [0, 6]\n };\n }\n case 'weekly_on': {\n return {\n recurrence: 'daily',\n first_date: first_date.numeric,\n last_date,\n day_of_week: body.calendar_info.occDays\n };\n }\n case 'bi-weekly_on': {\n return {\n recurrence: 'bi-weekly',\n first_date: first_date.numeric,\n last_date,\n day_of_week: body.calendar_info.occDays\n };\n }\n case 'monthly_by_dayOfWeek': {\n let ordinal = ['first', 'second', 'third', 'last'];\n return {\n recurrence: 'monthly',\n day_of_month: [ordinal[(Math.min(Math.floor(first_date.date.getDate() / 7.1) + 1, 4)) - 1]],\n day_of_week: [first_date.date.getDay()],\n first_date: first_date.numeric,\n last_date,\n };\n }\n case 'monthly':\n case 'monthly_by_date': {\n return {\n recurrence: 'monthly',\n first_date,\n last_date,\n day_of_month: [first_date.numeric % 100]\n };\n }\n case 'specified':\n case 'specific_date':\n default: {\n return {\n recurrence: 'specified',\n specified: [first_date.numeric]\n };\n }\n }\n }\n\n function setSlots(inCalInfo) {\n if (inCalInfo.slots) { return inCalInfo.slots; }\n else if (inCalInfo.slot_max_seats) { return setSeatNames(inCalInfo.slot_max_seats); }\n else { return null; }\n }\n\n function setSeatNames(inNum) {\n let digits, starter, lastSeat;\n if (inNum < 10) { digits = 1; starter = 11; lastSeat = 10 + inNum; }\n else if (inNum < 100) { digits = 2; starter = 101; lastSeat = 100 + inNum; }\n else if (inNum < 1000) { digits = 3; starter = 1001; lastSeat = 1000 + inNum; }\n else return [];\n let returnArr = [];\n for (let i = starter; i <= lastSeat; i++) {\n returnArr.push((i.toString().slice(-digits)));\n }\n return returnArr;\n }\n};\n\nexport async function myAvailability(requestBody) {\n // check_date, check_person_id, check_client\n // get slots for the occurrence_date you're checking\n let already_booked = []; // {start_time24: hhmm, end_time24: hhmm, event: xxxx, event_description: yyyy}\n let calRecs = await dbClient\n .query({\n KeyConditionExpression: 'client = :c and list_key = :d',\n ExpressionAttributeValues: {\n ':c': requestBody.client || requestBody.client_id || requestBody.check_client,\n ':d': `${requestBody.check_person_id || requestBody.personID}#${makeDate(requestBody.date || requestBody.check_date).numeric$}`\n },\n TableName: \"Calendar\",\n IndexName: 'list_key-index'\n })\n .promise()\n .catch(error => {\n cl({ 'Error reading Calendar': error });\n });\n if (!recordExists(calRecs)) { return already_booked; }\n for (let ndx = 0; ndx < calRecs.Items.length; ndx++) {\n let this_calRec = calRecs.Items[ndx];\n if (this_calRec?.slotData?.status?.current !== 'released') {\n let eventRec = {};\n let occRec = {};\n let cRecs = await getCalendarEntries({\n client: requestBody.client || requestBody.client_id || requestBody.check_client,\n event: `${this_calRec.event_id}#${this_calRec.occurrence_date}`,\n type: ['event', 'occurrence']\n });\n if (cRecs[0].eventData || cRecs[0].calData) {\n eventRec = cRecs[0];\n if (cRecs[1]) { occRec = cRecs[1]; }\n }\n else {\n occRec = cRecs[0];\n if (cRecs[1]) { eventRec = cRecs[1]; }\n }\n let eventStart24 = eventRec.eventData?.event_data?.time?.from;\n let event_start_time24 = eventStart24 ? makeTime(eventStart24.trim()).numeric24 : 0;\n let eventEnd24 = eventRec.eventData?.event_data?.time?.to;\n let event_end_time24 = eventEnd24 ? makeTime(eventEnd24.trim()).numeric24 : 2359;\n if (eventRec && ('eventData' in eventRec) && (eventRec.eventData.slotPattern)) {\n let slotArray = eventRec.eventData.slotPattern;\n if (('occData' in occRec) && (occRec.occData.slotPattern)) { slotArray = occRec.occData.slotPattern; };\n let foundNdx = slotArray.findIndex(slot => {\n return (slot === this_calRec.slotData.slot);\n });\n let found_end_time24 = event_end_time24;\n let found_start_time24 = event_start_time24;\n let slot_description = slotArray[foundNdx] || '0';\n if (eventRec.eventData.sign_up.type === 'time') {\n found_start_time24 = Number(slot_description);\n if (found_start_time24 < event_start_time24) {\n found_start_time24 = event_start_time24;\n }\n found_end_time24 = slotArray[foundNdx + 1] || event_end_time24;\n if (found_end_time24 > event_end_time24) {\n found_end_time24 = event_end_time24;\n }\n }\n if (eventRec.eventData.slot_object_list) {\n let found = eventRec.eventData.slot_object_list.find(o => {\n return (o.key === slot_description);\n });\n if (found) {\n if (eventRec.eventData.sign_up.type !== 'time') {\n let [found_start, found_end] = found.value.split(\"-\");\n found_start_time24 = found_start ? makeTime(found_start.trim()).numeric24 : event_start_time24;\n if (found_start_time24 < event_start_time24) {\n found_start_time24 = event_start_time24;\n }\n found_end_time24 = found_end ? makeTime(found_end.trim()).numeric24 : event_end_time24;\n if (found_end_time24 > event_end_time24) {\n found_end_time24 = event_end_time24;\n }\n }\n }\n }\n console.log(found_start_time24, found_end_time24);\n already_booked.push({\n start_time24: found_start_time24,\n end_time24: found_end_time24,\n event: occRec.event_key,\n event_description: eventRec.eventData.event_data.description\n });\n }\n }\n }\n already_booked.sort((a, b) => {\n return ((a.start_time24 < b.start_time24) ? 1 : -1);\n });\n return already_booked;\n}\n\nexport function slotTimes(eventRec, occRec, slotRec) {\n let eventStart24 = eventRec.time?.from || occRec.time?.from;\n let event_start_time24 = eventStart24 ? makeTime(eventStart24.trim()).numeric24 : 0;\n let eventEnd24 = eventRec.time?.to || occRec.time?.to;\n let event_end_time24 = eventEnd24 ? makeTime(eventEnd24.trim()).numeric24 : 2359;\n if (eventRec.slotPattern) {\n let slotArray = eventRec.slotPattern;\n if (('occData' in occRec) && (occRec.occData.slotPattern)) { slotArray = occRec.occData.slotPattern; };\n let foundNdx = slotArray.findIndex(slot => {\n return (slot === slotRec.slotData.slot);\n });\n let found_end_time24 = event_end_time24;\n let found_start_time24 = event_start_time24;\n let slot_description = slotArray[foundNdx] || '0';\n if (eventRec.type === 'time') {\n found_start_time24 = Number(slot_description);\n if (found_start_time24 < event_start_time24) {\n found_start_time24 = event_start_time24;\n }\n found_end_time24 = slotArray[foundNdx + 1] || event_end_time24;\n if (found_end_time24 > event_end_time24) {\n found_end_time24 = event_end_time24;\n }\n }\n if (eventRec.slot_object_list) {\n let found = eventRec.slot_object_list.find(o => {\n return (o.key === slot_description);\n });\n if (found) {\n if (eventRec.type !== 'time') {\n let [found_start, found_end] = found.value.split(\"-\");\n found_start_time24 = found_start ? makeTime(found_start.trim()).numeric24 : event_start_time24;\n if (found_start_time24 < event_start_time24) {\n found_start_time24 = event_start_time24;\n }\n found_end_time24 = found_end ? makeTime(found_end.trim()).numeric24 : event_end_time24;\n if (found_end_time24 > event_end_time24) {\n found_end_time24 = event_end_time24;\n }\n }\n }\n }\n return {\n start24: found_start_time24,\n end24: found_end_time24\n };\n }\n else {\n return {\n start24: event_start_time24 || 0,\n end24: event_end_time24 || 2359\n };\n }\n}\n\nexport async function getCalendarEntries(body, statusUpdate) {\n /* \n body: {\n client_id (alt client)\n person_id (alt person)\n event_id (form event#occurrence OK) (alt event)\n occurrence_id (if present, replaces occurrence in event_id) (alt occurrence)\n start_date (find occurrences starting on this date)\n end_date (find occurrences up to this date)\n type ('event', 'occurrence', 'slot', 'all', 'exact', 'structure')\n allow_create (boolean - if type = occurrence AND record does not exist AND occurrence_id is a valid eccurrence for this event )\n return_event (boolean - when allow_create adds an occerrence, also return the associated event record)\n (alt) filter {\n person_id (alt person)\n event_id (alt event)\n occurrence_id (alt occurrence)\n type\n }\n }\n */\n let start_Date, end_Date;\n if (body.startDate) { start_Date = makeDate(body.startDate).numeric; }\n else { start_Date = makeDate('today').numeric; }\n if (body.endDate) { end_Date = makeDate(body.endDate).numeric; }\n if (!end_Date || (end_Date < start_Date)) { end_Date = makeDate(addDays(makeDate(start_Date).date, 7)).numeric; }\n let returnArr = [];\n let rC = body.client_id || body.client;\n let rP = body.person_id || body.person || body.filter?.person_id || body.filter?.person;\n // rV is the event_key which may include the occurrence date as #\n // rO is the occurrence date\n // rT is the record type\n let rV = makeString((body.event_id || body.event || body.filter?.event_id || body.filter?.event), 1);\n let rTin = body.type || body.filter?.type;\n let rT = [];\n if (!Array.isArray(rTin)) {\n if (!rTin) { rT = ['occurrence', 'event']; }\n else { rT = [rTin]; }\n }\n else { rT = [...rTin]; }\n let rO = body.occurrence_id || body.occurrence || body.filter?.occurrence_id || body.filter?.occurrence;\n let create_occ = false;\n if (body.allow_create) { create_occ = body.allow_create; }\n if (rO && rV) { rV = rV.split('#')[0] + '#' + rO; } // both sent in change rV to include passed rO\n else if (rO) { } // rO sent without an rV - that's bad; ignore rO\n else if (rV) { rO = rV.split('#')[1]; } // rV sent without an rO; try to set rO from the rV value\n else { } // netiher sent; that's OK\n let qQ = { TableName: 'Calendar' };\n\n // rT is an array with one or more calendar record types in it\n for (let t = 0; t < rT.length; t++) {\n if (rV) {\n qQ.KeyConditionExpression = 'client = :c';\n qQ.ExpressionAttributeValues = { ':c': rC };\n if (rT[t]) {\n switch (rT[t]) {\n case 'all': {\n qQ.KeyConditionExpression += ' and begins_with(event_key, :rV)';\n qQ.ExpressionAttributeValues[':rV'] = `${rV.split('#')[0]}#`;\n break;\n }\n case 'template': {\n qQ.IndexName = 'record_type-index';\n qQ.KeyConditionExpression += ' and record_type = :rT';\n qQ.ExpressionAttributeValues[':rT'] = rT[t];\n break;\n }\n case 'event': {\n qQ.KeyConditionExpression += ' and event_key = :rV';\n qQ.ExpressionAttributeValues[':rV'] = `${rV.split('#')[0]}`;\n break;\n }\n case 'occurrence': {\n qQ.KeyConditionExpression += ' and event_key = :rV';\n let rParts = rV.split('#');\n qQ.ExpressionAttributeValues[':rV'] = `${rParts[0]}#${rParts[1]}`;\n break;\n }\n case 'structure': {\n qQ.KeyConditionExpression += ' and begins_with(event_key, :rV)';\n qQ.ExpressionAttributeValues[':rV'] = rV;\n break;\n }\n case 'slot': {\n qQ.KeyConditionExpression += ' and begins_with(event_key, :rV)';\n qQ.ExpressionAttributeValues[':rV'] = rV;\n if (rP) {\n qQ.FilterExpression = 'begins_with(list_key, :rP)';\n qQ.ExpressionAttributeValues[':rP'] = `${rP}#`;\n }\n break;\n }\n case 'exact':\n default: {\n qQ.KeyConditionExpression += ' and event_key = :rV';\n qQ.ExpressionAttributeValues[':rV'] = rV;\n break;\n }\n }\n }\n }\n else if (rP) {\n qQ.IndexName = 'sign_up-index';\n qQ.KeyConditionExpression = 'schedule_key = :s and begins_with(list_key, :rP)';\n qQ.ExpressionAttributeValues = { ':rP': `${rP}#`, ':s': 'slot_data' };\n }\n else {\n // when falling through to here, no event or person was passed in\n // we assume they want all entries in the calendar that are valid between go and stop\n qQ.IndexName = 'occurrence_date-index';\n qQ.KeyConditionExpression = 'client = :c and occurrence_date between :go and :stop';\n qQ.ExpressionAttributeValues = { ':c': rC, ':go': start_Date.toString(), ':stop': end_Date.toString() };\n if (rT[t]) {\n switch (rT[t]) {\n case 'all': {\n // later, code to fetch events that go with the occurrences and slots found\n break;\n }\n case 'event': {\n // later, code to fetch events that go with the occurrences found (remove occurrences from results)\n break;\n }\n case 'exact':\n case 'occurrence': {\n qQ.FilterExpression = 'attribute_not_exists(slotData)';\n break;\n }\n case 'structure': {\n break;\n }\n case 'slot':\n default: {\n qQ.FilterExpression = 'attribute_exists(slotData) and slotData <> :null';\n qQ.ExpressionAttributeValues[':null'] = null;\n break;\n }\n }\n }\n }\n\n // At this point, we've contructed the query\n if (statusUpdate) { statusUpdate('Retrieving events', 100, 10); }\n let qR;\n if ((rT === 'event') && eventCache && (eventCache[rV.split('#')[0]])) {\n qR = { Items: [eventCache[rV.split('#')[0]]] };\n }\n else {\n qR = await dbClient\n .query(qQ)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${qQ.TableName} id ${error}`);\n });\n if ((rT === 'event') && recordExists(qR)) {\n eventCache[rV.split('#')[0]] = qR.Items[0];\n }\n }\n if (recordExists(qR)) {\n if (statusUpdate) {\n let count = qR.Items.length;\n statusUpdate(`Found ${count} events`, count, ((100 + count) * .10) / 100);\n }\n returnArr.push(...qR.Items);\n }\n else {\n // we are here if the requested record(s) were not found\n if ((rT[t] === 'occurrence') && (create_occ)) {\n // called for a specific occurrence record\n // AND asked to create the entry if not found (create_occ = true), so...\n let newOcc = await putEventOccurrence(rC, rV, rO); // will not create if it is an invalid occurrence\n if (newOcc && Array.isArray(newOcc)) { returnArr.push(...newOcc); }\n }\n }\n }\n // end of loop for requested types\n // at this point, returnArr has all of the records requested\n\n // return the list of calendar entries sorted by date/slot in event key (oldest first)\n return returnArr.sort((a, b) => {\n if ((a.event_key.split(/#(.*)/)[1] || null) > (b.event_key.split(/#(.*)/)[1] || null)) { return 1; }\n else { return -1; }\n });\n}\n\nexport async function updateCalendarEntry(body) {\n\n // body is a single, or an array of, service request records\n let unProcessed = [];\n if (Array.isArray(body)) {\n body.forEach(r => {\n unProcessed.push({\n \"PutRequest\": {\n \"Item\": r\n }\n });\n });\n }\n else {\n unProcessed[0] = {\n \"PutRequest\": {\n \"Item\": body\n }\n };\n }\n let initialCount = unProcessed.length;\n let finalCount = 0;\n let retryNeeded;\n let retryCount = 0;\n do {\n retryNeeded = false;\n let writeResponse = await dbClient\n .batchWrite({\n RequestItems: {\n 'ServiceRequests': unProcessed\n }\n })\n .promise()\n .catch(error => {\n clt({ 'Bad batch write on Calendars - caught error is': error });\n });\n if (writeResponse\n && ('UnprocessedItems' in writeResponse)\n && (Object.keys(writeResponse.UnprocessedItems)).length > 0) {\n unProcessed = [...writeResponse.UnprocessedItems];\n finalCount = unProcessed.length;\n retryNeeded = true;\n retryCount++;\n }\n } while (retryNeeded && (retryCount < 5));\n let returnMessage = '';\n if (finalCount === 0) { returnMessage = `Successfully updated ${initialCount} Request record${(initialCount > 1) ? 's' : ''}`; }\n else if (finalCount < initialCount) {\n let processedCount = initialCount - finalCount;\n returnMessage = `Updated ${processedCount} of ${initialCount} Request records`;\n }\n else { returnMessage = `Failed to update Request record${(initialCount > 1) ? 's' : ''}`; }\n return returnMessage;\n}\n\nexport async function getSlotList(request) {\n /* \n request\n client - client\n event - use this event \n occurrence - use this event\n \n response\n eventRec\n occRec\n slotObj {slot: status, slot: status, ...]\n */\n let eventRec = {};\n let occRec = {};\n let slotObj = {};\n if (Array.isArray(request.event)) { request.event = makeString(request.event, 1); }\n let cRecs = await getCalendarEntries({ client: request.client, event: request.event, type: ['event', 'occurrence'] });\n if (cRecs[0].eventData || cRecs[0].calData) {\n eventRec = cRecs[0];\n if (cRecs[1]) { occRec = cRecs[1]; }\n }\n else {\n occRec = cRecs[0];\n if (cRecs[1]) { eventRec = cRecs[1]; }\n }\n let last_ampm = null;\n let show_ampm = '';\n if (eventRec && ('eventData' in eventRec) && (eventRec.eventData.slotPattern)) {\n let slotArray = eventRec.eventData.slotPattern;\n if (('occData' in occRec) && (occRec.occData.slotPattern)) { slotArray = occRec.occData.slotPattern; };\n let eventStart24 = eventRec.eventData?.event_data?.time?.from;\n let event_start_time24 = eventStart24 ? makeTime(eventStart24.trim()).numeric24 : 0;\n let eventEnd24 = eventRec.eventData?.event_data?.time?.to;\n let event_end_time24 = eventEnd24 ? makeTime(eventEnd24.trim()).numeric24 : 2359;\n slotArray.forEach((s, ndx) => {\n let found_end_time24 = event_end_time24;\n let found_start_time24 = event_start_time24;\n let slot_description = s;\n if (eventRec.eventData.sign_up.type === 'time') {\n let hh = Number(s.slice(0, 2));\n let calc_ampm = ((hh < 12) ? 'am' : 'pm');\n if (calc_ampm !== last_ampm) {\n show_ampm = calc_ampm;\n last_ampm = calc_ampm;\n }\n else {\n show_ampm = '';\n }\n if (hh > 12) {\n hh -= 12;\n }\n slot_description = `${hh}:${s.slice(2)} ${show_ampm}`.trim();\n found_start_time24 = s;\n if (found_start_time24 < event_start_time24) {\n found_start_time24 = event_start_time24;\n }\n found_end_time24 = slotArray[ndx + 1] || event_end_time24;\n if (found_end_time24 > event_end_time24) {\n found_end_time24 = event_end_time24;\n }\n }\n let slot_sort = s;\n if (eventRec.eventData.slot_object_list) {\n let found = eventRec.eventData.slot_object_list.find(o => {\n return (o.key === s);\n });\n if (found) {\n slot_description = found.value;\n slot_sort = found.sort;\n if (eventRec.eventData.sign_up.type !== 'time') {\n let [found_start, found_end] = found.value.split(\"-\");\n found_start_time24 = found_start ? makeTime(found_start.trim()).numeric24 : event_start_time24;\n if (found_start_time24 < event_start_time24) {\n found_start_time24 = event_start_time24;\n }\n found_end_time24 = found_end ? makeTime(found_end.trim()).numeric24 : event_end_time24;\n if (found_end_time24 > event_end_time24) {\n found_end_time24 = event_end_time24;\n }\n }\n }\n }\n console.log(found_start_time24, found_end_time24);\n slotObj[s] = {\n status: \"available\",\n show_this_slot: true,\n slot_description,\n slot_start_time24: found_start_time24,\n slot_end_time24: found_end_time24,\n slot_sort\n };\n });\n }\n let slotRecs = await getCalendarEntries({ client: request.client, event: occRec.event_key, type: 'structure' });\n if (slotRecs.length > 0) {\n let ownedSlotsFound = false;\n for (let rNum = 0; rNum < slotRecs.length; rNum++) {\n let r = slotRecs[rNum];\n if (r.slotData) {\n let slotKey = r.slotData.slot || r.slotData.id;\n let owner_location = null;\n if (r.slotData.owner && (r.slotData.status && (r.slotData.status.current !== 'released'))) {\n ownedSlotsFound = true;\n let this_person = await getPerson(r.slotData.owner, '*all');\n if (this_person.location) {\n owner_location = this_person.location.trim();\n }\n }\n let slot_description = slotKey;\n if (eventRec.eventData.sign_up.type === 'time') {\n let hh = Number(slotKey.slice(0, 2));\n let calc_ampm = ((hh < 12) ? 'am' : 'pm');\n if (calc_ampm !== last_ampm) {\n show_ampm = calc_ampm;\n last_ampm = calc_ampm;\n }\n else {\n show_ampm = '';\n }\n if (hh > 12) {\n hh -= 12;\n }\n slot_description = `${hh}:${slotKey.slice(2)} ${show_ampm}`.trim();\n }\n let slot_sort = slotKey;\n if (eventRec.eventData.slot_object_list) {\n let found = eventRec.eventData.slot_object_list.find(o => {\n return (o.key === slotKey);\n });\n if (found) {\n slot_description = found.value;\n slot_sort = found.sort;\n }\n }\n slotObj[slotKey] = Object.assign(r, r.slotData, {\n status: (r.slotData.status ? r.slotData.status.current : \"undefined\"),\n show_this_slot: (r.slotData.hasOwnProperty('show_this_slot') ? r.slotData.show_this_slot : true),\n owner: r.slotData.owner,\n display_name: makeReadableName(r.slotData),\n owner_location: owner_location,\n marked: r.marked,\n slot_description,\n slot_sort\n });\n }\n };\n if (!ownedSlotsFound) { // no slots found at all?\n // slotRecs[0] will be the event record - does it give instructions on what to do?\n if (eventRec.eventData.hasOwnProperty('defaultSlotOwners')) {\n if (eventRec.eventData.defaultSlotOwners === 'first_occurrence') {\n let newSlotObj = await copySlots(request.client, `${eventRec.event_id}#${eventRec.occExists[0]}`, occRec.event_key);\n slotObj = Object.assign(slotObj, newSlotObj);\n }\n else if (eventRec.eventData.defaultSlotOwners === 'prior_occurrence') {\n let indexAt = eventRec.occExists.indexOf(occRec.occurrence_date);\n let stopLoop = false;\n let newSlotObj = {};\n while ((indexAt >= 0) && !stopLoop) {\n newSlotObj = await copySlots(request.client, `${eventRec.event_id}#${eventRec.occExists[indexAt - 1]}`, occRec.event_key);\n stopLoop = (Object.keys(newSlotObj).length > 0);\n indexAt--;\n }\n slotObj = Object.assign(slotObj, newSlotObj);\n\n }\n }\n }\n }\n return ({ eventRec, slotObj, occRec });\n\n function makeReadableName(pItem) {\n if (!pItem.name) {\n return pItem.display_name;\n }\n let [pPrimary, pFirst] = pItem.name.split(',');\n return (`${pFirst || ''} ${pPrimary}`).trim();\n }\n}\n\nexport async function copySlots(client_id, from_occ, to_occ) {\n if (to_occ === from_occ) {\n return {};\n }\n let slotObj = {};\n let slotRecs = await getCalendarEntries({\n client: client_id,\n event: from_occ,\n type: ['event', 'structure']\n });\n let from_event = slotRecs.find(r => {\n return r.hasOwnProperty('eventData');\n });\n for (let rNum = 0; rNum < slotRecs.length; rNum++) {\n let r = slotRecs[rNum];\n if (r.slotData && r.slotData.owner && (r.slotData.status && (r.slotData.status.current !== 'released'))) {\n let slotKey = r.slotData.slot || r.SlotData.id;\n let newSlot = await writeSlot({\n \"client\": client_id,\n \"event\": to_occ,\n \"owner\": r.slotData.owner,\n \"slot\": slotKey,\n \"no_messaging\": true\n });\n let owner_location = null;\n let readableName = '';\n let this_person = await getPerson(r.slotData.owner, '*all');\n if (this_person.location) {\n owner_location = this_person.location.trim();\n }\n if (!this_person.name) {\n readableName = this_person.display_name;\n }\n else {\n readableName = (`${this_person.name.first || ''} ${this_person.name.last || ''}`).trim();\n }\n if (Array.isArray(from_event.eventData.slot_object_list)) {\n let this_slotObj = from_event.eventData.slot_object_list.find(o => {\n return (slotKey === o.key);\n });\n slotObj[slotKey] = Object.assign(newSlot, {\n status: (newSlot.status ? newSlot.status.current : \"undefined\"),\n show_this_slot: (newSlot.hasOwnProperty('show_this_slot') ? newSlot.show_this_slot : true),\n owner: r.slotData.owner,\n display_name: readableName,\n owner_location: owner_location,\n marked: false,\n slot_description: this_slotObj.value,\n slot_sort: this_slotObj.sort\n });\n }\n }\n }\n return slotObj;\n}\n\nexport async function getOccurenceList(request) {\n /* \n takes the request and builds an array of valid occurrence dates for the requested events\n request\n client - client\n event - use this event \n if occurrence is in event (as in event#occurence), get next occurrence after the listed one\n from_date - find next occurrence on or after this date (will override occurrence included in event)\n to_date - find all occurrences up to and including this date (default if missing is 400 days after from_date)\n number_of_occurrences - find this many\n \n response\n eventRec\n occArray [oDate, oDate...]\n occRec {oDate: occRec, oDate: occRec, ...} if rec already exists, otherwise not present\n */\n let eventRec = {};\n let event_id, event_occurrence;\n if (typeof (request.event) === 'string') {\n [event_id, event_occurrence] = request.event.split('#');\n [eventRec] = await getCalendarEntries({ client: request.client, event: event_id, type: 'event' });\n }\n else { eventRec = request.event; }\n let response = { eventRec, occArray: [], occRec: {} };\n if (!eventRec) { return response; }\n let from_date, from_numeric, to_date, to_numeric;\n if (request.from_date\n || (('date' in request) &&\n ((request.date.hasOwnProperty('from')) || (request.date.hasOwnProperty('from_date'))))) {\n let fDate = makeDate(request.from_date || request.date.from || request.date.from_date);\n from_date = fDate.date;\n from_numeric = fDate.numeric;\n }\n else if (event_occurrence) { from_date = makeDate(event_occurrence).date; }\n else { from_date = new Date(); }\n if (request.to_date\n || (('date' in request) &&\n ((request.date.hasOwnProperty('to')) || (request.date.hasOwnProperty('to_date'))))) {\n let tDate = makeDate(request.to_date || request.date.to || request.date.to_date);\n to_date = tDate.date;\n to_numeric = tDate.numeric;\n }\n else {\n to_date = addDays(new Date(from_date), 400);\n to_numeric = makeDate(to_date).numeric;\n }\n // Now have key elements in hand:\n // eventRec, from_date (as date), to_date (as date), and (optionally) number_of_occurrences\n let occPattern = eventRec.eventData.occPattern;\n switch (occPattern.recurrence) {\n case \"daily\": {\n for (let candidate = from_date; candidate < to_date; candidate = addDays(candidate, 1)) {\n if (occPattern.day_of_week.includes(candidate.getDay())) {\n await validateOccurrenceDate(makeDate(candidate).numeric);\n if (foundEnough()) { break; }\n }\n }\n break;\n }\n case \"bi-weekly\": {\n let firstWeek = [];\n let firstDate = makeDate(occPattern.first_date).date;\n for (let count = 0; count < 7; count++) {\n let d = addDays(firstDate, count);\n firstWeek[d.getDay()] = d;\n }\n for (let candidate = from_date; candidate < to_date; candidate = addDays(candidate, 1)) {\n if (occPattern.day_of_week.includes(candidate.getDay()) && (daysDiff(candidate, firstWeek[candidate.getDay()]) % 14) === 0) {\n await validateOccurrenceDate(makeDate(candidate).numeric);\n if (foundEnough()) { break; }\n }\n }\n break;\n }\n case \"monthly\": {\n let targetArray = [];\n if (typeof occPattern.day_of_month === 'string') { targetArray[0] = occPattern.day_of_month; }\n else if (typeof occPattern.day_of_month === 'number') { targetArray[0] = occPattern.day_of_month; }\n else { targetArray.push(...occPattern.day_of_month); }\n from_date.setDate(1);\n let monthToCheck;\n for (let candidate = from_date; ((candidate < to_date) && !foundEnough()); candidate.setMonth(monthToCheck + 1)) {\n let yearToCheck = candidate.getFullYear();\n monthToCheck = candidate.getMonth();\n for (let r = 0; ((r < targetArray.length) && !foundEnough()); r++) {\n if (typeof targetArray[r] === 'number') {\n await validateOccurrenceDate(`${yearToCheck}${(monthToCheck + 101).toString().slice(-2)}${(targetArray[r] + 100).toString().slice(-2)}`);\n if (foundEnough()) { break; }\n }\n else {\n let checkDate = new Date(candidate);\n for (let x = 0; x < 7; x++) {\n if (occPattern.day_of_week.includes(checkDate.getDay())) {\n switch (targetArray[r]) {\n // the validateOccurrenceDate routine evaluates the passed-in date\n // based on the occPattern that's already loaded here\n // if that date is a \"real\" occurrence, it will push the date it onto response.occArray\n //\n\n case \"first\": {\n await validateOccurrenceDate(makeDate(checkDate).numeric);\n break;\n }\n case \"second\": {\n await validateOccurrenceDate(makeDate(addDays(checkDate, 7)).numeric);\n break;\n }\n case \"third\": {\n await validateOccurrenceDate(makeDate(addDays(checkDate, 14)).numeric);\n break;\n }\n case \"fourth\": {\n await validateOccurrenceDate(makeDate(addDays(checkDate, 21)).numeric);\n break;\n }\n case \"last\": {\n let possDate = addDays(checkDate, 28);\n if (possDate.getMonth() === monthToCheck) {\n await validateOccurrenceDate(makeDate(possDate).numeric);\n }\n else {\n await validateOccurrenceDate(makeDate(addDays(checkDate, 21)).numeric);\n }\n break;\n }\n default: { }\n } // end switch on occPattern.day_of_month (as targetArray[r]) (\"first Thursday\", \"second Thursday\", etc)\n } // end \"if this date matches a target day of the week (Thursday)\"\n if (foundEnough()) { break; }\n checkDate = addDays(checkDate, 1);\n } // end trying every possible day of the week (Sunday - Saturday)\n } // end else block - occPattern.day_of_month (targetArray[r]) is not a number\n } // end loop through all occPattern.day_of_month entries\n } // end loop from first date to last date\n break;\n } // end monthly case\n case \"semi_annual\": {\n for (let candidate = makeDate(from_date).date; true; candidate = addMonths(candidate, 6).date) {\n let done = foundEnough();\n if ((candidate > to_date) || done) {\n break;\n }\n await validateOccurrenceDate(makeDate(candidate).numeric);\n if (foundEnough()) { break; }\n }\n break;\n } // end semi_annual case\n case \"yearly\": {\n let targetArray = [];\n if (typeof occPattern.day_of_year === 'string') { targetArray[0] = Number(occPattern.day_of_year); }\n else if (typeof occPattern.day_of_year === 'number') { targetArray[0] = occPattern.day_of_year; }\n else {\n occPattern.day_of_year.forEach(d => {\n targetArray.push(Number(d));\n });\n targetArray.sort();\n }\n from_date.setMonth(1, 1);\n let yearToCheck;\n for (let candidate = from_date; candidate < to_date; candidate.setFullYear(yearToCheck + 1)) {\n yearToCheck = candidate.getFullYear();\n for (let t = 0; t < targetArray.length; t++) {\n await validateOccurrenceDate((yearToCheck * 10000) + targetArray[t]);\n if (foundEnough()) { break; }\n }\n }\n break;\n }\n default: {\n for (let s = 0; s < occPattern.specified.length; s++) {\n await validateOccurrenceDate(occPattern.specified[s]);\n if (foundEnough()) { break; }\n }\n }\n }\n return response;\n\n // ----- Functions -----\n\n function foundEnough() {\n return (request.number_of_occurrences && (response.occArray.length >= request.number_of_occurrences));\n }\n\n async function validateOccurrenceDate(inDate) {\n // called from inside getOccurenceList and therefore pertains to a specific event currently loaded\n // (occPattern and eventRec should be loaded)\n // determines if a specific date is between that occurrence's first and last dates, and not excluded\n // will return false or...\n // will add the occurrence\n // and return the date in yyyymmdd numeric format\n let numericDate, stringDate;\n if (typeof inDate === 'string') { stringDate = inDate; numericDate = Number(inDate); }\n else { stringDate = inDate.toString(); numericDate = inDate; }\n if (('exceptions' in occPattern) && occPattern.exceptions.hasOwnProperty(stringDate)) {\n if (occPattern.exceptions[stringDate] > 0) {\n numericDate = occPattern.exceptions[stringDate];\n stringDate = numericDate.toString();\n }\n else { return false; } // found a date specifically excluded\n }\n if (occPattern['first_date'] && (numericDate < occPattern.first_date)) { return false; }\n if (numericDate < from_numeric) { return false; }\n if (occPattern['last_date'] && (numericDate > occPattern.last_date)) { return false; }\n if (numericDate > to_numeric) { return false; }\n // All good if we get this far\n // Add this date to the response.occArray\n response.occArray.push(numericDate);\n // Add this date to the response.occArray\n if (!eventRec.occExists) { eventRec.occExists = []; }\n // else if (eventRec.occExists.includes(stringDate)) {\n // return numericDate;\n // }\n let oResp = await putEventOccurrence(request.client, event_id, stringDate, eventRec.occExists);\n if (Array.isArray(oResp)) { response.occRec[stringDate] = oResp[1]; }\n return numericDate;\n }\n}\n\nexport async function putEventOccurrence(client, inEvent, inDate, occExists) {\n // this routine assumes you've got a good occurrence (inDate) for an event (inEvent)\n // return occurrence and event records for a specific event/date occurrence; \n // create the occurrence if it doesn't exist\n let eventRec, occRec;\n let cDate = makeDate(inDate);\n let reqOcc = `${inEvent.split('#')[0]}#${cDate.numeric}`;\n if (occExists && !occExists.includes(inDate)) {\n occExists.push(inDate);\n await dbClient\n .update({\n Key: {\n client: client,\n event_key: inEvent.split('#')[0]\n },\n UpdateExpression: 'set occExists = :o, last_written_occurrence = :i',\n ExpressionAttributeValues: { ':o': occExists, ':i': inDate },\n TableName: \"Calendar\"\n })\n .promise()\n .catch(error => { cl(`caught error updating Calendar; error is: `, error); });\n }\n let evRec = await dbClient\n .query({\n TableName: 'Calendar',\n KeyConditionExpression: 'client = :c and event_key = :rV',\n ExpressionAttributeValues: { ':c': client, ':rV': inEvent.split('#')[0] }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading Calendar (event) id ${error}`);\n });\n if (recordExists(evRec)) {\n eventRec = evRec.Items[0];\n }\n let ocRec = await dbClient\n .query({\n TableName: 'Calendar',\n KeyConditionExpression: 'client = :c and event_key = :rV',\n ExpressionAttributeValues: { ':c': client, ':rV': reqOcc }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading Calendar (occurrence) id ${error}`);\n });\n if (recordExists(ocRec)) {\n // cl(`${eventRec.eventData.event_data.description} (${eventRec.event_key}) - ${cDate.absolute} exists already`);\n return [eventRec, ocRec.Items[0]];\n }\n if (eventRec) {\n occRec = await addOccurrence({\n client,\n event: eventRec,\n occurrence_date: cDate.numeric,\n occExists: occExists || []\n });\n cl(`${eventRec.eventData.event_data.description} (${eventRec.event_key}) - ${cDate.absolute} added`);\n }\n return [eventRec, occRec];\n}\n\nexport function makeSlotName(pSlot) {\n let nSlot = Number(pSlot);\n if (isNaN(nSlot)) { return pSlot; }\n if ((nSlot < 100) || (nSlot > 2359) || ((nSlot % 100) > 59)) { return nSlot.toString(); }\n else { return makeTime(pSlot).short; }\n}\n\nexport async function writeSlot(body) {\n /* \n \"client\": ,\n \"event\": ,\n \"occurrence_date (optional, if occurrence is in event as event#occurrence\": \n \"owner\": ,\n \"default_forms\"\n \"override_name\": ,\n \"slot (alternate form = id)\": <\"0900 (time) or s#103 (seat) or r#12/s#103 (row and seat) or rsteele (user_id)\">,\n \"status\": <\"null (=selected), released, reserved, confirmed, attended, no-show, off_campus, left_campus, entered_campus... \">\n \"show_this_slot\": (assume true if missing or null)\n \"no_messaging\": false\n \"overrideRecipient\": [array of recipients to send message to instead of event owner]\n */\n let [event_id, occ_id] = makeString(body.event, 1).split('#');\n let occurrence = body.occurrence_date || occ_id;\n if (!body.slot && body.id) { body.slot = body.id; }\n let event_key;\n if (occ_id) {\n event_key = `${event_id}#${occ_id}#${body.slot}`;\n }\n else {\n event_key = `${event_id}#${occurrence}#${body.slot}`;\n }\n let [slotRec] = await getCalendarEntries({ client: body.client, event: event_key, type: 'slot' });\n let slotHistory = [];\n if (slotRec) {\n if (slotRec.slotData.status) { slotHistory = slotRec.slotData.status.history; }\n else { // will convert a record from old style to new stlye\n slotHistory = [{\n date: 'unknown',\n status: 'selected',\n owner: slotRec.slotData.owner\n }];\n }\n }\n else { slotRec = {}; }\n\n let slotDataObj = Object.assign(\n {},\n slotRec.slotData || {},\n body.slotData || {},\n );\n\n if ('show_this_slot' in body) { slotDataObj.show_this_slot = !!body.show_this_slot; }\n else { slotDataObj.show_this_slot = true; }\n if (body.slot) { slotDataObj.slot = body.slot; }\n if (body.notes) { slotDataObj.notes = body.notes; }\n if (body.owner) {\n slotDataObj.owner = body.owner;\n if (body.override_name) { slotDataObj.display_name = body.override_name; }\n else { slotDataObj.display_name = await makeName(body.owner); }\n }\n slotDataObj.name = slotDataObj.display_name;\n\n let makeHistory = {\n date: makeDate(new Date()).absolute,\n status: body.status || 'selected',\n owner: body.owner\n };\n if (body.notes && slotRec.slotData && (slotRec.slotData.notes !== body.notes)) {\n makeHistory.note = body.notes;\n }\n slotHistory.unshift(makeHistory);\n slotDataObj.status = {\n current: body.status || 'selected',\n history: slotHistory\n };\n\n let putCalendar = {\n client: body.client,\n event_id,\n event_key,\n occurrence_date: `${occurrence}`,\n record_type: 'slot',\n slot_owner: body.owner,\n slotData: slotDataObj\n };\n\n // legacy support\n putCalendar.id = event_id;\n putCalendar.list_key = `${body.status === 'released' ? 'available' : body.owner}#${occurrence}`;\n putCalendar.schedule_key = 'slot_data';\n\n await dbClient\n .put({\n Item: putCalendar,\n TableName: \"Calendar\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Calendar; error is:`, error);\n });\n\n // assign a form?\n let ownerRec;\n let documents_assigned;\n if (body.default_forms) {\n let documentsAssignedToThisPerson = {};\n let formList = makeArray(body.default_forms);\n // get all the slots after this write was completed\n let ownerList = [];\n let slotInfo = await getSlotList({\n client: body.client,\n event: event_key,\n });\n // slotList will contain the IDs of everyone that has any slot in the referenced event\n // ownerList will contain the IDs of everyone who owns a CURRENTLY good slot (eliminating slots that are open or released)\n let slotList = Object.keys(slotInfo.slotObj).sort();\n slotList.forEach(this_slot => {\n if (slotInfo.slotObj[this_slot].status && ['selected', 'released', 'available'].includes(slotInfo.slotObj[this_slot].status)) {\n ownerList.push(slotInfo.slotObj[this_slot].owner);\n documentsAssignedToThisPerson[slotInfo.slotObj[this_slot].owner] = [];\n // every owner may need to have one or more forms added to their list based on the slot we're adding here\n };\n });\n // documentsAssignedToThisPerson is an object; each person in the ownerList (all people that own slots) will have a key here;\n for (let f = 0; f < formList.length; f++) {\n let this_form = formList[f];\n // for every form in the default form list, check the form to see if it applies\n // this is based on pertains_to (the form is all ABOUT this person)\n // and on assigned_to (a person that is RESPONSIBLE FOR completing a form)\n let pertains_to = [];\n let owner_groups = {};\n for (let oN = 0; oN < ownerList.length; oN++) {\n // does this form pertain to one or more of the existing slot owners?\n let this_owner = ownerList[oN];\n owner_groups[this_owner] = await getGroupsBelongTo(body.client, this_owner);\n if (array_in_array(this_form.pertains_to, Object.keys(owner_groups[this_owner]))) {\n pertains_to.push(this_owner);\n }\n }\n // the pertains_to array ends up holding the IDs of any slot owner\n // for whom the current form applies\n // if the array is empty, then this form pertains to no one at all and should be skipped\n if (pertains_to.length > 0) {\n let assigned_to = ownerList.filter(this_owner => {\n // should this form be assigned to one or more slot owners?\n return (array_in_array(this_form.assign_groups, Object.keys(owner_groups[this_owner])));\n });\n // the assigned_to array contains the IDs of any slot owner that should be ASSIGNED TO this form\n // if the array is empty, there is no one on the appointment that is allowed to update this form\n // so skip it\n if (assigned_to.length > 0) {\n for (let p = 0; p < pertains_to.length; p++) {\n // for each PERTAINS_TO person...\n let document_id_toBeAssigned;\n let goodGet = false;\n let foundDocumentAlreadyCompleted = false;\n // if you only have \"view\" access, find the most recent document of this type and assign the person to it\n if (this_form.access === 'view') {\n // try documentsCompleted table first\n let queryObj = {\n KeyConditionExpression: 'pertains_to = :p and begins_with(formType_date, :f)',\n ScanIndexForward: false,\n IndexName: 'pertains_to-formType_date-index',\n Limit: 1,\n ExpressionAttributeValues: {\n ':p': pertains_to[p],\n ':f': `${this_form.form_id}%%`\n }\n };\n queryObj.TableName = 'CompletedDocuments';\n let queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n if (recordExists(queryResult)) {\n // foundDocumentAlreadyCompleted = true;\n }\n else {\n queryObj.TableName = 'DocumentsInProcess';\n queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n if (!recordExists(queryResult)) {\n queryObj.TableName = 'DocumentsAssigned';\n queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n }\n }\n if (recordExists(queryResult)) {\n goodGet = true;\n document_id_toBeAssigned = queryResult.Items[0].document_id;\n }\n }\n else {\n // if you are here, the document is to be UPDATED by the person assigned,\n // it will be a version of the document that references this specific appointment\n // contruct the document_id for this situation and look to see if it exists already\n document_id_toBeAssigned = `${pertains_to[p]}%%${this_form.form_id}%%${event_id}#${occurrence}`;\n // does the document already exist?\n let queryObj = {\n KeyConditionExpression: 'client_id = :c and document_id = :dID',\n ScanIndexForward: false,\n Limit: 1,\n ExpressionAttributeValues: {\n ':c': body.client,\n ':dID': document_id_toBeAssigned\n }\n };\n queryObj.TableName = 'CompletedDocuments';\n let queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n if (recordExists(queryResult)) {\n // if this record was found in CompletedDocuments, there is no need to assign anyone... bail out\n foundDocumentAlreadyCompleted = true;\n }\n else {\n queryObj.TableName = 'DocumentsInProcess';\n queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n if (!recordExists(queryResult)) {\n queryObj.TableName = 'DocumentsAssigned';\n queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n if (!recordExists(queryResult)) {\n queryObj.TableName = 'Documents';\n queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n }\n }\n if (recordExists(queryResult)) {\n goodGet = true;\n }\n }\n }\n if (!foundDocumentAlreadyCompleted) {\n assigned_to.forEach(personThatNeedsToBeAssigned => {\n documentsAssignedToThisPerson[personThatNeedsToBeAssigned].push(document_id_toBeAssigned);\n });\n if (goodGet) {\n // at this point, we know that we are going to assign document_id_toBeAssigned to each person\n // that is in the assigned_to list \n }\n else {\n // there was NOT an existing document for this form,\n // if this is VIEW only, the document_id_toBeAssigned\n // will be null; we should not be creating a document just for the purpose of viewing it (it would be empty)\n // skip all of this in this circumstance\n if (document_id_toBeAssigned) {\n let title = '';\n if (this_form.titleWords) {\n title = this_form.titleWords;\n }\n else {\n title = await makeName(pertains_to[p]);\n }\n title += ` - ${slotInfo.eventRec.eventData.event_data.description} - ${makeDate(occurrence).absolute}`;\n const timestamp = new Date().getTime();\n let putDocument = {\n client_id: body.client,\n document_id: document_id_toBeAssigned,\n form_id: this_form.form_id,\n incomplete: 'not_started',\n title,\n person_id: pertains_to[p],\n values: {}\n };\n await dbClient\n .put({\n Item: putDocument,\n TableName: \"Documents\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Calendar; error is:`, error);\n });\n await dbClient\n .put({\n Item: {\n client_id: body.client,\n document_id: document_id_toBeAssigned,\n form_id: this_form.form_id,\n formType: this_form.form_id,\n formType_date: `${this_form.form_id}%%${timestamp}`,\n title,\n pertains_to: pertains_to[p],\n date_assigned: timestamp\n },\n TableName: \"DocumentsAssigned\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating DocumentsAssigned; error is:`, error);\n });\n await dbClient\n .put({\n Item: {\n document_id: document_id_toBeAssigned,\n person_id: '*status',\n client_id: body.client,\n formType: this_form.form_id,\n last_update: timestamp,\n status: 'assigned'\n },\n TableName: \"DocumentXRef\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating DocumentXRef; error is:`, error);\n });\n await dbClient\n .put({\n Item: {\n document_id: document_id_toBeAssigned,\n person_id: pertains_to[p],\n role: 'pertains_to'\n },\n TableName: \"DocumentXRef\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Calendar; error is:`, error);\n });\n }\n }\n }\n }\n }\n }\n }\n // at this point, documentsAssignedToThisPerson contains people IDs as keys and a list of documents as\n // the key's value. These are all NEWLY ASSIGNED documents.\n // go back and update any slot to show the associated documents\n // AND add an entry to DocumentsXRef that shows this relationship\n for (const this_person in documentsAssignedToThisPerson) {\n for (const this_document of documentsAssignedToThisPerson[this_person]) {\n await dbClient\n .put({\n Item: {\n document_id: this_document,\n person_id: this_person,\n role: 'assigned'\n },\n TableName: \"DocumentXRef\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Calendar; error is:`, error);\n });\n }\n let slotRec = await dbClient\n .get({\n Key: {\n client: body.client,\n event_key: `${event_id}#${occurrence}#${this_person}`\n },\n TableName: \"Calendar\"\n })\n .promise()\n .catch(error => {\n cl({ 'Error reading Calendar': error });\n });\n if (!recordExists(slotRec)) {\n cl(`Slot rec not found for ${event_id}#${occurrence}#${this_person}`);\n }\n else {\n let docRef = [];\n if (slotRec.Item.documents && (slotRec.Item.documents.length > 0)) {\n docRef.push(...slotRec.Item.documents);\n }\n let needsUpdate = false;\n if (documentsAssignedToThisPerson[this_person].length > 0) {\n documentsAssignedToThisPerson[this_person].forEach(d => {\n if (d) {\n docRef.push(d);\n needsUpdate = true;\n }\n });\n }\n // remove duplicates from docRef\n let uniqueDocRef = docRef.filter(function (item, pos, self) {\n return self.indexOf(item) === pos;\n });\n if (needsUpdate) {\n await dbClient\n .update({\n Key: {\n client: body.client,\n event_key: `${event_key}`\n },\n UpdateExpression: 'set documents = :d',\n ExpressionAttributeValues: { ':d': uniqueDocRef },\n TableName: \"Calendar\"\n })\n .promise()\n .catch(error => { cl(`caught error updating Documents; error is: `, error); });\n documents_assigned = uniqueDocRef;\n }\n }\n };\n }\n // customize the title and/or location?\n let newDescription;\n let newLocation;\n if (body.customizations) {\n // does this customization pertain to the owner we are adding?\n let owner_groups = await getGroupsBelongTo(body.client, body.owner);\n if (!(array_in_array(body.customizations.pertains_to, Object.keys(owner_groups)))) {\n // no op - skip all of this\n }\n else {\n ownerRec = await getPerson(body.owner);\n let updateExpression;\n let expressionAttributeNames = {};\n let expressionAttributeValues = {};\n if (body.customizations.description) {\n newDescription = resolve(body.customizations.description);\n updateExpression = 'set #e1.#e2.#d = :d';\n expressionAttributeNames['#e1'] = 'eventData';\n expressionAttributeNames['#e2'] = 'event_data';\n expressionAttributeNames['#d'] = 'description';\n expressionAttributeValues[':d'] = newDescription;\n delete body.customizations.description;\n }\n if (body.customizations.location) {\n newLocation = resolve(body.customizations.location);\n if (updateExpression) {\n updateExpression += ', ';\n }\n else {\n updateExpression = 'set ';\n }\n updateExpression += '#e1.#e2.#l.#d = :l';\n expressionAttributeNames['#e1'] = 'eventData';\n expressionAttributeNames['#e2'] = 'event_data';\n expressionAttributeNames['#d'] = 'description';\n expressionAttributeNames['#l'] = 'location';\n expressionAttributeValues[':l'] = newLocation;\n delete body.customizations.description;\n }\n if (isEmpty(body.customizations)) {\n updateExpression += ', customizations = :null';\n expressionAttributeValues[':null'] = '';\n }\n else {\n updateExpression += ', customizations = :c';\n expressionAttributeValues[':c'] = body.customizations;\n }\n await dbClient\n .update({\n Key: {\n client: body.client,\n event_key: event_id\n },\n UpdateExpression: updateExpression,\n ExpressionAttributeValues: expressionAttributeValues,\n ExpressionAttributeNames: expressionAttributeNames,\n TableName: \"Calendar\"\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Calendar; error is: `, error);\n });\n }\n }\n // messaging\n if (body.no_messaging) {\n // no op here... just drop through\n }\n else {\n let overrideRecipientList = false;\n if (body.overrideRecipient) {\n overrideRecipientList = body.overrideRecipient;\n }\n let [eventRec] = await getCalendarEntries({ client: body.client, event: `${event_key}`, type: 'event' });\n if (eventRec.eventData && (!eventRec.eventData.messaging || (eventRec.eventData.messaging.length === 0))) {\n let subjectText = '';\n let messageText = '';\n if (body.override_subject) {\n subjectText = body.override_subject;\n }\n else {\n if (body.status === 'released') {\n subjectText = `${slotDataObj.name} was removed from `;\n }\n else {\n subjectText = `${slotDataObj.name} was added `;\n if (slotDataObj.slot) {\n let maybeTime = makeSlotName(slotDataObj.slot);\n if (maybeTime.includes(':')) {\n subjectText += ` in the ${makeTime(slotDataObj.slot).time} slot `;\n }\n }\n subjectText += 'for ';\n }\n if (body.override_description) {\n subjectText += body.override_description;\n }\n else if (eventRec.eventData.event_data) {\n subjectText += eventRec.eventData.event_data.description;\n }\n else if (eventRec.calData) {\n subjectText += eventRec.calData.description;\n }\n else { subjectText += 'your event'; }\n subjectText += ` on ${makeDate(occurrence).absolute}`;\n }\n\n if (body.override_messageText) {\n messageText = body.override_messageText;\n }\n else {\n messageText = (slotDataObj.notes ? `${slotDataObj.notes}\\r\\n\\n` : '');\n let pName = await makeName(body.person_id);\n messageText += `AVA Automated Message from ${pName}`;\n }\n\n let ownerList;\n if (eventRec.eventData.event_data) { ownerList = makeArray(eventRec.eventData.event_data.owner); }\n else if (eventRec.calData) { ownerList = eventRec.calData.owner; }\n eventRec.eventData.messaging = {\n action: (body.status === 'released' ? \"released\" : \"selected\"),\n format: {\n subject: subjectText,\n text: messageText\n },\n recipientList: overrideRecipientList || ownerList\n };\n }\n if (eventRec.eventData && eventRec.eventData.messaging) {\n let messageList = [];\n let msgObject = {\n client: eventRec.client,\n author: 'AVA'\n };\n body.client = eventRec.client;\n body.person = eventRec.owner;\n body.onBehalfOf = slotDataObj.name;\n body = Object.assign(body, eventRec.eventData.event_data, slotDataObj);\n if (Array.isArray(eventRec.eventData.messaging)) { messageList.push(...eventRec.eventData.messaging); }\n else { messageList.push(eventRec.eventData.messaging); }\n for (let m = 0; m < messageList.length; m++) {\n let this_message = messageList[m];\n if (!this_message.action || (this_message.action === body.status.current)) {\n if ('subject' in this_message.format) { msgObject.subject = await resolveMessageVariables(this_message.format.subject, body); }\n if (Array.isArray(this_message.recipientList)) { msgObject.recipientList = [...this_message.recipientList]; }\n else { msgObject.recipientList = [this_message.recipientList]; }\n msgObject.messageText = await resolveMessageVariables(this_message.format.text, body);\n sendMessages(msgObject);\n }\n }\n }\n }\n /*\n return {\n 'request_id': serviceRequestRec.request_id,\n 'message': (goodWrite ? `${body.requestType} request ${serviceRequestRec.request_id} added (${body.author} for ${serviceRequestRec.on_behalf_of})` : 'Request not added')\n };\n */\n if (newDescription) {\n putCalendar.newDescription = newDescription;\n }\n if (newLocation) {\n putCalendar.newLocation = newLocation;\n }\n if (documents_assigned) {\n putCalendar.documents = documents_assigned;\n }\n return putCalendar;\n\n function resolve(request) {\n do {\n let result = request.match(/(.*?)(%%)(.*?)(%%)(.*)/);\n if (!result) {\n break;\n }\n let [, front, , middle, , back] = result;\n if (middle) {\n switch (middle) {\n case 'last_name': {\n request = `${front}${ownerRec.name.last}${back}`;\n break;\n }\n case 'first_name': {\n request = `${front}${ownerRec.name.first}${back}`;\n break;\n }\n case 'location': {\n request = `${front}${ownerRec.location}${back}`;\n break;\n }\n default: {\n request = `${front}${middle}${back}`;\n }\n }\n }\n } while (request.includes('%%'));\n return request;\n }\n}\n\nexport async function createNewOccurrences(request) {\n // expect request to contain\n // client => \n // from_date (optional) => if present, start making occurrences from this date; if missing assume today\n // to_date (optional) => if present, must be > from_date; if missing, assume today + 366 days\n\n // **** set up parameters **** //\n let fDate, tDate;\n if (request.from_date\n || (('date' in request) &&\n ((request.date.hasOwnProperty('from')) || (request.date.hasOwnProperty('from_date'))))) {\n fDate = makeDate(request.from_date || request.date.from || request.date.from_date);\n }\n else { fDate = makeDate('today'); }\n if (request.to_date\n || (('date' in request) &&\n ((request.date.hasOwnProperty('to')) || (request.date.hasOwnProperty('to_date'))))) {\n tDate = makeDate(request.to_date || request.date.to || request.date.to_date);\n }\n else { tDate = makeDate(addDays(new Date(fDate.date), 366)); }\n\n // **** read the events **** //\n let qQ = {\n TableName: 'Calendar',\n FilterExpression: 'event_key = event_id'\n };\n let evRec;\n do {\n evRec = await dbClient\n .scan(qQ)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading Calendar (event) id ${error}`);\n });\n if (recordExists(evRec)) {\n for (let i = 0; i < evRec.Items.length; i++) {\n let eventRec = evRec.Items[i];\n cl(`Event: ${eventRec.eventData.event_data.description} (${eventRec.event_key})`);\n // Does this event fit inside the request dates?\n if (!eventRec.eventData) { continue; }\n if (!eventRec.eventData.occPattern) { continue; }\n if ((eventRec.eventData.occPattern.first_date && (eventRec.eventData.occPattern.first_date > tDate.numeric))\n || (eventRec.eventData.occPattern.last_date && (eventRec.eventData.occPattern.last_date < fDate.numeric))) {\n cl(`-- Dates out of range: first=${eventRec.eventData.occPattern.first_date} / last=${eventRec.eventData.occPattern.last_date}`);\n continue;\n }\n // make occurrences\n await getOccurenceList({\n client: request.client,\n event: eventRec.event_key,\n from_date: fDate.date,\n to_date: tDate.date\n });\n }\n }\n qQ.ExclusiveStartKey = evRec.LastEvaluatedKey;\n } while (evRec.LastEvaluatedKey);\n}\n\n// **************** THIRD GENERATION CODE *****************\n\nexport async function printOccurrenceSheet(body) {\n\n /* \n body expected as\n {\n client (or client_id)\n event (or event_id)\n occurrence (or occurrence_id - if null, then get occurrence from event_id)\n margin: {top: nn, bottom: mm, left: yy, right: zz}\n client_name (optional; will print on header if present)\n request_type ('full' - show all details, otherwise just slot infor and name)\n pageWidth\n size: ('legal', 'letter', or [width_in_px, length_in_px])\n border\n font\n orientation (anything other than 'landscape' is treated as 'portrait')\n title\n }\n */\n let xPos = 0;\n let previousXPos = 0;\n\n // Get the event master record\n let oData = await occurrenceData(body);\n let eoData = await getSlotList({ \"client\": body.client || body.client_id, \"event\": body.event || body.event_id });\n oData.slots = eoData.slotObj;\n\n // Prep the PDF output\n let default_font = 'Helvetica';\n if (!body.margin) { body.margin = {}; }\n let page = {\n border: body.border || true,\n font: {\n family: body.font || body.font_family || default_font,\n size: { large: 14, medium: 12, small: 10, tiny: 8 }\n },\n size: (body.size || 'letter'),\n layout: (body.orientation === 'landscape' ? 'landscape' : 'portrait'),\n info: { author: 'AVA Senior Living', title: (body.title || oData.description || 'Event Report') },\n number: 1,\n margin: {\n top: body.margin.top || 42,\n bottom: body.margin.bottom || 14,\n }\n };\n\n if (Array.isArray(page.size)) {\n page.width = page.size[0];\n page.height = page.size[1];\n }\n else if (page.size === 'legal') {\n page.width = 275;\n page.height = 750;\n }\n else {\n page.width = 275;\n page.height = 590;\n }\n if (page.orientation === 'landscape') {\n let temp = page.height;\n page.width = page.height;\n page.height = temp;\n }\n page.margin.left = body.margin.left || (page.width / 10);\n page.margin.right = body.margin.right || (page.width / 10);\n\n let yPos = page.margin.top;\n const doc = new jsPDF({\n orientation: page.layout,\n unit: \"px\",\n format: page.size\n });\n page.centerPoint = doc.internal.pageSize.width / 2;\n page.printableArea = doc.internal.pageSize.width - page.margin.left - page.margin.right;\n\n\n // ********** TITLE ********** //\n let titleWords = await resolveMessageVariables(page.info.title, body);\n page.info.title = titleCase(titleWords);\n doc.info = { author: 'AVA', title: titleCase(titleWords) };\n pdfLine(page.info.title, page.font.size.large, 'bold', 0, 0, 0, { align: 'center' });\n if (body.client_name) {\n let outClientName = titleCase(body.client_name);\n pdfLine(outClientName, page.font.size.large, 'normal', 0, 0, 0, { align: 'center' });\n }\n pdfLine(oData.date.absolute, page.font.size.small, 'normal', 0, 0, 0, { align: 'center' });\n if (oData.time) {\n pdfLine(oData.time, page.font.size.small, 'normal', 0, 0, 0, { align: 'center' });\n }\n if (oData.location && oData.location.description) {\n pdfLine(oData.location.description, page.font.size.small, 'normal', 0, 0, 0, { align: 'center' });\n }\n\n /* Grid\n let options = {};\n for (let p = page.margin.left; p <= page.width; p += 10) {\n pdfLine(p, page.font.size.tiny, 'normal', 0, 0, -1, options);\n options = { noNewLine: true };\n }\n */\n\n // Body\n\n let totalLines = 0;\n let detail_indent = (page.width / 10) + page.margin.left;\n // let nameRow_indent = detail_indent - 10;\n\n let slotList = Object.keys(oData.slots).sort();\n\n for (let s = 0; s < slotList.length; s++) {\n let sID = slotList[s];\n let outName;\n let occupiedSlot = false;\n if (oData.slots[sID].owner && (oData.slots[sID].owner !== 'available') && (oData.slots[sID].owner !== '')) {\n occupiedSlot = true;\n if (!oData.slots[sID].display_name) { outName = oData.slots[sID].owner; }\n else {\n let oParts = oData.slots[sID].display_name.split(',');\n if (oParts.length === 1) { outName = oParts[0].trim(); }\n else { outName = (`${oParts[1].trim()} ${oParts[0].trim()}`).trim(); }\n }\n };\n if (body.request_type === 'sign-up') {\n pdfLine(((oData.type === 'time') ? formatTime(sID) : sID), page.font.size.large, 'normal', 0, 1.5, 0, { align: 'left' });\n if (occupiedSlot) {\n pdfLine(outName, page.font.size.large, 'bold', 0, 0, 0, { xPos: detail_indent + 10, noNewLine: true });\n }\n doc.line(detail_indent, yPos + 3, detail_indent + 300, yPos + 3, 'F');\n }\n else if (occupiedSlot) {\n pdfLine('image', page.font.size.large, 'normal', 0, 1.5, 0, { image: `https://theseus-medical-storage.s3.amazonaws.com/public/patients/${oData.slots[sID].owner}.jpg` });\n pdfLine(outName, page.font.size.large, 'bold', 0, 0.5, 0, { noNewLine: true });\n let nameY = yPos;\n if (oData.type === 'time') {\n pdfLine(`${formatTime(sID)}`, page.font.size.medium, 'normal', 0, 0, 0, { align: 'vertical', noBreak: true });\n }\n else if (oData.type === 'seats') {\n pdfLine(`${sID}`, page.font.size.medium, 'normal', 0, 0, 0, { align: 'vertical', noBreak: true });\n }\n if (oData.slots[sID].owner && body.request_type === 'full') {\n let pRec = await getPerson(oData.slots[sID].owner);\n if (pRec) {\n if (pRec.person_id !== 'void') {\n if (pRec.location) {\n pdfLine(pRec.location, page.font.size.medium, 'normal', 0, 0, 0, { align: 'vertical', noBreak: true });\n }\n totalLines++;\n // eslint-disable-next-line\n Object.values(pRec.messaging).forEach(mVal => {\n if (mVal && (typeof (mVal) === 'string') && (mVal !== '')) {\n let outVal = mVal;\n if (!isNaN(Number(mVal))) { outVal = formatPhone(mVal); }\n pdfLine(outVal, page.font.size.medium, 'normal', 0, 0, 0, { align: 'vertical', noBreak: true });\n totalLines++;\n }\n });\n }\n }\n };\n if (oData.slots[sID].marked) {\n pdfLine('image', page.font.size.small, 'normal', 0, 0, 0, { yPos: nameY, noNewLine: true, align: 'right', image: `https://ava-icons.s3.amazonaws.com/icons8-check-192.png` });\n }\n }\n totalLines += 2;\n }\n\n if (totalLines === 0) {\n pdfLine(`No data found for ${page.info.title}`, page.font.size.medium, 'normal', detail_indent, 3);\n }\n\n // Wrap up\n let event_info = `${body.client || body.client_id}//${body.event || body.event_id}`;\n if (body.occurrence || body.occurrence_id) {\n event_info += `//${body.occurrence || body.occurrence_id}`;\n }\n pdfLine('AVA Senior Living', page.font.size.tiny, 'normal', 0, 0, 0, { align: 'footer' });\n pdfLine(`Event info ${event_info}`, page.font.size.tiny, 'normal', 0, 0, 0, { align: 'center', noBreak: true });\n pdfLine('****** END ******', page.font.size.tiny, 'normal', 0, 0, 0, { align: 'center', noBreak: true });\n var now = new Date();\n var postTime = now.getTime();\n let fileName = `${body.client || body.client_id}_${postTime}_EventReport.pdf`;\n /*\n let pBlob = doc.output('blob');\n let data64 = (doc.output('datauri')).split(';base64,')[1];\n let s3Resp = await s3\n .upload({\n Bucket: 'theseus-medical-storage',\n Key: fileName,\n Body: pBlob,\n ACL: 'public-read-write',\n ContentType: 'application/pdf'\n })\n .promise()\n .catch(err => {\n cl(`PDF not saved by AVA. The reason is ${err.message}`);\n });\n */\n await doc.save(fileName, { returnPromise: true });\n // s3Resp.data = data64;\n\n return fileName;\n\n function formatTime(pHHMM) {\n let mm = pHHMM % 100;\n let hh_raw = Math.floor(pHHMM / 100);\n let hh = hh_raw;\n if (hh_raw > 12) { hh = hh_raw - 12; }\n else if (hh_raw === 0) { hh = 12; };\n return (`${hh}:${mm < 10 ? '0' + mm : mm}`);\n };\n\n function pdfLine(textIn, size, style, indent = 0, before, after, options = {}) {\n // doc.setFontSize(page.font.size.tiny);\n // doc.text(String(yPos), 10, yPos, options);\n let textArray = makeArray(textIn);\n for (let a = 0; a < textArray.length; a++) {\n let text = String(textArray[a]);\n if (typeof (textIn) === 'string') { text = textIn.toString(); }\n else if (typeof (textIn) === 'number') { text = textIn.toString(); }\n let lastSize = page.font.size.medium;\n if (size) {\n doc.setFontSize(size);\n lastSize = size;\n }\n let rememberedYPos;\n if (options.yPos) {\n rememberedYPos = yPos;\n yPos = options.yPos;\n }\n if (before) { yPos += before * lastSize; }\n let needPageBreak = false;\n if (options.noBreak) {\n if (yPos > (page.height - 10)) { needPageBreak = true; }\n }\n else {\n if (yPos > (page.height - page.margin.bottom - 54)) { needPageBreak = true; }\n }\n if (needPageBreak) {\n // Title lines \n doc.addPage({\n orientation: page.layout,\n format: page.size\n });\n doc.setFont(page.font.family, 'normal');\n doc.setFontSize(page.font.size.large);\n let xOffset = page.centerPoint - (doc.getTextWidth(page.info.title) / 2);\n let yOffset = page.margin.top;\n doc.text(page.info.title, xOffset, yOffset);\n if (body.client_name) {\n let outClientName = titleCase(body.client_name);\n xOffset = page.centerPoint - (doc.getTextWidth(outClientName) / 2);\n yOffset += page.font.size.large;\n doc.text(outClientName, xOffset, yOffset);\n }\n doc.setFontSize(page.font.size.small);\n xOffset = page.centerPoint - (doc.getTextWidth(oData.date.absolute) / 2);\n yOffset += page.font.size.small;\n doc.text(oData.date.absolute, xOffset, yOffset);\n if (oData.time) {\n xOffset = page.centerPoint - (doc.getTextWidth(oData.time) / 2);\n yOffset += page.font.size.small;\n doc.text(oData.time, xOffset, yOffset);\n }\n if (oData.location && oData.location.description) {\n xOffset = page.centerPoint - (doc.getTextWidth(oData.location.description) / 2);\n yOffset += page.font.size.small;\n doc.text(oData.location.description, xOffset, yOffset);\n }\n page.number++;\n let pageNumberLine = `page ${page.number}`;\n xOffset = page.centerPoint - (doc.getTextWidth(pageNumberLine) / 2);\n yOffset += page.font.size.small;\n doc.text(pageNumberLine, xOffset, yOffset);\n doc.setFontSize(lastSize);\n yPos = page.margin.top + page.font.size.large + page.font.size.small + (lastSize * 3);\n }\n if (style) { doc.setFont(page.font.family, style); }\n if (!options.noNewLine) {\n yPos += lastSize;\n if (options.align !== 'vertical') { xPos = page.margin.left; }\n else { xPos = previousXPos; }\n }\n let nextLine;\n if (doc.getTextWidth(text) > page.printableArea) {\n let tWords = text.split(/\\s+/);\n nextLine = tWords.pop();\n text = tWords.join(' ');\n if (doc.getTextWidth(text) > page.printableArea) {\n let t2Words = text.split(/\\s+/);\n nextLine += ' ' + t2Words.pop();\n text = t2Words.join(' ');\n }\n textArray.splice(a, 0, nextLine);\n }\n if (options.image) {\n let imageSize = size * 3;\n let xOffset;\n switch (options.align) {\n case 'center': {\n xOffset = page.centerPoint - (imageSize / 2);\n break;\n }\n case 'right': {\n xOffset = page.width - page.margin.right - imageSize;\n break;\n }\n default: {\n xOffset = xPos + indent;\n }\n }\n doc.addImage(options.image, 'JPEG', xOffset, yPos, imageSize, imageSize);\n previousXPos = xOffset;\n xPos = xOffset + imageSize + lastSize;\n }\n else {\n if (options.align === 'center') {\n let xOffset = page.centerPoint - (doc.getTextWidth(text) / 2);\n doc.text(text, xOffset, yPos);\n previousXPos = xOffset;\n xPos = page.centerPoint + (doc.getTextWidth(text) / 2) + lastSize;\n }\n else if (options.align === 'right') {\n doc.text(text, page.width - page.margin.right, yPos, { align: 'right' });\n previousXPos = page.width - page.margin.right - doc.getTextWidth(text);\n xPos = page.margin.right;\n }\n else if (options.align === 'left') {\n doc.text(text, page.margin.left + indent, yPos);\n previousXPos = page.margin.left + indent;\n xPos = page.margin.left + indent + doc.getTextWidth(text) + lastSize;\n }\n else if (options.xPos) {\n doc.text(text, options.xPos, yPos);\n previousXPos = options.xPos;\n xPos = options.xPos + doc.getTextWidth(text) + lastSize;\n }\n else if (options.noNewLine) {\n doc.text(text, xPos + indent, yPos);\n previousXPos = xPos + indent;\n xPos += doc.getTextWidth(text) + lastSize;\n }\n else if (options.align === 'footer') {\n let xOffset = page.centerPoint - (doc.getTextWidth(text) / 2);\n let yOffset = page.height - page.margin.bottom - 54;\n doc.text(text, xOffset, yOffset);\n previousXPos = xOffset;\n yPos = yOffset;\n xPos = page.centerPoint + (doc.getTextWidth(text) / 2) + lastSize;\n }\n else {\n doc.text(text, xPos + indent, yPos);\n previousXPos = xPos + indent;\n xPos = (xPos + indent) + doc.getTextWidth(text) + lastSize;\n }\n }\n if (rememberedYPos) { yPos = rememberedYPos; }\n if (after) { yPos += (after * lastSize); }\n }\n return;\n }\n\n}\n\nexport async function eventData(body) {\n /* \n pass in an event_code, get event information back\n body = {\n client (or client_id)\n event (or event_id)\n info - 'basic'=just event data itself; 'full'=event and occurrence list; \n }\n returnObj = {\n description,\n location,\n type,\n time,\n occurrences: {\n past: [, , ...],\n current: [, , ...]\n }\n }\n */\n let event_id = (body.event_id || body.event || body.filter?.event_id || body.filter?.event).split('#').shift();\n\n let qQ = { TableName: 'Calendar' };\n\n qQ.KeyConditionExpression = 'client = :c';\n qQ.ExpressionAttributeValues = { ':c': body.client || body.client_id };\n\n if (body.info === 'full') {\n qQ.KeyConditionExpression += ' and begins_with(event_key, :rEvent)';\n qQ.ExpressionAttributeValues[':rEvent'] = event_id;\n qQ.FilterExpression = 'record_type = :e OR record_type = :o';\n qQ.ExpressionAttributeValues[':e'] = 'event';\n qQ.ExpressionAttributeValues[':o'] = 'occurrence';\n }\n else {\n qQ.KeyConditionExpression += ' and event_key = :rEvent';\n qQ.ExpressionAttributeValues[':rEvent'] = event_id;\n }\n\n let calendarRecs = await dbClient\n .query(qQ)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${qQ.TableName} in eventData - error is: ${error}`);\n cl(qQ);\n });\n let returnObj = {\n description: '',\n location: '',\n type: '',\n time: '',\n occurrences: {\n past: [],\n current: [],\n future: []\n }\n };\n let eventRec, start_date, end_date;\n if (recordExists(calendarRecs)) {\n let today = makeDate(new Date());\n for (let c = 0; c < calendarRecs.Items.length; c++) {\n let this_rec = calendarRecs.Items[c];\n switch (this_rec.record_type) {\n case 'event': {\n returnObj.description = this_rec.eventData.event_data.description;\n returnObj.location = this_rec.eventData.event_data.location.description;\n returnObj.type = this_rec.eventData.event_data.type;\n if (this_rec.eventData.event_data.groups) {\n returnObj.groups = this_rec.eventData.event_data.groups.filter(g => {\n return ((g !== 'ALL') && (g !== '__TOP__'));\n });\n }\n if (!returnObj.groups || (returnObj.groups.length === 0)) {\n returnObj.groups = ['*all'];\n }\n returnObj.owner = this_rec.eventData.event_data.owner || [];\n returnObj.time = this_rec.eventData.event_data.time.from;\n if (this_rec.eventData.event_data.time.to && (this_rec.eventData.event_data.time.to.trim() !== '')) {\n returnObj.time += ` to ${this_rec.eventData.event_data.time.to}`;\n };\n eventRec = this_rec;\n start_date = makeDate(this_rec.eventData.last_written_occurrence || this_rec.start_date || today.date).date;\n if (start_date < today.date) { start_date = today.date; }\n end_date = makeDate(this_rec.end_date || addDays(start_date, 35)).date;\n returnObj.occurrences.future = occurrenceDateBuilder(eventRec, start_date, end_date);\n break;\n }\n case 'occurrence': {\n let key = ((this_rec.occurrence_date < today.numeric$) ? 'past' : 'current');\n returnObj.occurrences[key].push(this_rec.event_key);\n break;\n }\n default: { }\n }\n }\n }\n return returnObj;\n};\n\nexport async function occurrenceData(body) {\n /* \n request {\n client (or client_id)\n event (or event_id)\n occurrence (or occurrence_id - if null, then get occurrence from event_id)\n }\n returnObj {\n description,\n location,\n type,\n owner,\n time,\n date (as returned from makeDate)\n slots: {\n slotName: {\n owner (or false),\n notes,\n display_name\n marked\n }\n }\n }\n */\n let returnObj = {\n description: '',\n location: '',\n time: '',\n slots: {}\n };\n\n let rC = body.client_id || body.client;\n let rV = makeString((body.event_id || body.event || body.filter?.event_id || body.filter?.event), 1);\n let rO = body.occurrence_id || body.occurrence || body.filter?.occurrence_id || body.filter?.occurrence;\n if (rO && rV) { rV = rV.split('#')[0] + '#' + rO; } // both sent in change rV to include passed rO\n else if (rO) { return {}; } // rO sent without an rV - that's bad; ignore rO\n else if (rV) { rO = rV.split('#')[1]; } // rV sent without an rO; try to set rO from the rV value\n else { return {}; } // netiher sent; return void\n // if no rO was set, use the event only (all slots will be empty)\n let [eventInfo] = await getCalendarEntries({ client: rC, event: rV, occurrence: rO, type: 'event' });\n let occInfoArray = await getCalendarEntries({ client: rC, event: rV, occurrence: rO, type: 'structure' });\n occInfoArray.unshift(eventInfo);\n occInfoArray.forEach((rec, x) => {\n if (!returnObj.date && (rec.occurrence_date || (makeNumber(rec.schedule_key) > 0))) {\n returnObj.date = makeDate(rec.occurrence_date || makeNumber(rec.schedule_key));\n }\n if (rec.eventData) {\n cl({ 'handling eventData': rec.eventData.event_data });\n if (!returnObj.description) { returnObj.description = rec.eventData.event_data.description; }\n if (!returnObj.location) { returnObj.location = rec.eventData.event_data.location; }\n if (!returnObj.type && rec.eventData.sign_up) {\n if (rec.eventData.sign_up.type === 'time') { returnObj.type = 'time'; }\n else { returnObj.type = 'seats'; }\n }\n if (!returnObj.time) {\n if (rec.eventData.event_data.time) {\n returnObj.time = rec.eventData.event_data.time.from;\n if (rec.eventData.event_data.time.to && (rec.eventData.event_data.time.to.trim() !== '')) {\n returnObj.time += ' to ' + rec.eventData.event_data.time.to;\n }\n }\n }\n if (returnObj.slots.length === 0) {\n rec.slotPattern.forEach(sID => {\n if (!(sID in returnObj.slots)) {\n returnObj.slots[sID] = { owner: null, notes: null, display_name: null, marked: false };\n }\n });\n };\n }\n else if (rec.record_type === 'occurrence') {\n Object.assign(returnObj, rec);\n if (rec.time) {\n returnObj.time = rec.time.from;\n if (rec.time.to && (rec.time.to.trim() !== '')) {\n returnObj.time += ' to ' + rec.time.to;\n }\n }\n if (rec.occurrence_date) {\n returnObj.date = makeDate(rec.occurrence_date);\n }\n }\n else if (rec.occData) {\n if ('event_data' in rec.occData) {\n if ('description' in rec.occData.event_data) {\n returnObj.description = rec.occData.event_data.description;\n }\n if ('location' in rec.occData.event_data) {\n returnObj.location = rec.occData.event_data.location;\n }\n if ('time' in rec.occData.event_data) {\n returnObj.time = rec.occData.event_data.time.from;\n if (rec.occData.event_data.time.to && (rec.occData.event_data.time.to.trim() !== '')) {\n returnObj.time += ' to ' + rec.occData.event_data.time.to;\n }\n }\n if (rec.occData.sign_up) {\n if (rec.occData.sign_up.type === 'time') { returnObj.type = 'time'; }\n else { returnObj.type = 'seats'; }\n }\n if ('slotPattern' in rec.occData.event_data) {\n for (const sID in returnObj.slots) {\n if (!returnObj.slots[sID].owner) { delete returnObj.slots[sID]; } // unoccupied slots are removed\n }\n rec.slotPattern.forEach(sID => { // fill the array with slots from the pattern\n returnObj.slots[sID] = { owner: null, notes: null, display_name: null, marked: false };\n });\n }\n }\n else {\n if ('description' in rec.occData) {\n returnObj.description = rec.occData.description;\n };\n if ('time_from' in rec.occData) {\n returnObj.time = rec.occData.time_from;\n };\n\n }\n }\n else if (rec.slotData) {\n let sID = rec.slotData.slot || rec.slotData.id;\n if (rec.slotData.status && rec.slotData.status.current === 'released') {\n returnObj.slots[sID] = {\n owner: '',\n notes: '',\n display_name: '',\n marked: false\n };\n }\n else {\n let slotName = '';\n if (rec.slotData.display_name) { slotName = rec.slotData.display_name; }\n else if (rec.slotData.name) {\n if (typeof rec.slotData.name === 'string') { slotName = rec.slotData.name; }\n else { slotName = `${rec.slotData.name.first} ${rec.slotData.name.last}`.trim(); }\n }\n returnObj.slots[sID] = {\n owner: rec.slotData.owner,\n notes: rec.slotData.notes,\n display_name: slotName,\n marked: !!rec.marked\n };\n }\n }\n else if (rec.calData) { }\n });\n return returnObj;\n};\n\nexport async function getAllOccurrences(body, screenStatus = () => { }) {\n /*\n get a list of events by date\n requestBody = {\n client (or client_id or [list of client_id's])\n start_date - today if missing\n end_date - start + 14 days if missing\n filter {\n group: [...values] - only include entries that are valid for one of these groups\n person: person_id - only include entries where this person is a slot owner\n }\n }\n returnList = [{\n date (as yyyymmdd string)\n client\n event_key (event_id#occurrence_date) \n description,\n location,\n time,\n restrictedToGroup\n }]\n */\n\n const [start_date, end_date] = setDateRange(body.start_date, body.end_date);\n\n let qQ = { TableName: 'Calendar' };\n const this_client = body.client || body.client_id;\n qQ.KeyConditionExpression = 'client = :c';\n qQ.ExpressionAttributeValues = { ':c': this_client };\n\n if (body.filter && body.filter.this_person) {\n qQ.IndexName = 'slot_owner-index';\n qQ.KeyConditionExpression += ' AND slot_owner = :s';\n qQ.ExpressionAttributeValues[':s'] = body.filter.this_person;\n }\n else {\n qQ.IndexName = 'occurrence_date-index';\n qQ.KeyConditionExpression += ' AND occurrence_date BETWEEN :s and :e';\n qQ.ExpressionAttributeValues[':s'] = makeDate(start_date, { noTime: true }).numeric$;\n qQ.ExpressionAttributeValues[':e'] = makeDate(end_date, { noTime: true }).numeric$;\n }\n\n let peopleInfo = {};\n let conflicts = {};\n // key = person_id; value = { : [ {yymm24: \"open\"/} ] }\n // sort inner array { person: {date: [array]}} by keys (time)\n // then, search through array from to back for last entry before the time you're interested in\n let response = {};\n for (let date = start_date; date <= end_date; date = addDays(date, 1)) {\n let thisDate = makeDate(date);\n response[thisDate.numeric] = {\n events: {},\n date_words: thisDate.relative\n };\n };\n\n // let returnList = [];\n let calendarRecs = await dbClient\n .query(qQ)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${qQ.TableName} in getAllOccurrences - error is: ${error}`);\n cl(qQ);\n });\n if (!recordExists(calendarRecs)) { return response; }\n\n let total_oRecs = calendarRecs.Items.length;\n let screenDate = 0;\n let found_events = {};\n let cancelled_occurrences = {};\n for (let c = 0; c < total_oRecs; c++) {\n let occurrenceRec = deepCopy(calendarRecs.Items[c]);\n if (occurrenceRec.occurrence_date !== screenDate) { // send a message back... now processing date xxxx\n screenDate = occurrenceRec.occurrence_date;\n screenStatus(makeDate(occurrenceRec.occurrence_date).relative, total_oRecs * 3, ((c / total_oRecs) * 90), response);\n }\n else if ((c % 10) === 0) {\n screenStatus(makeDate(occurrenceRec.occurrence_date).relative, total_oRecs * 3, ((c / total_oRecs) * 90), response);\n }\n if (!found_events.hasOwnProperty(occurrenceRec.event_id)) {\n // for each event we come across, gather event data (eventData) and create any missing occurrences in this date range (getOccurrenceList)\n // found_events[occurrenceRec.event_id] = await eventData({\n // client_id: this_client,\n // event_id: occurrenceRec.event_id,\n // info: 'basic'\n // });\n // ********* RAY HERE **************\n let newOcc = {};\n if (!occurrenceRec.event_id) {\n occurrenceRec.event_id = occurrenceRec.event_key.split('#')[0];\n }\n const responseCal = await getCalendarEntries({\n client: this_client,\n event: occurrenceRec.event_id,\n type: 'event'\n });\n newOcc.eventRec = responseCal[0];\n /*\n let newOcc = await getOccurenceList({\n client: this_client,\n event: occurrenceRec.event_id,\n from_date: start_date,\n to_date: end_date\n });\n */\n found_events[occurrenceRec.event_id] = newOcc.eventRec.eventData.event_data;\n if (newOcc.eventRec.hasOwnProperty('default_forms')) {\n found_events[occurrenceRec.event_id].default_forms = newOcc.eventRec.default_forms;\n }\n if (newOcc.eventRec.hasOwnProperty('customizations')) {\n found_events[occurrenceRec.event_id].customizations = newOcc.eventRec.customizations;\n }\n if (newOcc.eventRec.eventData.slotPattern && (newOcc.eventRec.eventData.slotPattern.length > 0)) {\n found_events[occurrenceRec.event_id].slotPattern = newOcc.eventRec.eventData.slotPattern;\n }\n if (newOcc.eventRec.eventData.slot_object_list && (newOcc.eventRec.eventData.slot_object_list.length > 0)) {\n found_events[occurrenceRec.event_id].slot_object_list = newOcc.eventRec.eventData.slot_object_list;\n }\n if ((newOcc.eventRec.eventData.event_data.type === 'seats')\n && (newOcc.eventRec.eventData.slotPattern)\n && (newOcc.eventRec.eventData.slot_object_list)) {\n found_events[occurrenceRec.event_id].slot_names = {};\n let lastID = '';\n newOcc.eventRec.eventData.slotPattern.forEach(sID => {\n let foundIt = newOcc.eventRec.eventData.slot_object_list.find(sO => {\n return (sO.key === sID);\n });\n if (foundIt && foundIt.value !== '') {\n lastID = foundIt.value;\n }\n found_events[occurrenceRec.event_id].slot_names[sID] = lastID;\n });\n }\n if (!found_events[occurrenceRec.event_id].hasOwnProperty('time')\n || (isObject(found_events[occurrenceRec.event_id].time) && isEmpty(found_events[occurrenceRec.event_id].time.from))\n || (isEmpty(found_events[occurrenceRec.event_id].time))) {\n found_events[occurrenceRec.event_id].sort24 = `0001-${found_events[occurrenceRec.event_id].description}`;\n }\n else if (isObject(found_events[occurrenceRec.event_id].time)) {\n found_events[occurrenceRec.event_id].sort24 = makeTime(found_events[occurrenceRec.event_id].time.from).string24;\n }\n else {\n found_events[occurrenceRec.event_id].sort24 = makeTime(found_events[occurrenceRec.event_id].time.split(' to')[0]).string24;\n }\n // for occurrences that were created, add them to the appropriate response[date].events object\n /*\n for (let newDate in newOcc.occRec) {\n if (response.hasOwnProperty(newDate)) {\n if (!response[newDate].events.hasOwnProperty(newOcc.occRec[newDate].event_id)) {\n response[newDate].events[newOcc.occRec[newDate].event_id] = {\n slot_owners: {}\n };\n }\n Object.assign(response[newDate].events[newOcc.occRec[newDate].event_id], newOcc.eventRec.eventData.event_data, newOcc.occRec[newDate]);\n }\n }\n */\n // eslint-disable-next-line\n const this_eventID = occurrenceRec.event_id;\n const responseEventRec = deepCopy(newOcc.eventRec.eventData.event_data);\n const responseRec = Object.assign({}, responseEventRec, occurrenceRec, { slot_owners: {} });\n response[occurrenceRec.occurrence_date].events[occurrenceRec.event_id] = responseRec;\n }\n // identify any cancelled occurrences; we'll remove them later\n if (occurrenceRec.occurrence_cancelled) {\n let [eID, eDate] = occurrenceRec.event_key.split('#');\n if (!cancelled_occurrences.hasOwnProperty(eID)) {\n cancelled_occurrences[eID] = [];\n }\n cancelled_occurrences[eID].push(eDate);\n }\n if ((cancelled_occurrences.hasOwnProperty(occurrenceRec.event_id))\n && (cancelled_occurrences[occurrenceRec.event_id].includes(occurrenceRec.occurrence_date))) {\n continue;\n }\n else {\n // find and add this event in the proper date\n if (!response[occurrenceRec.occurrence_date].events.hasOwnProperty(occurrenceRec.event_id)) {\n response[occurrenceRec.occurrence_date].events[occurrenceRec.event_id] = {\n slot_owners: {}\n };\n }\n if (occurrenceRec.record_type === 'occurrence') {\n Object.assign(response[occurrenceRec.occurrence_date].events[occurrenceRec.event_id], occurrenceRec);\n }\n else if ((occurrenceRec.record_type === 'slot') && ((occurrenceRec.slotData.status.current === 'selected') || (occurrenceRec.slotData.status.current === 'notes'))) {\n if (response[occurrenceRec.occurrence_date].events[occurrenceRec.event_id].slot_owners.hasOwnProperty(occurrenceRec.slotData.owner)) {\n response[occurrenceRec.occurrence_date].events[occurrenceRec.event_id].slot_owners[`${occurrenceRec.slotData.owner}%%${c}`] =\n found_events[occurrenceRec.event_id]?.slot_names?.[occurrenceRec.slotData.slot] || ((found_events[occurrenceRec.event_id].type === 'seats') ? '' : occurrenceRec.slotData.slot);\n }\n else {\n response[occurrenceRec.occurrence_date].events[occurrenceRec.event_id].slot_owners[occurrenceRec.slotData.owner] =\n found_events[occurrenceRec.event_id]?.slot_names?.[occurrenceRec.slotData.slot]\n || ((found_events[occurrenceRec.event_id].type === 'seats')\n ? ''\n : occurrenceRec.slotData.slot\n );\n }\n if (!peopleInfo.hasOwnProperty(occurrenceRec.slotData.owner)) {\n peopleInfo[occurrenceRec.slotData.owner] = [];\n conflicts[occurrenceRec.slotData.owner] = {};\n }\n let slotTimesResponse = slotTimes(found_events[occurrenceRec.event_id], response[occurrenceRec.occurrence_date].events[occurrenceRec.event_id], occurrenceRec);\n peopleInfo[occurrenceRec.slotData.owner].push(Object.assign({},\n {\n occurrence_date: occurrenceRec.occurrence_date,\n event_id: occurrenceRec.event_id,\n event_description: found_events[occurrenceRec.event_id].description,\n start_time24: slotTimesResponse.start24,\n end_time24: slotTimesResponse.end24,\n },\n occurrenceRec.slotData)\n );\n if (!conflicts[occurrenceRec.slotData.owner].hasOwnProperty(occurrenceRec.occurrence_date)) {\n conflicts[occurrenceRec.slotData.owner][occurrenceRec.occurrence_date] = [{ time: 0, open: true }];\n }\n let this_date = makeDate(occurrenceRec.occurrence_date);\n let this_Sunday = makeDate(addDays(this_date.date, -(this_date.dayOfWeek)));\n if (!conflicts[occurrenceRec.slotData.owner].hasOwnProperty('summaries')) {\n conflicts[occurrenceRec.slotData.owner].summaries = {\n [this_Sunday.numeric$]: {\n description: this_Sunday.dateOnly,\n minutes: 0\n }\n };\n }\n else if (!conflicts[occurrenceRec.slotData.owner].summaries.hasOwnProperty(this_Sunday.numeric$)) {\n conflicts[occurrenceRec.slotData.owner].summaries[this_Sunday.numeric$] = {\n description: this_Sunday.dateOnly,\n minutes: 0\n };\n }\n let start_time = makeTime(slotTimesResponse.start24);\n let end_time = makeTime(slotTimesResponse.end24);\n let minutes_booked = 0;\n if (end_time.minutesSinceMidnight < start_time.minutesSinceMidnight) {\n minutes_booked = end_time.minutesSinceMidnight + (1440 - start_time.minutesSinceMidnight);\n }\n else {\n minutes_booked = end_time.minutesSinceMidnight - start_time.minutesSinceMidnight;\n }\n if (minutes_booked < 1200) {\n conflicts[occurrenceRec.slotData.owner].summaries[this_Sunday.numeric$].minutes += minutes_booked;\n }\n conflicts[occurrenceRec.slotData.owner][occurrenceRec.occurrence_date].push(\n {\n time: start_time.numeric24,\n open: false,\n event_id: occurrenceRec.event_id,\n event_title: found_events[occurrenceRec.event_id].description\n },\n {\n time: end_time.numeric24,\n open: true\n }\n );\n }\n }\n };\n\n screenStatus('Wrapping things up', total_oRecs * 3, 95, response);\n let greetings = await getCustomizations('greetings', this_client);\n let greetingsAll = await getCustomizations('greetings', '*all');\n let holidays = Object.assign({}, greetingsAll.customization_value, greetings.customization_value);\n\n for (let this_date in response) {\n // Add Holidays from the Greetings or Holidays Customization\n let today = makeDate(this_date);\n let mmdd = today.obs.slice(5);\n let yymmdd = `${today.obs.slice(2, 4)}.${mmdd}`;\n if (holidays.hasOwnProperty(today.obs)) {\n response[this_date].events[`#greeting_${yymmdd}#`] = {\n description: holidays[today.obs],\n sort24: `0000-${holidays[today.obs]}`,\n slot_owners: {},\n type: 'holiday'\n };\n }\n else if (holidays.hasOwnProperty(yymmdd)) {\n response[this_date].events[`#greeting_${yymmdd}#`] = {\n description: holidays[yymmdd],\n sort24: `0000-${holidays[yymmdd]}`,\n slot_owners: {},\n type: 'holiday'\n };\n }\n else if (holidays.hasOwnProperty(mmdd)) {\n response[this_date].events[`#greeting_${yymmdd}#`] = {\n description: holidays[mmdd],\n sort24: `0000-${holidays[mmdd]}`,\n slot_owners: {},\n type: 'holiday'\n };\n }\n for (let this_event in response[this_date].events) {\n let allowed_event = true;\n if (found_events[this_event]) {\n if ((cancelled_occurrences.hasOwnProperty(this_event))\n && (cancelled_occurrences[this_event].includes(this_date))) {\n allowed_event = false;\n }\n else if (found_events[this_event].owner.includes(body.this_person)) {\n allowed_event = true;\n }\n else if ((found_events[this_event].type === 'personal') &&\n body.this_person &&\n (!found_events[this_event].owner.includes(body.this_person))) {\n allowed_event = false;\n }\n if (allowed_event && (body.filter.group) && (found_events[this_event]?.groups)) {\n // event must allow *all OR must allow a group that is in the filter.group list\n if (found_events[this_event].groups.includes('*all')) { }\n else {\n allowed_event = found_events[this_event].groups.some(allowed_group => {\n if (Array.isArray(body.filter.group)) {\n return body.filter.group.includes(allowed_group);\n }\n else {\n return Object.keys(body.filter.group).includes(allowed_group);\n }\n });\n }\n }\n if (allowed_event && (body.filter.slot_owner)) {\n // event must have a slot owner in the list of body.filter.slot_owners\n let slotOwnerList = makeArray(body.filter.slot_owner);\n if (slotOwnerList.includes('*all')) { }\n else {\n allowed_event = Object.keys(response[this_date].events[this_event].slot_owners).some(this_slotOwner => {\n return slotOwnerList.includes(this_slotOwner);\n });\n }\n }\n }\n if (!allowed_event) {\n delete response[this_date].events[this_event];\n }\n else {\n response[this_date].events[this_event] = Object.assign({}, found_events[this_event], response[this_date].events[this_event]);\n }\n }\n }\n for (let this_person in conflicts) {\n for (let this_date in conflicts[this_person]) {\n if (this_date !== 'summaries') {\n conflicts[this_person][this_date].sort((a, b) => {\n if (a.time === b.time) {\n return (!a.open ? 1 : -1);\n }\n else {\n return ((a.time < b.time) ? -1 : 1);\n }\n });\n }\n }\n }\n response.conflicts = conflicts;\n response.peopleInfo = peopleInfo;\n return response;\n\n function setDateRange(start_date, end_date) {\n let this_start, this_end;\n let candidate = makeDate(start_date);\n if (candidate.error || isEmpty(start_date)) {\n if (isEmpty(end_date)) {\n this_start = new Date();\n this_end = addDays(this_start, 14);\n }\n else if (isObject(end_date)) {\n this_end = end_date;\n this_start = addDays(this_end, -14);\n }\n else {\n let candidate = makeDate(end_date);\n if (candidate.error) {\n this_start = new Date();\n this_end = addDays(this_start, 14);\n }\n else {\n this_end = candidate.date;\n this_start = addDays(this_end, -14);\n }\n }\n }\n else {\n this_start = candidate.date;\n if (isEmpty(end_date)) {\n this_end = addDays(this_start, 14);\n }\n else if (isObject(end_date)) {\n this_end = end_date;\n }\n else {\n let candidate = makeDate(end_date);\n if (candidate.error) {\n this_end = addDays(this_start, 14);\n }\n else {\n this_end = candidate.date;\n }\n }\n }\n\n if (this_end < this_start) {\n return [this_end, this_start];\n }\n else {\n return [this_start, this_end];\n }\n }\n}\n\n\n\nexport async function v2buildCalendar(body, screenStatus = () => { }) {\n const [start_date, end_date] = setDateRange(body.start_date, body.end_date);\n\n let peopleInfo = {};\n let conflicts = {};\n const this_client = body.client || body.client_id;\n // key = person_id; value = { : [ {yymm24: \"open\"/} ] }\n // sort inner array { person: {date: [array]}} by keys (time)\n // then, search through array from to back for last entry before the time you're interested in\n\n // create response as an object with keys = each of the dates in the date range\n let response = {};\n let startObj = makeDate(start_date);\n let endObj = makeDate(end_date);\n for (let this_date = startObj; this_date.date <= endObj.date; this_date = makeDate(addDays(this_date.date, 1), { noTime: true })) {\n response[this_date.numeric] = {\n events: {},\n date_words: this_date.relative\n };\n };\n\n let oRecs = await dbClient\n .query({\n KeyConditionExpression: 'client = :c AND occurrence_date BETWEEN :s and :e',\n ExpressionAttributeValues: {\n ':c': this_client,\n ':s': startObj.numeric$,\n ':e': endObj.numeric$,\n },\n TableName: \"Calendar\",\n IndexName: \"occurrence_date-index\",\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading Calendar in v2buildCalendar - error is: ${error}`);\n });\n if (!recordExists(oRecs)) { return response; }\n let sorted_oRecs = oRecs.Items.sort((a, b) => { return ((a.event_key < b.event_key) ? -1 : 1); });\n const total_oRecs = sorted_oRecs.length;\n let current_oRec = 0;\n let current_event = null;\n let this_event = false;\n let current_occurrenceDate = null;\n let current_occurence_asDate = {};\n let current_occurence_tomorrow_asDate = {};\n let this_occurrence = false;\n let skip_event = false;\n let filter_groups = ((body.filter && body.filter.group) ? (isObject(body.filter.group) ? Object.keys(body.filter.group) : [body.filter.group].flat()) : false);\n let filter_owners = ((body.filter && body.filter.slot_owner & ![body.filter.slot_owner].flat().includes('*all')) ? [body.filter.slot_owner].flat() : false);\n for (let this_oRec of sorted_oRecs) {\n current_oRec++;\n if ((this_oRec.occurrence_date !== current_occurrenceDate) || (this_oRec.event_id !== current_event)) {\n // finish this occurrence\n if (current_event && current_occurrenceDate && this_occurrence) {\n let write_me = true;\n if (filter_owners) {\n write_me = this_occurrence.slot_owners.some(this_slotOwner => { return filter_owners.includes(this_slotOwner); });\n }\n if (write_me) {\n response[current_occurrenceDate].events[current_event] = this_occurrence;\n }\n }\n if (this_oRec.event_id !== current_event) {\n // start new event - will create this_event\n let eRec = await dbClient\n .get({\n Key: {\n client: this_client,\n event_key: this_oRec.event_id\n },\n TableName: \"Calendar\"\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading Calendar in v2buildCalendar - error is: ${error}`);\n });\n current_event = this_oRec.event_id;\n if (!recordExists(eRec)) {\n skip_event = true;\n continue;\n }\n if (body.this_person && (eRec.Item.type === 'personal') &&\n (!eRec.Item.owner.includes(body.this_person))) {\n skip_event = true;\n continue;\n }\n if (filter_groups && eRec.Item.groups &&\n !eRec.Item.groups.includes('*all') && (!eRec.Item.groups.some(allowed_group => {\n return filter_groups.includes(allowed_group);\n }\n ))) {\n skip_event = true;\n continue;\n };\n skip_event = false;\n this_event = Object.assign({},\n eRec.Item,\n {\n slotPattern: ((eRec.Item.eventData?.slotPattern && (eRec.Item.eventData?.slotPattern.length > 0)) ? eRec.Item.eventData?.slotPattern : []),\n slot_object_list: ((eRec.Item.eventData?.slot_object_list && (eRec.Item.eventData?.slot_object_list.length > 0)) ? eRec.Item.eventData?.slot_object_list : []),\n slot_names: makeSlotNames(eRec.Item.eventData),\n }\n );\n }\n else if (skip_event) {\n continue;\n }\n // start new occurrence - will create this_occurrence\n this_occurrence = false;\n if (this_oRec.occurrence_cancelled) {\n cl(`${this_oRec.event_key} cancelled... skipping`);\n continue;\n }\n if (this_oRec.record_type !== 'occurrence') {\n cl(`${this_oRec.event_key} not occurrence when occurrence expected... skipping`);\n continue;\n }\n current_occurrenceDate = this_oRec.occurrence_date;\n current_occurence_asDate = makeDate(current_occurrenceDate);\n current_occurence_tomorrow_asDate = makeDate(addDays(current_occurence_asDate.date, 1));\n if ((current_oRec % 10) === 0) {\n screenStatus(current_occurence_asDate.relative, total_oRecs * 3, ((current_oRec / total_oRecs) * 90), response);\n }\n this_occurrence = Object.assign({},\n deepCopy(this_event.eventData.event_data),\n deepCopy(this_oRec),\n makeSort24(Object.assign({}, this_event.eventData.event_data, this_oRec)),\n {\n default_forms: this_event.default_forms || [],\n customizations: this_event.customizations || [],\n slot_owners: {}\n }\n );\n continue;\n }\n // if we arrive here, we have a slot record in the current occurrence\n if (!this_occurrence) { continue; }\n if (this_oRec.record_type !== 'slot') { continue; }\n if ((this_oRec.slotData.status.current !== 'selected') && (this_oRec.slotData.status.current !== 'notes')) { continue; }\n let this_owner = this_oRec.slotData.owner;\n let instance_number = 0;\n\n // this little bit of code deals with one person being signed up twice for an event...\n let try_again = false;\n do {\n if (this_occurrence.slot_owners.hasOwnProperty(this_owner)) {\n this_owner = `${this_owner}%%${instance_number++}`;\n try_again = true;\n }\n else {\n try_again = false;\n }\n } while (try_again);\n\n if (this_event.slot_names && this_event.slot_names.hasOwnProperty(this_oRec.slotData.slot)) {\n this_occurrence.slot_owners[this_owner] = this_event.slot_names[this_oRec.slotData.slot];\n }\n else if (this_event.eventData.event_data.type !== 'seats') {\n this_occurrence.slot_owners[this_owner] = this_oRec.slotData.slot;\n }\n else {\n this_occurrence.slot_owners[this_owner] = '';\n }\n // set up people info\n if (!peopleInfo.hasOwnProperty(this_oRec.slotData.owner)) {\n peopleInfo[this_oRec.slotData.owner] = [];\n conflicts[this_oRec.slotData.owner] = {};\n }\n let slotTimesResponse = slotTimes(this_event, this_occurrence, this_oRec);\n peopleInfo[this_oRec.slotData.owner].push(Object.assign({},\n {\n occurrence_date: current_occurrenceDate,\n event_id: current_event,\n event_description: this_occurrence.description,\n start_time24: slotTimesResponse.start24,\n end_time24: slotTimesResponse.end24,\n },\n this_oRec.slotData)\n );\n if (!conflicts[this_oRec.slotData.owner].hasOwnProperty(current_occurrenceDate)) {\n conflicts[this_oRec.slotData.owner][current_occurrenceDate] = [{ time: 0, open: true }];\n }\n let this_Sunday = makeDate(addDays(current_occurence_asDate.date, -(current_occurence_asDate.dayOfWeek)));\n if (!conflicts[this_oRec.slotData.owner].hasOwnProperty('summaries')) {\n conflicts[this_oRec.slotData.owner].summaries = {\n [this_Sunday.numeric$]: {\n description: this_Sunday.dateOnly,\n minutes: 0\n }\n };\n }\n else if (!conflicts[this_oRec.slotData.owner].summaries.hasOwnProperty(this_Sunday.numeric$)) {\n conflicts[this_oRec.slotData.owner].summaries[this_Sunday.numeric$] = {\n description: this_Sunday.dateOnly,\n minutes: 0\n };\n }\n if (!conflicts[this_oRec.slotData.owner].hasOwnProperty('availability')) {\n conflicts[this_oRec.slotData.owner].availability = {\n [current_occurence_asDate.numeric$]: 540, // any day, alllow 8 hours of availability\n [current_occurence_tomorrow_asDate.numeric$]: 540\n };\n }\n else {\n if (!conflicts[this_oRec.slotData.owner].availability.hasOwnProperty(current_occurence_asDate.numeric$)) {\n conflicts[this_oRec.slotData.owner].availability[current_occurence_asDate.numeric$] = 540;\n }\n if (!conflicts[this_oRec.slotData.owner].availability.hasOwnProperty(current_occurence_tomorrow_asDate.numeric$)) {\n conflicts[this_oRec.slotData.owner].availability[current_occurence_tomorrow_asDate.numeric$] = 540;\n }\n }\n let start_time = makeTime(slotTimesResponse.start24);\n let end_time = makeTime(slotTimesResponse.end24);\n let minutes_booked = 0;\n if (end_time.minutesSinceMidnight < start_time.minutesSinceMidnight) {\n minutes_booked = end_time.minutesSinceMidnight + (1440 - start_time.minutesSinceMidnight);\n conflicts[this_oRec.slotData.owner].availability[current_occurence_asDate.numeric$] -= (1440 - start_time.minutesSinceMidnight);\n conflicts[this_oRec.slotData.owner].availability[current_occurence_tomorrow_asDate.numeric$] -= end_time.minutesSinceMidnight;\n }\n else {\n minutes_booked = end_time.minutesSinceMidnight - start_time.minutesSinceMidnight;\n conflicts[this_oRec.slotData.owner].availability[current_occurence_asDate.numeric$] -= minutes_booked;\n }\n if (minutes_booked < 1200) {\n conflicts[this_oRec.slotData.owner].summaries[this_Sunday.numeric$].minutes += minutes_booked;\n }\n conflicts[this_oRec.slotData.owner][current_occurrenceDate].push(\n {\n time: start_time.numeric24,\n open: false,\n event_id: current_event,\n event_title: this_occurrence.description\n },\n {\n time: end_time.numeric24,\n open: true\n }\n );\n }\n // since we write AFTER a break on occurrence date or event_id, we have deal with the very last record\n if (current_event && current_occurrenceDate && this_occurrence) {\n let write_me = true;\n if (filter_owners) {\n write_me = this_occurrence.slot_owners.some(this_slotOwner => { return filter_owners.includes(this_slotOwner); });\n }\n if (write_me) {\n response[current_occurrenceDate].events[current_event] = this_occurrence;\n }\n }\n // throw out any event that doesn't include a filter_owner\n // find and add this event in the proper date\n screenStatus('Wrapping things up', oRecs.Items.length * 3, 95, response);\n let greetings = await getCustomizations('greetings', this_client);\n let greetingsAll = await getCustomizations('greetings', '*all');\n let holidays = Object.assign({}, greetingsAll.customization_value, greetings.customization_value);\n\n for (let this_date in response) {\n // Add Holidays from the Greetings or Holidays Customization\n let today = makeDate(this_date);\n let mmdd = today.obs.slice(5);\n let yymmdd = `${today.obs.slice(2, 4)}.${mmdd}`;\n if (holidays.hasOwnProperty(today.obs)) {\n response[this_date].events[`#greeting_${yymmdd}#`] = {\n description: holidays[today.obs],\n sort24: `0000-${holidays[today.obs]}`,\n slot_owners: {},\n type: 'holiday'\n };\n }\n else if (holidays.hasOwnProperty(yymmdd)) {\n response[this_date].events[`#greeting_${yymmdd}#`] = {\n description: holidays[yymmdd],\n sort24: `0000-${holidays[yymmdd]}`,\n slot_owners: {},\n type: 'holiday'\n };\n }\n else if (holidays.hasOwnProperty(mmdd)) {\n response[this_date].events[`#greeting_${yymmdd}#`] = {\n description: holidays[mmdd],\n sort24: `0000-${holidays[mmdd]}`,\n slot_owners: {},\n type: 'holiday'\n };\n }\n }\n for (let this_person in conflicts) {\n for (let this_date in conflicts[this_person]) {\n if ((this_date !== 'summaries') && (this_date !== 'availability')) {\n conflicts[this_person][this_date].sort((a, b) => {\n if (a.time === b.time) {\n return (!a.open ? 1 : -1);\n }\n else {\n return ((a.time < b.time) ? -1 : 1);\n }\n });\n }\n }\n }\n response.conflicts = conflicts;\n response.peopleInfo = peopleInfo;\n return response;\n\n function setDateRange(start_date, end_date) {\n let this_start, this_end;\n let candidate = makeDate(start_date);\n if (candidate.error || isEmpty(start_date)) {\n if (isEmpty(end_date)) {\n this_start = new Date();\n this_end = addDays(this_start, 14);\n }\n else if (isObject(end_date)) {\n this_end = end_date;\n this_start = addDays(this_end, -14);\n }\n else {\n let candidate = makeDate(end_date);\n if (candidate.error) {\n this_start = new Date();\n this_end = addDays(this_start, 14);\n }\n else {\n this_end = candidate.date;\n this_start = addDays(this_end, -14);\n }\n }\n }\n else {\n this_start = candidate.date;\n if (isEmpty(end_date)) {\n this_end = addDays(this_start, 14);\n }\n else if (isObject(end_date)) {\n this_end = end_date;\n }\n else {\n let candidate = makeDate(end_date);\n if (candidate.error) {\n this_end = addDays(this_start, 14);\n }\n else {\n this_end = candidate.date;\n }\n }\n }\n\n if (this_end < this_start) {\n return [this_end, this_start];\n }\n else {\n return [this_start, this_end];\n }\n }\n function makeSort24(this_eventData) {\n let response = `0001-${this_eventData.description}`;\n if ((!this_eventData.hasOwnProperty('time')) || (!this_eventData.time)) {\n return { sort24: response, time$: '' };\n }\n else if (!isObject(this_eventData.time)) {\n return {\n sort24: makeTime(this_eventData.time.split(' to')[0]).string24,\n time$: this_eventData.time\n };\n }\n else {\n return {\n sort24: makeTime(this_eventData.time.from).string24,\n time$: `${this_eventData.time.from}${this_eventData.time.to ? ' - ' + this_eventData.time.to : ''}`\n };\n }\n }\n function makeSlotNames(this_eventData) {\n if ((this_eventData.event_data.type !== 'seats') || !this_eventData.slotPattern || !this_event.slot_object_list) {\n return {};\n }\n else {\n let response = {};\n let lastID = '';\n this_eventData.slotPattern.forEach(sID => {\n let found_slotObj = this_eventData.slot_object_list.find(sO => {\n return (sO.key === sID);\n });\n if (found_slotObj?.value) {\n lastID = found_slotObj.value;\n }\n response[sID] = lastID;\n });\n return response;\n }\n };\n\n}\n\nexport function occurrenceDateBuilder(eventRec, start_date, end_date) {\n let responseArray = [];\n if (!eventRec || !eventRec.eventData || !eventRec.eventData.occPattern) { return []; }\n let occPattern = eventRec.eventData.occPattern;\n switch (occPattern.recurrence) {\n case \"daily\": {\n let from_date = makeDate(start_date).date;\n let to_date = makeDate(end_date).date;\n for (let candidate = from_date; ((candidate < to_date) && (responseArray.length < 10)); candidate = addDays(candidate, 1)) {\n if (occPattern.day_of_week.includes(candidate.getDay())) {\n let nominee = makeDate(candidate);\n if (occPattern['first_date'] && (nominee.numeric < occPattern.first_date)) { continue; }\n if (candidate < from_date) { continue; }\n if (occPattern['last_date'] && (nominee.numeric > occPattern.last_date)) { continue; }\n if (candidate > to_date) { continue; }\n // All good if we get this far\n responseArray.push(nominee.numeric$);\n }\n }\n break;\n }\n case \"bi-weekly\": {\n let from_date = makeDate(start_date).date;\n let to_date = makeDate(end_date).date;\n for (let candidate = from_date; ((candidate < to_date) && (responseArray.length < 10)); candidate = addDays(candidate, 1)) {\n if (occPattern.day_of_week.includes(candidate.getDay())) {\n let nominee = makeDate(candidate);\n if (occPattern['first_date'] && (nominee.numeric < occPattern.first_date)) { continue; }\n if (candidate < from_date) { continue; }\n if (occPattern['last_date'] && (nominee.numeric > occPattern.last_date)) { continue; }\n if (candidate > to_date) { continue; }\n // All good if we get this far\n // Now figure out if this was in the start week or any date an exact multiple of 14 days after the start week\n // candidate.getDay() is a matching day of the week; what is the day of the week for the first date?\n let firstDate = makeDate(occPattern.first_date).date;\n let firstDayOfWeek = firstDate.getDay();\n let candidateDayOfWeek = candidate.getDay();\n let diff = candidateDayOfWeek - firstDayOfWeek;\n let baseDate;\n if (candidateDayOfWeek > firstDayOfWeek) { baseDate = addDays(firstDate, 7 - diff); }\n else { baseDate = addDays(firstDate, diff); }\n if ((daysDiff(candidate, baseDate) % 14) === 0) { responseArray.push(nominee.numeric$); };\n }\n }\n break;\n }\n case \"monthly\": {\n let targetArray = makeArray(occPattern.day_of_month);\n let from_date = makeDate(start_date).date;\n from_date.setDate(1);\n let to_date = makeDate(end_date).date;\n let monthToCheck;\n for (let candidate = from_date; ((candidate < to_date) && (responseArray.length < 10)); candidate.setMonth(monthToCheck + 1)) {\n let yearToCheck = candidate.getFullYear();\n monthToCheck = candidate.getMonth();\n for (let r = 0; ((r < targetArray.length) && (responseArray.length < 10)); r++) {\n if (typeof targetArray[r] === 'number') { // day of the month\n responseArray.push(`${yearToCheck}${(monthToCheck + 101).toString().slice(-2)}${(targetArray[r] + 100).toString().slice(-2)}`);\n }\n else {\n let nominee = makeDate(candidate);\n for (let x = 0; x < 7; x++) {\n if (occPattern.day_of_week.includes(nominee.date.getDay())) {\n switch (targetArray[r]) {\n case \"first\": {\n responseArray.push(nominee.numeric$);\n break;\n }\n case \"second\": {\n responseArray.push(makeDate(addDays(nominee.date, 7)).numeric$);\n break;\n }\n case \"third\": {\n responseArray.push(makeDate(addDays(nominee.date, 14)).numeric$);\n break;\n }\n case \"last\": {\n let possDate = addDays(nominee.date, 28);\n if (possDate.getMonth() === monthToCheck) {\n responseArray.push(makeDate(possDate).numeric$);\n break;\n }\n }\n // eslint-disable-next-line\n case \"fourth\": {\n responseArray.push(makeDate(addDays(nominee.date, 21)).numeric$);\n break;\n }\n default: { }\n } // end switch on occPattern.day_of_month (as targetArray[r]) (\"first Thursday\", \"second Thursday\", etc)\n } // end \"if this date matches a target day of the week (Thursday)\"\n if (responseArray.length >= 10) { break; }\n addDays(nominee.date, 1);\n } // end trying every possible day of the week (Sunday - Saturday)\n } // end else block - occPattern.day_of_month (targetArray[r]) is not a number\n } // end loop through all occPattern.day_of_month entries\n } // end loop from first date to last date\n break;\n } // end monthly case\n case \"semi_annual\": {\n let to_date = makeDate(end_date).date;\n for (let candidate = makeDate(start_date).date; ((candidate < to_date) && (responseArray.length < 10)); addMonths(candidate, 6)) {\n responseArray.push((makeDate(candidate).numeric));\n }\n break;\n } // end semi_annual case\n case \"yearly\": {\n //***************** RAY GO HERE ***************\n let targetArray = [];\n if (typeof occPattern.day_of_year === 'string') { targetArray[0] = Number(occPattern.day_of_year); }\n else if (typeof occPattern.day_of_year === 'number') { targetArray[0] = occPattern.day_of_year; }\n else {\n occPattern.day_of_year.forEach(d => {\n targetArray.push(Number(d));\n });\n targetArray.sort();\n }\n let from_date = makeDate(start_date).date;\n from_date.setMonth(1);\n let to_date = makeDate(end_date).date;\n let yearToCheck;\n for (let candidate = from_date; ((candidate < to_date) && (responseArray.length < 10)); candidate.setFullYear(yearToCheck + 1)) {\n yearToCheck = candidate.getFullYear();\n for (let t = 0; t < targetArray.length; t++) {\n responseArray.push(`${(yearToCheck * 10000) + targetArray[t]}`);\n }\n }\n break;\n }\n default: {\n for (let s = 0; ((s < occPattern.specified.length) && (responseArray.length < 10)); s++) {\n responseArray.push(`${occPattern.specified[s]}`);\n }\n }\n }\n return responseArray;\n}\n\nexport async function addOccurrence(body) {\n // body MUST contain \n // client or client_id \n // event - either an event record(object) OR an event_key(string)\n //\n // addOccurrence assumes a valid occurrence date\n // \n\n let client = (body.client || body.client_id);\n\n if (!body.event || !client) { return false; }\n let eventIn;\n if (typeof body.event === 'object') { eventIn = body.event.event_key; }\n else { eventIn = (body.event_id || body.event); }\n let [event_id, dateFromEvent] = eventIn.split('#');\n let eventRecs = await dbClient\n .get({\n Key: { client: client, event_key: event_id },\n TableName: \"Calendar\"\n })\n .promise()\n .catch(error => {\n cl({ 'Error reading Calendar': error });\n });\n if (!recordExists(eventRecs)) { return false; }\n let eventRec = eventRecs.Item;\n\n let oDate = makeDate(body.occurrence_date || dateFromEvent);\n let occurrence_date = oDate.numeric$;\n if (!occurrence_date) { return false; }\n let putCalendar = {\n client,\n event_id,\n description: eventRec.description,\n location: eventRec.location,\n time: eventRec.time,\n event_key: `${event_id}#${occurrence_date}`,\n occurrence_date,\n record_type: 'occurrence'\n };\n let goodWrite = true;\n await dbClient\n .put({\n Item: putCalendar,\n TableName: \"Calendar\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Calendar; error is:`, error);\n goodWrite = false;\n });\n if (!goodWrite) { return false; }\n\n if (!eventRec.occExists) { eventRec.occExists = [occurrence_date]; }\n else { eventRec.occExists.push(occurrence_date); }\n\n if ((!eventRec.last_written_occurrence)\n || (oDate.numeric > Number(eventRec.last_written_occurrence))) {\n eventRec.last_written_occurrence = occurrence_date;\n }\n\n await dbClient\n .update({\n Key: { client: client, event_key: event_id },\n UpdateExpression: 'set occExists = :a, last_written_occurrence = :b',\n ExpressionAttributeValues: { ':a': eventRec.occExists, ':b': eventRec.last_written_occurrence },\n TableName: \"Calendar\"\n })\n .promise()\n .catch(error => { cl(`caught error updating Calendar; error is: `, error); });\n\n return putCalendar;\n}\n\n/************************************** \n * PUBLISH\n * \n * \n * \n*/\n\n\nexport async function publishCalendar(request) {\n /* \n {\n client_id: state.session.client_id,\n myCalendar: reactData.myCalendar,\n requestor: state.session.user_id,\n filters: {},\n filterTextLower: reactData.filterTextLower,\n startDate: makeDate(response[0]).date,\n endDate: makeDate(response[1]).date,\n proceedWithoutWarning: false\n }\n */\n\n let ava_env = window.location.href.split('//')[1].slice(0, 1).toUpperCase();\n\n // make request dates into dateObj\n request.startDateObj = makeDate(request.startDate);\n request.endDateObj = makeDate(request.endDate);\n\n // recipient object\n let recipients = {};\n\n // response\n let response = {\n dates: {\n from: request.startDateObj.absolute,\n to: request.endDateObj.absolute,\n },\n people_count: 0,\n already_published: 0,\n event_list: [],\n warningsExist: false\n };\n\n let results = {\n eventsFound: 0,\n willPublish: 0,\n alreadyPublished: 0,\n failedFilter: 0\n };\n\n // check for events to publish\n if (!request.proceedWithoutWarning) {\n for (let dX = 0; dX < request.myCalendar.length; dX++) {\n let this_date = request.myCalendar[dX];\n console.log(this_date);\n if (this_date.dateObj.numeric < request.startDateObj.numeric) { continue; }\n if (this_date.dateObj.numeric > request.endDateObj.numeric) { break; }\n // good date, get events\n for (let eX = 0; eX < this_date.eventList.length; eX++) {\n let this_event = this_date.eventList[eX];\n console.log('got event');\n console.log(this_event);\n if (!okToShow(this_event, results)) { continue; }\n response.event_list.push(this_event.event_key);\n }\n }\n if (results.failedFilter > 0) {\n response.warningsExist = true;\n response.results = results;\n return response;\n }\n }\n\n // get a calendar date, check to see if the date is in the range\n for (let dX = 0; dX < request.myCalendar.length; dX++) {\n let this_date = request.myCalendar[dX];\n console.log(this_date);\n if (this_date.dateObj.numeric < request.startDateObj.numeric) { continue; }\n if (this_date.dateObj.numeric > request.endDateObj.numeric) { break; }\n // good date, get events\n for (let eX = 0; eX < this_date.eventList.length; eX++) {\n let this_event = this_date.eventList[eX];\n console.log('got event');\n console.log(this_event);\n if (!okToShow(this_event, results)) { continue; }\n // mark this occurrence as published\n results.willPublish++;\n response.event_list.push(this_event.event_key);\n console.log('OK to publish - updating Calendar');\n await dbClient\n .update({\n Key: {\n client: this_event.client,\n event_key: this_event.event_key\n },\n UpdateExpression: 'set published = :true',\n ExpressionAttributeValues: { ':true': true },\n TableName: \"Calendar\"\n })\n .promise()\n .catch(error => { cl(`caught error updating Calendar; error is: `, error); });\n // we are making one message - each recipient will get the same event info\n let event_message = `${this_event.description} `;\n if (this_event.time) {\n if ((this_event.time.from) && (this_event.time.from.trim() !== '')) {\n if ((this_event.time.to) && (this_event.time.to.trim() !== '')) {\n event_message += `from ${this_event.time.from} to ${this_event.time.to}`;\n }\n else {\n event_message += `at ${this_event.time.from}`;\n }\n }\n }\n Object.values(this_event.slot_owners).forEach(this_slotOwner => {\n if (!recipients.hasOwnProperty(this_slotOwner)) {\n recipients[this_slotOwner] = {\n event_count: 0,\n dates: {}\n };\n }\n if (!recipients[this_slotOwner].dates.hasOwnProperty(this_date.dateObj.numeric$)) {\n recipients[this_slotOwner].dates[this_date.dateObj.numeric$] = {\n dateObj: this_date.dateObj,\n eventList: []\n };\n }\n recipients[this_slotOwner].dates[this_date.dateObj.numeric$].eventList.push(event_message.trim());\n recipients[this_slotOwner].event_count++;\n });\n }\n }\n // we've got the recipient object loaded, send one message to each recipient\n for (const this_recipient in recipients) {\n let messageText = `Hello! `;\n if (recipients[this_recipient].event_count > 1) {\n messageText += `You are scheduled for these upcoming ${request.client.client_name} activities:`;\n for (const this_date in recipients[this_recipient].dates) {\n messageText += `\\n\\rOn ${recipients[this_recipient].dates[this_date].dateObj.absolute_full} -`;\n let eLL = recipients[this_recipient].dates[this_date].eventList.length;\n for (let eX = 0; eX < eLL; eX++) {\n if (eLL > 1) {\n if (eX > 0) {\n if ((eX === 1) && (eLL === 2)) {\n messageText += ' and ';\n }\n else if (eX === (eLL - 1)) {\n messageText += ', and ';\n }\n else {\n messageText += ', ';\n }\n }\n }\n messageText += `${recipients[this_recipient].dates[this_date].eventList[eX]}`;\n }\n }\n }\n else {\n messageText += `${request.client.client_name} has you scheduled for `;\n for (const this_date in recipients[this_recipient].dates) {\n let eLL = recipients[this_recipient].dates[this_date].eventList.length;\n for (let eX = 0; eX < eLL; eX++) {\n messageText += `${recipients[this_recipient].dates[this_date].eventList[eX]}`;\n messageText += ` on ${recipients[this_recipient].dates[this_date].dateObj.absolute_full}`;\n }\n }\n }\n let nowTime = new Date().getTime();\n let messageObj = {\n client: request.client.client_id,\n author: request.requestor,\n messageText: messageText,\n testMode: (ava_env !== 'D'),\n thread_id: `calNotify_${this_recipient}/${nowTime}`,\n recipientList: this_recipient,\n subject: `${request.client.client_name} calendar notification`\n };\n response.people_count++;\n await sendMessages(messageObj);\n }\n response.results = results;\n return response;\n\n function okToShow(this_event, results) {\n results.eventsFound++;\n if (this_event.published) {\n response.already_published++;\n results.alreadyPublished++;\n console.log('rejected - already published');\n if (request.filters && request.filters.filterTextLower && request.filters.filterTextLower.startsWith('unpub')) {\n results.failedFilter++;\n }\n return false;\n }\n if (this_event.date === '29991231') {\n console.log('rejected - soft deleted');\n results.eventsFound--;\n return false;\n } // event was soft-deleted\n if (!request.filters) { \n console.log('accepted - no filters');\n return true;\n }\n else if ((!request.filters.ownerFilter) && (!request.filters.eventFilter) && (!request.filters.filterTextLower)) {\n console.log('accepted - no owner filter, event filter, or text filter ');\n return true;\n }\n else if (request.filters.ownerFilter && (!this_event.slot_owners.hasOwnProperty(request.filters.ownerFilter))) {\n console.log('failed - owner filter but no slot owner is a match');\n results.failedFilter++;\n return false;\n }\n else if (request.filters.eventFilter && (!this_event.event_id === request.filters.eventFilter)) {\n console.log('failed - event filter doesnt match event id ');\n results.failedFilter++;\n return false;\n }\n else if (!request.filters.filterTextLower) {\n console.log('accepted - no other filters to test');\n return true;\n }\n else if (request.filters.filterTextLower.startsWith('publish') || request.filters.filterTextLower.startsWith('unpub')) {\n console.log('accepted - only filters left to test are publish (already dealt with) or unpublished (always true)')\n return true;\n }\n else {\n if ((`${this_event.description} ${this_event.location}`).toLowerCase().includes(request.filters.filterTextLower)) {\n console.log('accepted - text filter was found in description or location');\n return true;\n }\n else {\n results.failedFilter++;\n console.log('failed - text filter was found in neither description nor location');\n return false;\n }\n }\n }\n}","\nimport { getObservationOptions, getObservationItems, makeObservationList } from '../util/AVAObservations';\nimport { getMemberList, prepareTargets } from '../util/AVAGroups';\nimport { recordExists, isObject, resolveVariables, makeArray, dbClient, deepCopy, makeObj } from '../util/AVAUtilities';\n\nlet sessionState;\nlet checkbox = true;\nlet ignore = false;\nlet required = false;\nlet rowTestArray = [];\nlet multiColumn = false;\nlet displayBold = false;\nlet displayStyle = false;\nlet displayItalic = false;\nlet doneWithTopBox = false;\nconst defaultCheckedWords = ['checked', 'on', 'selected', 'true', 'always'];\n\nexport async function getActivityDetail(pActRec, state) {\n sessionState = state;\n if (pActRec.preLoad_code) {\n let preLoaded = await dbClient\n .get({\n Key: {\n client_id: sessionState.session.client_id,\n preLoad_key: pActRec.preLoad_code\n },\n TableName: \"PreLoads\",\n })\n .promise()\n .catch(error => {\n console.log({ 'Bad get on PreLoads - caught error is': error });\n });\n if (recordExists(preLoaded)) {\n return preLoaded.Item.preLoad_data;\n }\n }\n let [global_default_value, global_default_object] = await prepareDefaults(pActRec);\n let resolvedActivity = await makeObservationList(pActRec.activity_rec || pActRec.activity_code, sessionState.session, global_default_object);\n resolvedActivity.activityRec.name = await resolveVariables(pActRec.activity_name, sessionState.session);\n resolvedActivity.activityRec.default_value = global_default_value;\n resolvedActivity.activityRec.default_object = global_default_object;\n return resolvedActivity;\n};\n\nexport async function prepareDefaults(fact) {\n let excludeList = ['reservation', 'play_video'];\n let returnArray = [];\n let returnObject = {};\n if (!fact.default_value) { return [returnArray, returnObject]; }\n if (excludeList.includes(fact.activity_rec?.type) || excludeList.includes(fact.type)) {\n return [fact.default_value, { default: fact.default_value }];\n }\n if (fact.activity_rec?.type === 'make_message') {\n\n }\n\n // check for default values in the person's record\n if (sessionState.patient.hasOwnProperty('defaultValues')) {\n let pDefaults = sessionState.patient.defaultValues;\n for (let key in pDefaults) {\n returnArray.push(`private~${key}=${pDefaults[key]}`);\n }\n }\n // now pull in default values associated with this specific function call\n let defaultValues = {};\n if (isObject(fact.default_value)) {\n defaultValues = Object.assign({}, fact.default_value);\n }\n else {\n // old style is a string of key/value pairs (in the form key=value) separated by \" ~ \"\n let dArray = makeArray(fact.default_value, /\\s*~|~\\s*/g);\n dArray.forEach((d, x) => {\n console.log(d);\n if (isObject(d)) {\n Object.assign(defaultValues, d);\n }\n else if (d.includes('=')) {\n let dO = d.split('=');\n defaultValues[dO[0]] = dO[1];\n }\n else {\n // a value may not be in the form key=value; in this case, just use value\n defaultValues[`_key_${x}`] = d;\n }\n });\n }\n for (let dField in defaultValues) {\n let dValue = await resolveDefaults(fact, dField, defaultValues[dField]);\n // we're returning an array and an object, they are duplicates of one another and consumed as needed by their targets\n // each entry is a default value which could be:\n // a string alone (as in \"myDefault\")\n // a string with some field name (as in \"requestType=myDefault\")\n // an object (as in {requestType: myDefault, peopleList: [person1, person2, ...], ...})\n let rKey;\n let k = dField.match(/_key_(.*)/);\n if (k) { // if no field name was specified\n rKey = `d${k[1]}`;\n }\n else {\n rKey = (dField.split('.')).pop();\n }\n returnObject[rKey] = dValue;\n if (typeof dValue !== 'string') {\n returnArray.push({ [rKey]: dValue });\n }\n else {\n returnArray.push(`${k ? '' : (rKey + '=')}${dValue}`);\n }\n }\n return [returnArray, returnObject];\n}\n\nexport async function resolveDefaults(fact, this_key, this_value) {\n if (typeof (this_value) !== 'string') {\n let workObj = deepCopy(this_value);\n for (let aKey in workObj) {\n workObj[aKey] = await resolveDefaults(fact, aKey, workObj[aKey]);\n }\n workObj = await specialCases(this_key, workObj);\n return workObj;\n }\n let a = this_value.split('.');\n // if there are two or more \".\" in the value, use the value itself \n if (a.length > 2) {\n return this_value;\n }\n let dValue = await resolveVariables(a.pop(), sessionState.session, { ignoreArrayCheck: true });\n // if anything remains in array a (after the pop above), the value was in the form instruction=value\n // we'll act as per that instruction here\n if (a.length > 0) {\n dValue = await specialCases(a[0], dValue);\n }\n return dValue;\n\n async function specialCases(key, dValue) {\n switch (key) {\n case 'people': {\n let factClient;\n if (fact.activity_rec.client_id) { factClient = fact.activity_rec.client_id; }\n else if (fact.activity_code.includes('//')) { factClient = fact.activity_code.split('//')[0]; }\n else { factClient = sessionState.client_id; }\n dValue = await getMemberList(makeArray(dValue, ','), factClient, { sort: true, shortList: true });\n break;\n }\n case 'person': {\n if (dValue === 'patientRec') {\n dValue = sessionState.patient;\n }\n else if (dValue === 'userRec') {\n dValue = sessionState.user;\n }\n else {\n dValue = {\n 'peopleList': [sessionState.patient]\n };\n }\n break;\n }\n case 'select': {\n if (dValue === 'accessList') {\n dValue = {\n 'selectionList': sessionState.accessList[sessionState.session.client_id].shortList\n };\n }\n else if (sessionState.patients) {\n dValue = sessionState.patients;\n }\n else {\n let targetObj = await prepareTargets(sessionState.session.patient_id, sessionState.session.client_id, { includeGroups: true });\n dValue = targetObj.responsibleList.sort();\n }\n break;\n }\n case 'events': {\n if (!sessionState.hasOwnProperty('calendar')) {\n return { loadError: true };\n }\n else {\n dValue = deepCopy(sessionState.calendar);\n }\n break;\n }\n case 'activities': {\n // activities dValue is an object with\n // global_defaults - pass to every column\n // column_list - an array with info about each column to return\n // response entries will be resolved activities (with observation records prepared as per the instructions in the array element)\n // each element is an object with\n // activity_id - optional; if missing use the activity_id that this is a part of\n // column_defaults - add these to the global defaults when resolving and handling the activity\n let responseArray = [];\n let global_defaults = dValue.global_defaults;\n if (!dValue.hasOwnProperty('column_list') || (dValue.column_list.length === 0)) {\n let column_defaults = Object.assign({}, global_defaults);\n let column_object = deepCopy(await makeObservationList(fact.activity_code, sessionState.session, column_defaults));\n column_object.column_defaults = column_defaults;\n responseArray.push(column_object);\n }\n else {\n for (let m = 0; m < dValue.column_list.length; m++) {\n let column_defaults = Object.assign({}, global_defaults, dValue.column_list[m].column_defaults);\n let column_object = deepCopy(await makeObservationList(dValue.column_list[m].activity_id, sessionState.session, column_defaults));\n column_object.column_defaults = column_defaults;\n responseArray.push(column_object);\n }\n }\n dValue = responseArray;\n break;\n }\n default: {\n if (key && (typeof (dValue) === 'string') && (key !== 'default')) {\n dValue = `${key}.${dValue}`;\n }\n }\n }\n return dValue;\n }\n}\n\nexport async function buildDisplayRows(listValues, defaults, qualifiers) {\n let displayRowList = [];\n for (let vIndex = 0; vIndex < listValues.length; vIndex++) {\n // All rows are evaluated as follows \"~:\"\n // OR... \"~~\" (instruction[0] expected to be null/blank in this case)\n let oValueObject = {};\n let t = listValues[vIndex].split(/={|}/);\n if (t.length > 1) {\n oValueObject = makeObj(t[1]);\n listValues[vIndex] = listValues[vIndex].replace(`{${t[1]}}`, '');\n }\n let instruction = listValues[vIndex].split(/[~:]+/);\n // console.log(instruction);\n\n // This checks for rows that contain \"~[=]\"\n let observationDefaultValue = '';\n let last_instruction = instruction[instruction.length - 1];\n if (last_instruction.charAt(0) === '[') {\n let [, oControl, oValue] = last_instruction.split(/[=[\\]]+/);\n switch (oControl) {\n case 'checkbox': { // checkbox default state is true; this allows you to toggle it off/on\n checkbox = (oValue.toLowerCase() === 'on');\n break;\n }\n case 'display_if': \n case 'displayif': \n case 'displayIF': { \n rowTestArray.push({ test: oValue, type: 'display' });\n break;\n }\n case 'ignore_if':\n case 'ignoreif':\n case 'ignoreIF': {\n rowTestArray.push({ test: oValue, type: 'ignore' });\n break;\n }\n case 'end_if':\n case 'endif':\n case 'endIF': {\n rowTestArray.pop();\n break;\n }\n case 'noOp': {\n doneWithTopBox = true;\n break;\n }\n case 'display': {\n ignore = (oValue.toLowerCase() === 'off');\n break;\n }\n case 'multiColumn': {\n multiColumn = (oValue.toLowerCase() === 'off');\n break;\n }\n case 'required': {\n required = (oValue.toLowerCase() === 'on');\n break;\n }\n case 'bold': {\n displayBold = (oValue.toLowerCase() === 'on');\n break;\n }\n case 'style': {\n if (oValue.toLowerCase() === 'off') {\n displayStyle = false;\n }\n else if (oValue === '') {\n displayStyle = oValueObject;\n }\n else {\n displayStyle = oValue;\n }\n break;\n }\n case 'italics':\n case 'italic': {\n displayItalic = (oValue.toLowerCase() === 'on');\n break;\n }\n case 'default': {\n observationDefaultValue = oValue;\n break;\n }\n default: { }\n }\n instruction.pop();\n if ((instruction.length === 0) || ((instruction.length === 1) && !instruction[0])) { continue; }\n }\n\n if (ignore) { continue; }\n\n if ((vIndex !== 0) && (checkbox || (!instruction[0] && !instruction[2]))) {\n // this is either a checkbox or a header\n doneWithTopBox = true;\n }\n\n // This handles any row without a leading \"~\"\n // These are checkboxes UNLESS a previous [checkbox=off] instruction is still in effect\n if (instruction[0]) {\n let docRows;\n let rObj = {\n checkbox,\n isChecked: false,\n noUpdate: false,\n required,\n rowTest: deepCopy(rowTestArray),\n multiColumn,\n text: instruction[0],\n observationKey: getKey(instruction[0]),\n desc: getQualifier(instruction[0], 'description'),\n fee: getQualifier(instruction[0], 'fee'),\n input: false,\n bold: displayBold,\n style: displayStyle,\n italic: displayItalic\n };\n if (vIndex !== 0 && !doneWithTopBox) {\n }\n else {\n // default the checkbox to checked if either:\n // a previous instruction set the default for all checkboxes to ON (~[default=checked]), OR\n // a passed in default for this item instructs AVA to set the checkbox ON\n if ((defaults.hasOwnProperty(instruction[0]) && defaultCheckedWords.includes(defaults[instruction[0]])) // this item is checked off by default\n || (defaultCheckedWords.includes(observationDefaultValue))) { // this item is checked off because this instruction had a modifier such as [default=checked]\n // [rObj.qualSelections, rObj.qualData, docRows] = await buildQualifiers(rObj.observationKey); // see if there any any qualifiers for this item\n let qualResponse = await buildQualifiers(rObj.observationKey); // see if there any any qualifiers for this item\n rObj.qualSelections = deepCopy(qualResponse.selections);\n rObj.qualData = deepCopy(qualResponse.data);\n rObj.moreInfo = deepCopy(qualResponse.moreInfo);\n rObj.isChecked = true;\n if (qualResponse.docLines) {\n docRows = deepCopy(qualResponse.docLines)\n }\n else {\n if ((defaults.hasOwnProperty(instruction[0]) && (defaults[instruction[0]] === 'always')) // this item is checked off by default\n || (observationDefaultValue === 'always')) { \n rObj.noUpdate = true;\n }\n }\n }\n }\n displayRowList.push(rObj);\n if (docRows) {\n displayRowList.push({\n checkbox: false,\n isChecked: false,\n required: false,\n rowTest: deepCopy(rowTestArray),\n multiColumn,\n text: docRows,\n observationKey: null,\n desc: null,\n input: 'docLines',\n bold: false,\n style: false,\n italic: false\n });\n }\n continue;\n }\n\n // Dropping through to here means that instruction[0] was null/blank\n // (ie. there was nothing before the first \"~\"; the row started with \"~\")\n // This handles rows in the form \"~:[row_qualifier]\", for example\n // \"~lambda:\" or \n // \"~prompt:Notes for the server\"\n // \"~other:Notes for the server\"\n // \"~promptAll:Table Number\"\n // \"~obo:Request is for whom?\"\n // \"~signature:Sign here\"\n // \"~date:What date[noFuture]\"\n if (instruction[2]) {\n let splitInstruction = instruction[2].split('[');\n let this_instruction = splitInstruction[0].trim();\n let this_qualifier;\n if (splitInstruction.length > 1) {\n this_qualifier = splitInstruction[1].replace(']', '');\n }\n let rObj = {\n checkbox: false,\n required,\n rowTest: deepCopy(rowTestArray),\n multiColumn: false,\n text: this_instruction,\n textValue: defaults[this_instruction],\n obo_line: ((defaults.obo || defaults.onBehalfOf) === this_instruction),\n location_line: (defaults[this_instruction] && (defaults[this_instruction] === '[person.location]')),\n observationKey: instruction[3] || getKey(this_instruction),\n desc: getQualifier(this_instruction, 'description'),\n fee: getQualifier(this_instruction, 'fee'),\n input: instruction[1].trim().toLowerCase(),\n header: false,\n row_qualifier: this_qualifier\n };\n if (instruction[1].trim().toLowerCase() === 'signature') {\n rObj.isChecked = true;\n rObj.required = true;\n }\n displayRowList.push(rObj);\n if (observationDefaultValue) {\n defaults[this_instruction] = observationDefaultValue;\n }\n continue;\n }\n\n // Dropping through to here means that instruction[2] was also null/blank\n // so the row looked like \"~\" or \"~~\"\n // Turns out, this is a header line in instruction[1]\n displayRowList.push({\n checkbox: false,\n required: false,\n rowTest: deepCopy(rowTestArray),\n multiColumn: false,\n text: instruction[1],\n observationKey: getKey(instruction[1]),\n desc: getQualifier(instruction[1], 'description'),\n fee: getQualifier(instruction[1], 'fee'),\n input: false,\n header: true\n });\n if (observationDefaultValue) {\n defaults[instruction[1]] = observationDefaultValue;\n }\n };\n return displayRowList;\n\n function getKey(pText) {\n if (qualifiers.hasOwnProperty(pText) && qualifiers[pText].qualifiers) {\n let qKey = qualifiers[pText].qualifiers.find(q => { return (q.startsWith('~~key=')); });\n if (qKey) { return qKey.substr(6); }\n }\n return null;\n }\n\n function getQualifier(pText, pQual) {\n if (qualifiers.hasOwnProperty(pText)) {\n return qualifiers[pText][pQual];\n }\n else {\n return null;\n }\n }\n}\n\nlet rememberedQualifiers = {};\nexport async function buildQualifiers(qKey) {\n if (!qKey) {\n return [{}, {}];\n }\n if (!rememberedQualifiers[qKey]) {\n rememberedQualifiers[qKey] = {\n selections: {},\n data: {},\n moreInfo: {}\n };\n let docLineList = [];\n let oItem = await getObservationItems(qKey);\n if (oItem) {\n for (let prop in oItem) {\n if (prop === 'options') {\n rememberedQualifiers[qKey].data = await getObservationOptions(oItem.options.observation_key);\n oItem.options.display_value.forEach(v => {\n if (v.default) {\n rememberedQualifiers[qKey].selections[v.title] = {};\n makeArray(v.default).forEach(dVal => {\n rememberedQualifiers[qKey].selections[v.title][dVal] = true;\n });\n }\n });\n }\n else if (prop.startsWith('doc_line')) {\n docLineList[Number(prop.split(':')[1])] = oItem[prop].display_value;\n }\n else if (prop !== 'observation_name') {\n if (oItem[prop].display_value) {\n rememberedQualifiers[qKey].moreInfo[prop] = oItem[prop].display_value;\n }\n else if (oItem[prop].value) {\n rememberedQualifiers[qKey].moreInfo[prop] = `${oItem[prop].value}${oItem[prop].uom || ''}`;\n }\n else {\n rememberedQualifiers[qKey].moreInfo[prop] = ' ';\n }\n }\n }\n }\n rememberedQualifiers[qKey].docLines = docLineList.join('');\n }\n // return [rememberedQualifiers[qKey].selections, rememberedQualifiers[qKey].data, rememberedQualifiers[qKey].docLines];\n return rememberedQualifiers[qKey];\n}","import makeStyles from '@material-ui/core/styles/makeStyles';\nlet remembered = {};\n\nexport const AVAclasses = makeStyles(theme => ({\n AVAAvatar: {\n marginTop: 0,\n marginBottom: 0,\n minHeight: '60px',\n minWidth: '60px',\n maxHeight: '60px',\n maxWidth: '60px',\n paddingTop: 0,\n fontSize: '1.3rem'\n },\n roundedCorners: {\n borderRadius: '30px 30px 30px 30px',\n },\n AVAButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n paddingLeft: '16px',\n paddingRight: '16px',\n borderRadius: '16px',\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n AVAButton_noBorder: {\n borderRadius: '16px',\n variant: 'outlined',\n border: '0px',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n AVAMicroButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginTop: theme.spacing(0),\n marginBottom: theme.spacing(0),\n borderRadius: '16px',\n paddingLeft: '16px',\n paddingRight: '16px',\n variant: 'outlined',\n textTransform: 'none',\n textDecoration: 'none',\n border: '0.75px solid gray',\n size: 'small',\n fontSize: theme.typography.fontSize * 0.8\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n AVATitle: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: theme.typography.fontSize * 1.25,\n fontWeight: 'bold'\n },\n AVABigBoldTitle: {\n fontSize: theme.typography.fontSize * 1.8,\n marginY: 10,\n marginX: 0,\n paddingX: 0,\n fontWeight: 'bold'\n },\n AVABox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n AVABoxCentered: {\n display: 'flex',\n flexDirection: 'row',\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n justifyContent: 'center'\n },\n AVASmallText: {\n fontSize: theme.typography.fontSize * 0.8,\n minWidth: '100%',\n marginY: 10,\n marginX: 0,\n paddingX: 0,\n },\n AVABigBoldText: {\n fontSize: theme.typography.fontSize * 1.8,\n minWidth: '100%',\n marginY: 10,\n marginX: 0,\n paddingX: 0,\n },\n AVALargeText: {\n fontSize: theme.typography.fontSize * 1.25,\n minWidth: '100%',\n marginY: 10,\n marginX: 0,\n paddingX: 0,\n },\n AVAProgressBar: {\n marginBottom: theme.spacing(3),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px'\n },\n AVAClientBackground: {\n backgroundColor: AVADefaults({ client_style: 'get' }) ? AVADefaults({ client_style: 'get' }).backgroundColor : null,\n borderRadius: '30px',\n padding: 5\n },\n AVAPromptBackground: {\n backgroundColor: AVADefaults({ client_style: 'get' }) ? AVADefaults({ client_style: 'get' }).promptBackgroundColor : null,\n borderRadius: '30px',\n padding: 5\n }\n}));\n\nexport const AVADefaults = (options = {}) => {\n let returnObj = {};\n for (let key in options) {\n if (options[key] === 'get') {\n returnObj[key] = remembered[key];\n }\n else if (options[key] === 'getURL') {\n returnObj[key] = new URL(remembered[key]);\n }\n else {\n remembered[key] = options[key];\n }\n }\n let oKey = Object.keys(returnObj);\n switch (oKey.length) {\n case 0: { return null; }\n case 1: { return returnObj[oKey[0]]; }\n default: { return returnObj; }\n }\n};\n\nexport function AVATextStyle(options = {}) {\n let user_fontSize = AVADefaults({ fontSize: 'get' }) || 1.5;\n let returnStyle = {\n fontSize: `${user_fontSize * (options.size || 1)}rem`,\n lineHeight: 1.2,\n overflow: (options.overflow || 'hidden'),\n };\n Object.keys(options).forEach(optionKey => {\n switch (optionKey) {\n case \"bold\": {\n if (options.bold) {\n returnStyle.fontWeight = 'bold';\n }\n break;\n }\n case \"italic\": {\n if (options.italic) {\n returnStyle.fontStyle = 'italic';\n }\n break;\n }\n case \"weight\": {\n returnStyle.fontWeight = options.weight;\n break;\n }\n case \"wrap\": {\n returnStyle.textWrap = options.wrap;\n break;\n }\n case \"color\": {\n returnStyle.color = options.color;\n break;\n }\n case \"margin\": {\n if (Array.isArray(options.margin)) {\n if (options[0]) { returnStyle.marginLeft = options[0] * 16; }\n if (options[1]) { returnStyle.marginRight = options[1] * 16; }\n if (options[2]) { returnStyle.marginTop = options[2] * 16; }\n if (options[3]) { returnStyle.marginBottom = (options[3] * 16) - (2 * user_fontSize * (options.size || 1)); }\n }\n else {\n if (options.margin.hasOwnProperty('right')) { returnStyle.marginRight = options.margin.right * 16; }\n if (options.margin.hasOwnProperty('left')) { returnStyle.marginLeft = options.margin.left * 16; }\n if (options.margin.hasOwnProperty('top')) { returnStyle.marginTop = options.margin.top * 16; }\n if (options.margin.hasOwnProperty('bottom')) { returnStyle.marginBottom = (options.margin.bottom * 16) - (2 * user_fontSize * (options.size || 1)); }\n }\n break;\n }\n case \"marginTop\":\n case \"paddingTop\": {\n returnStyle.marginTop = options[optionKey] * 16;\n break;\n }\n case \"paddingBottom\":\n case \"marginBottom\": {\n returnStyle.marginBottom = (options.marginBottom * 16) - (2 * user_fontSize * (options.size || 1));;\n break;\n }\n case \"paddingLeft\":\n case \"marginLeft\": {\n returnStyle.marginLeft = options[optionKey] * 16;\n break;\n }\n case \"paddingRight\":\n case \"marginRight\": {\n returnStyle.marginRight = options[optionKey] * 16;\n break;\n }\n case \"padding\": {\n if (Array.isArray(options.padding)) {\n if (options[0]) { returnStyle.paddingLeft = options[0] * 16; }\n if (options[1]) { returnStyle.paddingRight = options[1] * 16; }\n if (options[2]) { returnStyle.paddingTop = options[2] * 16; }\n if (options[3]) { returnStyle.paddingBottom = (options[3] * 16); }\n }\n else {\n if (options.padding.hasOwnProperty('right')) { returnStyle.paddingRight = options.padding.right * 16; }\n if (options.padding.hasOwnProperty('left')) { returnStyle.paddingLeft = options.padding.left * 16; }\n if (options.padding.hasOwnProperty('top')) { returnStyle.paddingTop = options.padding.top * 16; }\n if (options.padding.hasOwnProperty('bottom')) { returnStyle.paddingBottom = `${(options.padding.bottom * 16)}px`; }\n }\n break;\n }\n case \"align\": {\n returnStyle.textAlign = options.align;\n break;\n }\n default: {\n returnStyle[optionKey] = options[optionKey];\n }\n }\n });\n return returnStyle;\n}\n\nexport function AVATextVariableStyle(outText, options = {}) {\n let returnStyle = AVATextStyle(options);\n let user_fontSize = AVADefaults({ fontSize: 'get' }) * (options.size || 1);\n returnStyle.fontSize = `${user_fontSize * (50 / Math.max(50, (outText ? outText.length : 1) * user_fontSize * (600 / window.innerWidth)))}rem`;\n return returnStyle;\n}\n\nexport function hexToRgb(hex, opacity = 1) {\n var c;\n if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {\n c = hex.substring(1).split('');\n if (c.length === 3) {\n c = [c[0], c[0], c[1], c[1], c[2], c[2]];\n }\n c = '0x' + c.join('');\n return `rgba(${[(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',')},${opacity})`;\n }\n throw new Error('Bad Hex');\n}\n\nexport function make_rgba(r, g, b, o) {\n // r, g, b, o intensity each from 0 -> 1 (o is opacity)\n const template = '0123456789abcdeff';\n let r256 = (r * 256);\n let r_hex = `${template.charAt(Math.floor(r256 / 16))}${template.charAt((r256 + .0001) % 16)}`\n let g256 = (g * 256);\n let g_hex = `${template.charAt(Math.floor(g256 / 16))}${template.charAt((g256 + .0001) % 16)}`\n let b256 = (b * 256);\n let b_hex = `${template.charAt(Math.floor(b256 / 16))}${template.charAt((b256 + .0001) % 16)}`\n let c = `0x${r_hex}${g_hex}${b_hex}`;\n let response = `rgba(${[(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',')},${o})`;\n return response;\n}\n\nexport function rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n\n var max = Math.max(r, g, b), min = Math.min(r, g, b);\n var h, s, l = (max + min) / 2;\n\n if (max === min) {\n h = 0;\n s = 0; // achromatic\n } else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n default: { }\n }\n h /= 6;\n }\n\n return [h, s, l];\n}\n\nexport function hslToRgb(h, s, l) {\n var r, g, b;\n if (s === 0) {\n r = l;\n g = l;\n b = l; // achromatic\n } else {\n function hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n }\n\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n\n return [r * 255, g * 255, b * 255];\n}\n\nexport function contrastColor(hex, opacity = 1) {\n let rgb = hexToRgb(hex, opacity);\n let parts = rgb.match(/(.*\\()(.*?)(\\))/);\n var str = parts[2].split(',');\n let [h, s, l] = rgbToHsl(str[0], str[1], str[2]);\n l = 1 - l;\n let [r, g, b] = hslToRgb(h, s, l);\n return \"#\" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);\n}\n\nexport function isDark(hex) { // report if this hex color is dark (to correct overlaid content when necessary)\n var h = hex.substring(1); // strip #\n var rgb = parseInt(h, 16); // convert rrggbb to decimal\n var r = (rgb >> 16) & 0xff; // extract red\n var g = (rgb >> 8) & 0xff; // extract green\n var b = (rgb >> 0) & 0xff; // extract blue\n\n var luma = 0.2126 * r + 0.7152 * g + 0.0722 * b; // per ITU-R BT.709\n return (luma < 126);\n}\n\nexport const hexColors = {\n \"aliceblue\": \"#f0f8ff\",\n \"antiquewhite\": \"#faebd7\",\n \"aqua\": \"#00ffff\",\n \"aquamarine\": \"#7fffd4\",\n \"azure\": \"#f0ffff\",\n \"beige\": \"#f5f5dc\",\n \"bisque\": \"#ffe4c4\",\n \"black\": \"#000000\",\n \"blanchedalmond\": \"#ffebcd\",\n \"blue\": \"#0000ff\",\n \"blueviolet\": \"#8a2be2\",\n \"brown\": \"#a52a2a\",\n \"burlywood\": \"#deb887\",\n \"cadetblue\": \"#5f9ea0\",\n \"chartreuse\": \"#7fff00\",\n \"chocolate\": \"#d2691e\",\n \"coral\": \"#ff7f50\",\n \"cornflowerblue\": \"#6495ed\",\n \"cornsilk\": \"#fff8dc\",\n \"crimson\": \"#dc143c\",\n \"cyan\": \"#00ffff\",\n \"darkblue\": \"#00008b\",\n \"darkcyan\": \"#008b8b\",\n \"darkgoldenrod\": \"#b8860b\",\n \"darkgray\": \"#a9a9a9\",\n \"darkgreen\": \"#006400\",\n \"darkkhaki\": \"#bdb76b\",\n \"darkmagenta\": \"#8b008b\",\n \"darkolivegreen\": \"#556b2f\",\n \"darkorange\": \"#ff8c00\",\n \"darkorchid\": \"#9932cc\",\n \"darkred\": \"#8b0000\",\n \"darksalmon\": \"#e9967a\",\n \"darkseagreen\": \"#8fbc8f\",\n \"darkslateblue\": \"#483d8b\",\n \"darkslategray\": \"#2f4f4f\",\n \"darkturquoise\": \"#00ced1\",\n \"darkviolet\": \"#9400d3\",\n \"deeppink\": \"#ff1493\",\n \"deepskyblue\": \"#00bfff\",\n \"dimgray\": \"#696969\",\n \"dodgerblue\": \"#1e90ff\",\n \"firebrick\": \"#b22222\",\n \"floralwhite\": \"#fffaf0\",\n \"forestgreen\": \"#228b22\",\n \"fuchsia\": \"#ff00ff\",\n \"gainsboro\": \"#dcdcdc\",\n \"ghostwhite\": \"#f8f8ff\",\n \"gold\": \"#ffd700\",\n \"goldenrod\": \"#daa520\",\n \"gray\": \"#808080\",\n \"green\": \"#008000\",\n \"greenyellow\": \"#adff2f\",\n \"honeydew\": \"#f0fff0\",\n \"hotpink\": \"#ff69b4\",\n \"indianred \": \"#cd5c5c\",\n \"indigo\": \"#4b0082\",\n \"ivory\": \"#fffff0\",\n \"khaki\": \"#f0e68c\",\n \"lavender\": \"#e6e6fa\",\n \"lavenderblush\": \"#fff0f5\",\n \"lawngreen\": \"#7cfc00\",\n \"lemonchiffon\": \"#fffacd\",\n \"lightblue\": \"#add8e6\",\n \"lightcoral\": \"#f08080\",\n \"lightcyan\": \"#e0ffff\",\n \"lightgoldenrodyellow\": \"#fafad2\",\n \"lightgrey\": \"#d3d3d3\",\n \"lightgreen\": \"#90ee90\",\n \"lightpink\": \"#ffb6c1\",\n \"lightsalmon\": \"#ffa07a\",\n \"lightseagreen\": \"#20b2aa\",\n \"lightskyblue\": \"#87cefa\",\n \"lightslategray\": \"#778899\",\n \"lightsteelblue\": \"#b0c4de\",\n \"lightyellow\": \"#ffffe0\",\n \"lime\": \"#00ff00\",\n \"limegreen\": \"#32cd32\",\n \"linen\": \"#faf0e6\",\n \"magenta\": \"#ff00ff\",\n \"maroon\": \"#800000\",\n \"mediumaquamarine\": \"#66cdaa\",\n \"mediumblue\": \"#0000cd\",\n \"mediumorchid\": \"#ba55d3\",\n \"mediumpurple\": \"#9370d8\",\n \"mediumseagreen\": \"#3cb371\",\n \"mediumslateblue\": \"#7b68ee\",\n \"mediumspringgreen\": \"#00fa9a\",\n \"mediumturquoise\": \"#48d1cc\",\n \"mediumvioletred\": \"#c71585\",\n \"midnightblue\": \"#191970\",\n \"mintcream\": \"#f5fffa\",\n \"mistyrose\": \"#ffe4e1\",\n \"moccasin\": \"#ffe4b5\",\n \"navajowhite\": \"#ffdead\",\n \"navy\": \"#000080\",\n \"oldlace\": \"#fdf5e6\",\n \"olive\": \"#808000\",\n \"olivedrab\": \"#6b8e23\",\n \"orange\": \"#ffa500\",\n \"orangered\": \"#ff4500\",\n \"orchid\": \"#da70d6\",\n \"palegoldenrod\": \"#eee8aa\",\n \"palegreen\": \"#98fb98\",\n \"paleturquoise\": \"#afeeee\",\n \"palevioletred\": \"#d87093\",\n \"papayawhip\": \"#ffefd5\",\n \"peachpuff\": \"#ffdab9\",\n \"peru\": \"#cd853f\",\n \"pink\": \"#ffc0cb\",\n \"plum\": \"#dda0dd\",\n \"powderblue\": \"#b0e0e6\",\n \"purple\": \"#800080\",\n \"rebeccapurple\": \"#663399\",\n \"red\": \"#ff0000\",\n \"rosybrown\": \"#bc8f8f\",\n \"royalblue\": \"#4169e1\",\n \"saddlebrown\": \"#8b4513\",\n \"salmon\": \"#fa8072\",\n \"sandybrown\": \"#f4a460\",\n \"seagreen\": \"#2e8b57\",\n \"seashell\": \"#fff5ee\",\n \"sienna\": \"#a0522d\",\n \"silver\": \"#c0c0c0\",\n \"skyblue\": \"#87ceeb\",\n \"slateblue\": \"#6a5acd\",\n \"slategray\": \"#708090\",\n \"snow\": \"#fffafa\",\n \"springgreen\": \"#00ff7f\",\n \"steelblue\": \"#4682b4\",\n \"tan\": \"#d2b48c\",\n \"teal\": \"#008080\",\n \"thistle\": \"#d8bfd8\",\n \"tomato\": \"#ff6347\",\n \"turquoise\": \"#40e0d0\",\n \"violet\": \"#ee82ee\",\n \"wheat\": \"#f5deb3\",\n \"white\": \"#ffffff\",\n \"whitesmoke\": \"#f5f5f5\",\n \"yellow\": \"#ffff00\",\n \"yellowgreen\": \"#9acd32\"\n};","import React from 'react';\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport ListItem from '@material-ui/core/ListItem';\nimport Slide from '@material-ui/core/Slide';\n\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Button from '@material-ui/core/Button';\nimport CloseIcon from '@material-ui/icons/Close';\n\nimport TextField from '@material-ui/core/TextField';\n\nimport Paper from '@material-ui/core/Paper';\nimport { switchActiveAccount, cl, array_in_array } from '../../util/AVAUtilities';\nimport { getImage } from '../../util/AVAPeople';\n\nimport useSession from '../../hooks/useSession';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport Typography from '@material-ui/core/Typography';\n\nimport { AVAclasses } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n formControl: {\n margin: 0,\n paddingTop: 0,\n },\n AVAButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n clientPopUp: {\n borderRadius: '30px 30px 30px 30px',\n },\n freeInput: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: 0,\n width: '90%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n minHeight: theme.typography.fontSize * 1.8,\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n firstName: {\n marginLeft: theme.spacing(1),\n },\n lastName: {\n fontWeight: 'bold',\n },\n groupName: {\n fontWeight: 'bold',\n color: 'red'\n },\n orSeparator: {\n marginTop: theme.spacing(1),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(2),\n fontSize: theme.typography.fontSize * 0.8,\n },\n idText: {\n paddingTop: 6,\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(1)\n },\n}));\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ open, roles, onClose }) => {\n\n const { state } = useSession();\n const { accessList } = state;\n\n const [person_filter, setPersonFilter] = React.useState('');\n const [client_filter, setClientFilter] = React.useState('');\n const [forceRedisplay, setForceRedisplay] = React.useState(true);\n const [rowLimit, setRowLimit] = React.useState(20);\n\n let tally = 0;\n let onlyClient;\n Object.keys(accessList).forEach(k => {\n if (okClient({ candidate_id: k, candidate_name: k.name })) {\n tally++;\n onlyClient = k;\n }\n });\n // if (tally === 0) {\n // onClose();\n // }\n const multiClient = (tally > 1);\n const [selectedClient, setSelectedClient] = React.useState((tally === 1) ? onlyClient : '*none');\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const handleClose = () => {\n onClose();\n };\n\n const subMenuHead = React.useRef(null);\n\n const scrollValue = 20;\n var rowsWritten;\n let filterTimeOut;\n\n const onScroll = event => {\n let newLimit = rowLimit + scrollValue;\n setRowLimit(newLimit);\n };\n\n const handleChangePersonFilter = vCheck => {\n clearTimeout(filterTimeOut);\n cl(`set timeout with ${vCheck} at ${new Date().getTime()}`);\n filterTimeOut = setTimeout(() => {\n cl(`timeout ended ${vCheck} at ${new Date().getTime()}`);\n if (!vCheck) {\n setPersonFilter(null);\n setClientFilter(null);\n }\n else {\n let filterInput = vCheck.trim();\n if (selectedClient !== '*none') { setPersonFilter(filterInput.toLowerCase()); }\n else { setClientFilter(filterInput.toLowerCase()); }\n }\n setForceRedisplay(!forceRedisplay);\n }, 500);\n return;\n };\n\n async function onSelect(newClient, newPatient) {\n await switchActiveAccount(state.session, newClient, newPatient);\n onClose();\n };\n\n function okToShow(pLine) {\n if (!pLine) { return false; }\n if (pLine.access === 'none') { return false; }\n if (pLine.access === 'view') { return false; }\n if (array_in_array(state?.session?.group_assignments?.inactive, pLine.groups)) { return false; }\n if (!person_filter) { return true; }\n return Object.values(pLine).toString().toLowerCase().includes(person_filter);\n };\n\n function okClient(cLine) {\n if (!cLine) { return false; }\n // if you are not authorized to access this client, reject it\n if (!accessList[cLine.candidate_id].hasOwnProperty('list') || (accessList[cLine.candidate_id].list.length === 0)) {\n return false;\n }\n // you ARE autohirzed to this client; is it filtered out?\n if (!client_filter) { return true; }\n return Object.values(cLine).toString().toLowerCase().includes(client_filter);\n };\n\n React.useEffect(() => {\n if (subMenuHead && subMenuHead.current) {\n subMenuHead.current.scrollIntoView({\n behavior: 'instant',\n block: 'start',\n });\n }\n }, [selectedClient]);\n\n return (\n accessList &&\n \n \n {`Switch to which ${(selectedClient === '*none') ? 'client' : 'account'}?`}\n \n (handleChangePersonFilter(event.target.value))}\n className={classes.freeInput}\n autoComplete='off'\n variant=\"standard\"\n />\n \n {`You may filter the list below`}\n \n \n {(selectedClient === '*none') &&\n \n {Object.keys(accessList).map((client, c) => (\n okClient({ candidate_id: client, candidate_name: accessList[client].name }) &&\n {\n setSelectedClient(client);\n setRowLimit(scrollValue);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n \n \n {accessList[client].name}\n \n \n ))}\n \n }\n {(selectedClient !== '*none') &&\n \n \n {rowsWritten = 0}\n \n {accessList[selectedClient].list.map((listEntry, x) => (\n ((rowsWritten <= rowLimit) && okToShow(listEntry) &&\n {\n await onSelect(selectedClient, listEntry);\n }}\n button\n ref={(rowsWritten === 0) ? subMenuHead : null}\n >\n \n \n {rowsWritten++}\n \n \n \n {listEntry.last}\n {listEntry.first}\n {(x > 0) && (x < (accessList[selectedClient].list.length - 1)) &&\n ((accessList[selectedClient].list[x - 1].first === listEntry.first)\n || (accessList[selectedClient].list[x + 1].first === listEntry.first)) &&\n ((accessList[selectedClient].list[x - 1].last === listEntry.last)\n || (accessList[selectedClient].list[x + 1].last === listEntry.last)) &&\n ({listEntry.id})\n }\n \n \n \n )))}\n {(rowsWritten === 0) &&\n \n {'No selections available'}\n \n }\n \n }\n \n \n {\n if ((selectedClient === '*none') || (!multiClient)) {\n onClose();\n }\n else {\n setSelectedClient('*none');\n setForceRedisplay(!forceRedisplay);\n }\n }}\n startIcon={}\n >\n {((selectedClient === '*none') || (!multiClient)) ? 'Exit' : 'Back'}\n \n \n \n );\n};\n","/* eslint-disable */\n// this is an auto generated file. This will be overwritten\n\nexport const createPutFact = /* GraphQL */ `\n mutation CreatePutFact($input: CreatePutFactInput!) {\n createPutFact(input: $input) {\n person_id\n activity_key\n value\n qualifier\n status\n user_id\n session_id\n method\n posted_time\n }\n }\n`;\nexport const updateSession = /* GraphQL */ `\n mutation UpdateSession($input: UpdateSessionInput!) {\n updateSession(input: $input) {\n session_id\n client_id\n device_id\n method\n status\n user_display_name\n user_id\n patient_display_name\n patient_id\n assigned_to\n responsible_for\n current_event\n password_change_date\n platform\n url_parameters\n description\n event_description\n kiosk_mode\n kiosk_activity\n groups_managed\n }\n }\n`;\n\nexport const updateReservation = /* GraphQL */ `\n mutation UpdateReservation($input: UpdateReservationInput!) {\n updateReservation(input: $input) {\n client_id\n\t event_code\n\t available_to\n\t event_name\n\t expires_after\n\t owner\n\t show_slots\n version\n\t slot {\n display_name\n identifier\n type\n owner\n }\n }\n }\n`;\n","import React from 'react';\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\n\nexport default ({ title, outlined, children }) => (\n \n \n \n {title}\n \n \n \n {children}\n \n \n);\n","import React from 'react';\nimport { makeArray, sentenceCase } from '../../util/AVAUtilities';\nimport { determineClass } from '../../util/AVAGroups';\nimport Box from '@material-ui/core/Box';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport useSession from '../../hooks/useSession';\n\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Typography from '@material-ui/core/Typography';\n\nimport List from '@material-ui/core/List';\nimport { useSnackbar } from 'notistack';\n\nimport Section from '../Section';\n\nconst useStyles = makeStyles(theme => ({\n container: {\n maxHeight: 400,\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n HeadText: {\n fontSize: theme.typography.fontSize * 1.2,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n InstructionText: {\n fontSize: theme.typography.fontSize * 1.0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n radioTextWIthTopSpacing: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n marginTop: 10,\n paddingLeft: 0,\n paddingRight: 10,\n },\n HeadTextWIthTopSpacing: {\n fontSize: theme.typography.fontSize * 1.2,\n marginLeft: 0,\n marginTop: 10,\n paddingLeft: 0,\n paddingRight: 10,\n },\n radioButton: {\n marginTop: 0,\n marginRight: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 1,\n },\n}));\n\nexport default ({ person, groupData, multiple = false, updateGroups }) => {\n\n const classes = useStyles();\n const { state } = useSession();\n\n const [reactData, setReactData] = React.useState({\n ...Object.assign({}, groupData),\n adminGroupList: groupData.adminHierarchy.map(this_group => {\n if (this_group.selectable) {\n return this_group.id;\n }\n else {\n return null;\n }\n }),\n fullGroupList: [],\n accountClass: person.account_class || null\n });\n\n const { enqueueSnackbar } = useSnackbar();\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) {\n setForceRedisplay(!forceRedisplay);\n }\n };\n\n if ((reactData.fullGroupList.length === 0) && (person.groups.length > 0)) {\n updateGroupList(person.groups);\n }\n function updateGroupList(groupList) {\n let myAdminGroups = [];\n let myOtherGroups = [];\n groupList.forEach(this_group => {\n if (reactData.adminGroupList.includes(this_group)) {\n myAdminGroups.push(this_group);\n }\n else if (reactData.publicGroups.hasOwnProperty(this_group)) {\n if (!reactData.publicGroups[this_group].role.startsWith('non')) {\n myOtherGroups.push(this_group);\n }\n }\n else if (reactData.privateGroups.hasOwnProperty(this_group)) {\n if (!reactData.privateGroups[this_group].role.startsWith('non')) {\n myOtherGroups.push(this_group);\n }\n }\n });\n // now add parents of the adminGroups\n let myRollUpGroups = [];\n let groupsToCheck = [...myAdminGroups];\n do {\n let this_group = groupsToCheck.shift();\n reactData.adminHierarchy.some(gObj => {\n if (gObj.id === this_group) {\n if ((gObj.belongs_to) && !myRollUpGroups.includes(gObj.belongs_to)) {\n myRollUpGroups.push(gObj.belongs_to);\n groupsToCheck.push(gObj.belongs_to);\n }\n return true;\n }\n return false;\n });\n } while (groupsToCheck.length > 0);\n let response = [...myAdminGroups, ...myOtherGroups, ...myRollUpGroups];\n if (response.length === 0) {\n response = makeArray(state.session?.group_assignments?.inactive || 'ianctive') \n }\n updateReactData({\n fullGroupList: response,\n accountClass: ((!['master', 'support'].includes(person.account_class)) ? determineClass(response) : person.account_class)\n });\n if ((person.groups.length !== response.length)\n || !((response.every(this_response => {\n return person.groups.includes(this_response);\n })) && ((person.groups.every(this_response => {\n return response.includes(this_response);\n }))))) {\n updateGroups(response);\n }\n return response;\n }\n\n return (\n (forceRedisplay || true) &&\n
    \n {`Administrative Groups`}\n {`Choose ONE from this list`}\n \n \n {reactData.adminHierarchy.map((gObj, ndx) => (\n {\n e.preventDefault();\n enqueueSnackbar(`Group ID=${gObj.id}`, { variant: 'info', persist: true });\n }}\n >\n {gObj.selectable ?\n \n {\n let foundIt = reactData.fullGroupList.findIndex(this_group => {\n return (this_group === gObj.id);\n });\n if (foundIt < 0) {\n reactData.fullGroupList.push(gObj.id);\n }\n else {\n reactData.fullGroupList.splice(foundIt, 1);\n }\n updateGroupList(reactData.fullGroupList);\n }}\n checked={reactData.fullGroupList.includes(gObj.id)}\n />\n {gObj.name}\n \n :\n {gObj.name}\n }\n \n ))}\n \n \n {`Public (optional) Groups`}\n {Object.keys(reactData.publicGroups).length > 0\n ? {`Choose any from this list you're interested in`}\n : {`No Public Groups are available at this time`}\n }\n \n \n {Object.keys(reactData.publicGroups).map((gID, ndx) => (\n {\n e.preventDefault();\n enqueueSnackbar(`Group ID=${gID}`, { variant: 'info', persist: true });\n }}\n >\n \n {\n let foundIt = reactData.fullGroupList.findIndex(this_group => {\n return (this_group === gID);\n });\n if (foundIt < 0) {\n reactData.fullGroupList.push(gID);\n }\n else {\n reactData.fullGroupList.splice(foundIt, 1);\n }\n updateGroupList(reactData.fullGroupList);\n }}\n checked={reactData.fullGroupList.includes(gID)}\n disabled={reactData.publicGroups[gID].role.startsWith('resp')}\n />\n {reactData.publicGroups[gID].group_name}\n \n \n ))}\n \n \n {`Private Groups`}\n {Object.keys(reactData.privateGroups).length > 0\n ? {`Only Administrators can update this information`}\n : {`You are not a member of any Private Groups`}\n }\n \n \n {Object.keys(reactData.privateGroups).map((gID, ndx) => (\n {\n e.preventDefault();\n enqueueSnackbar(`Group ID=${gID}`, { variant: 'info', persist: true });\n }}\n >\n \n {(!reactData.privateGroups[gID].role.startsWith('non-') || (['master', 'support'].includes(state.user.account_class))) &&\n {\n let foundIt = reactData.fullGroupList.findIndex(this_group => {\n return (this_group === gID);\n });\n if (foundIt < 0) {\n reactData.fullGroupList.push(gID);\n }\n else {\n reactData.fullGroupList.splice(foundIt, 1);\n }\n updateGroupList(reactData.fullGroupList);\n }}\n checked={reactData.fullGroupList.includes(gID)}\n disabled={reactData.privateGroups[gID].role.startsWith('resp')}\n />\n }\n {reactData.privateGroups[gID].group_name || gID}\n \n \n ))}\n \n \n {`Account Type`}\n {`Automatically assigned by AVA. Contact Support for more info`}\n \n {sentenceCase(reactData.accountClass || determineClass(person.groups))}\n \n
    \n );\n};\n","import React from 'react';\nimport Paper from '@material-ui/core/Paper';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableContainer from '@material-ui/core/TableContainer';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport Section from '../Section';\n\nconst useStyles = makeStyles({\n container: {\n maxHeight: 400,\n },\n});\n\nexport default ({ person }) => {\n const classes = useStyles();\n\n\n return (\n
    \n \n \n \n \n Name\n ID\n Description\n Type\n \n \n {person && person.relationships &&\n \n {person.relationships.map(relationship => (\n (!relationship.name ? null :\n \n {relationship.name}\n {relationship.person_id}\n {relationship.description}\n {relationship.access_type}\n \n )\n ))}\n \n }\n
    \n
    \n
    \n );\n};\n","import React from 'react';\n\nimport TextField from '@material-ui/core/TextField';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport Section from '../Section';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport Typography from '@material-ui/core/Typography';\nimport CircularProgress from '@material-ui/core/CircularProgress';\n\nimport RadioGroup from '@material-ui/core/RadioGroup';\nimport Radio from '@material-ui/core/Radio';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport FormControl from '@material-ui/core/FormControl';\n\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Box from '@material-ui/core/Box';\n\nconst useStyles = makeStyles(theme => ({\n container: {\n maxHeight: 400,\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n formControl: {\n margin: 0,\n paddingTop: 0,\n },\n formControlLbl: {\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 5,\n },\n}));\n\nexport default ({ groupMemberList, session, updateSession, updateProxy, updateSubscription, version }) => {\n const classes = useStyles();\n\n const [person_filter, setPersonFilter] = React.useState(' ');\n const [person_filter_lower, setPersonFilterLower] = React.useState(' ');\n const [enoughFilterDigits, setenoughFilterDigits] = React.useState(false);\n const [forceRedisplay, setForceRedisplay] = React.useState();\n\n let filterCount = 0;\n let nameObj = {};\n\n let respArray = [];\n if (session) {\n if (!session.hasOwnProperty('responsible_for') || !session.responsible_for) { }\n else if (Array.isArray(session.responsible_for)) { respArray.push(...session.responsible_for); }\n else if (session.responsible_for.startsWith('[')) { respArray = session.responsible_for.replace(/[[\\s\\]]/g, '').split(','); }\n else { respArray.push(session.responsible_for); }\n };\n\n const handleChangePersonFilter = event => {\n filterCount = 0;\n if (event.target.value.length === 0) {\n setPersonFilter(' ');\n setPersonFilterLower(' ');\n }\n else {\n setPersonFilter(event.target.value.trim());\n setPersonFilterLower(event.target.value.trim().toLowerCase());\n setenoughFilterDigits(event.target.value.length > 1);\n }\n };\n\n const handleUpdateSubscription = event => {\n updateSubscription(event.target.value);\n session.subscription_status = event.target.value;\n };\n\n function showName(pRec) {\n let returnName = pRec.name.last ? (pRec.name.first + ' ' + pRec.name.last) : pRec.display_name;\n if (pRec.location) { returnName += ` (${pRec.location.split('~')[0].trim()})`; }\n return returnName;\n }\n\n function filteredPerson(pID, pName = { last: '*No Name*', first: '*No Name*' }) {\n if (!pName.first) { pName.first = '*No First Name*'; }\n if (!pName.last) { pName.last = '*No Last Name*'; }\n let inTheList = (\n (respArray.includes(pID) ||\n ((enoughFilterDigits) &&\n (pName.last.toLowerCase().includes(person_filter_lower)\n || pName.first.toLowerCase().includes(person_filter_lower))\n ))\n && (session && (pID !== session.session_id))\n );\n if (inTheList || (session && session.patient_id === pID)) {\n nameObj[pID] = `${pName.first.charAt(0).toUpperCase()}${pName.last.charAt(0).toUpperCase()}${pName.last.substring(1)}`;\n }\n if (inTheList) { filterCount++; }\n return inTheList;\n }\n\n return ((version > -1) &&\n
    \n \n \n \n {(groupMemberList && (groupMemberList.length > 0)) ?\n \n \n {version}\n \n \n {groupMemberList.map((this_item, ndx) => (\n (filteredPerson(this_item.person_id, this_item.name)) &&\n {\n let foundAt = respArray.indexOf(this_item.person_id);\n if (foundAt > -1) { respArray.splice(foundAt, 1); }\n else { respArray.push(this_item.person_id); }\n console.log(filterCount);\n setForceRedisplay(!forceRedisplay);\n updateSession(respArray);\n }}\n >\n \n \n \n \n \n )\n )}\n {(filterCount === 0) && (respArray.length === 0) &&\n \n \n \n }\n \n {respArray.length > 0 &&\n \n Active proxy is...\n \n \n {respArray.map((presp) => (\n nameObj[presp] &&\n \n }\n label={\n \n {nameObj[presp]}\n }\n />\n ))}\n \n }\n label={\n \n None\n }\n />\n \n \n \n }\n \n Subscription status\n \n \n } label={None/NA} />\n } label={Pending} />\n } label={Active} />\n } label={Cancelled} />\n } label={Suspended} />\n } label={Inactive} />\n \n \n \n \n :\n \n {`Loading`}\n \n \n }\n
    \n );\n};","import React from 'react';\nimport { dbClient } from '../../util/AVAUtilities';\nimport Paper from '@material-ui/core/Paper';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport TimePicker from 'react-time-picker';\n\nimport Input from '@material-ui/core/Input';\n\nimport Typography from '@material-ui/core/Typography';\nimport Radio from '@material-ui/core/Radio';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormGroup from '@material-ui/core/FormGroup';\n\nimport Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Button from '@material-ui/core/Button';\nimport DeleteIcon from '@material-ui/icons/Delete';\n\nimport RadioGroup from '@material-ui/core/RadioGroup';\n\nimport Section from '../Section';\n\nconst useStyles = makeStyles(theme => ({\n container: {\n flexGrow: 1,\n marginLeft: '-24px',\n marginRight: '-24px',\n marginTop: '-12px',\n marginBottom: theme.spacing(2)\n },\n title: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n flexGrow: 1\n },\n formControl: {\n margin: 0,\n paddingTop: 0,\n },\n formControlLbl: {\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n },\n formControlFrom: {\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n alignItems: 'center',\n justifyContent: 'center',\n },\n formControlOn: {\n margin: 0,\n paddingTop: 0,\n marginRight: theme.spacing(1),\n height: theme.spacing(2.5),\n fontSize: theme.typography.fontSize * 0.8,\n alignItems: 'center',\n justifyContent: 'center',\n },\n formControlDayRow: {\n display: 'flex',\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n alignItems: 'center',\n justifyContent: 'flex-start',\n marginTop: theme.spacing(1.5),\n marginBottom: theme.spacing(1)\n },\n formControlTo: {\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n alignItems: 'center',\n justifyContent: 'center',\n marginLeft: theme.spacing(1)\n },\n formControlDays: {\n margin: 0,\n marginLeft: '-8px',\n marginRight: '2px',\n paddingTop: 0,\n height: 1,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: 0\n },\n centerCenter: {\n alignItems: 'center',\n justifyContent: 'center',\n marginBottom: -12\n },\n photoButton: {\n alignSelf: 'center',\n size: 'sm',\n variant: 'outlined',\n verticalAlign: 'middle',\n },\n idText: {\n display: 'inline',\n marginTop: -5,\n marginRight: theme.spacing(1),\n },\n idTextNoSpacing: {\n display: 'inline',\n },\n inputRule: {\n display: 'inline',\n fontSize: theme.typography.fontSize * 0.8,\n padding: 0,\n maxWidth: theme.spacing(3),\n margin: 0,\n },\n inputRuleWide: {\n display: 'inline',\n fontSize: theme.typography.fontSize * 0.8,\n padding: 0,\n maxWidth: theme.spacing(50),\n margin: 0,\n },\n defaultButton: {\n alignSelf: 'end',\n variant: 'outlined',\n verticalAlign: 'end',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n topButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginTop: theme.spacing(1.5),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n fontSize: theme.typography.fontSize * 0.8,\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n outline: '1px solid black',\n size: 'small',\n fontSize: theme.typography.fontSize * 0.8,\n color: theme.palette.reject[theme.palette.type],\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n radioTextNoSpacing: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 2,\n },\n radioDays: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 2,\n marginLeft: 0,\n },\n radioTextBold: {\n fontSize: theme.typography.fontSize * 0.8,\n fontWeight: 'bold',\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n radioTextHeader: {\n fontSize: theme.typography.fontSize * 0.8,\n fontWeight: 'bold',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 10,\n },\n fullBody: {\n marginLeft: theme.spacing(2),\n },\n radioTextBig: {\n fontSize: theme.typography.fontSize * 1.2,\n fontWeight: 'bold',\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n topicBox: {\n marginTop: theme.spacing(2),\n },\n buttonBox: {\n marginTop: theme.spacing(2),\n marginRight: theme.spacing(2),\n paddingBottom: theme.spacing(2),\n borderBottom: '2px solid'\n },\n topicBoxwithHoverBorder: {\n marginTop: theme.spacing(2),\n padding: 2,\n '&:hover': {\n border: '2px solid',\n },\n },\n radioTextTop: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n marginTop: theme.spacing(1.5),\n paddingLeft: 0,\n paddingRight: 0,\n },\n radioTextTopRight: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(2),\n marginTop: theme.spacing(1),\n paddingLeft: 0,\n paddingRight: 0,\n },\n radioTextRight: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(1),\n paddingLeft: 0,\n paddingRight: 0,\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 5,\n },\n}));\n\nexport default ({ person, updateSetChange, onChangeMethod, onChangeEscalationType, onChangeWaitTime, onChangeKeyWords, onChangeEscalationData, numRows, session }) => {\n const classes = useStyles();\n let waitTime;\n let escalationData;\n let keyWords;\n\n let l = person.time_based_rules?.length || 0;\n if (l === 0) {\n person.time_based_rules = [\n {\n 'time_to': null,\n 'method': ' ',\n 'time_from': null,\n 'day': ''\n },\n {\n 'method': person.preferred_method\n }\n ];\n\n }\n\n const [ruleRows, setRuleRows] = React.useState(person.time_based_rules || []);\n const [lastEntry, setLastEntry] = React.useState((person.time_based_rules?.length || 1) - 1);\n const [viewVersion, setViewVersion] = React.useState(1);\n const [linkedAccounts, setLinkedAccounts] = React.useState([]);\n\n const handleAddRule = () => {\n person.time_based_rules.splice(lastEntry, 0,\n {\n 'time_to': null,\n 'method': ' ',\n 'time_from': null,\n 'day': ''\n });\n setLastEntry(lastEntry + 1);\n setRuleRows(person.time_based_rules);\n updateSetChange();\n };\n\n const handleRemoveRule = (pIndex) => {\n person.time_based_rules.splice(pIndex, 1);\n setLastEntry(lastEntry - 1);\n setRuleRows(person.time_based_rules);\n updateSetChange();\n };\n\n const handleChangeEscalationType = tableRow => event => {\n person.time_based_rules[tableRow].escalationType = event.target.value;\n person.time_based_rules[tableRow].escalationData = '';\n if (event.target.value === 'altID') { getLinkedAccounts(); }\n setRuleRows(person.time_based_rules);\n setViewVersion(viewVersion + 1);\n updateSetChange();\n };\n\n const handleChangeMethod = tableRow => event => {\n person.time_based_rules[tableRow].method = event.target.value;\n setRuleRows(person.time_based_rules);\n setViewVersion(viewVersion + 1);\n updateSetChange();\n };\n\n const handleChangeEscalationData = tableRow => event => {\n person.time_based_rules[tableRow].escalationData = event.target.value;\n setRuleRows(person.time_based_rules);\n setViewVersion(viewVersion + 1);\n updateSetChange();\n };\n\n const onChangeFromTime = tableRow => event => {\n person.time_based_rules[tableRow].time_from = event;\n setRuleRows(person.time_based_rules);\n setViewVersion(viewVersion + 1);\n updateSetChange();\n };\n\n const onChangeToTime = tableRow => event => {\n person.time_based_rules[tableRow].time_to = event;\n setRuleRows(person.time_based_rules);\n setViewVersion(viewVersion + 1);\n updateSetChange();\n };\n\n const updateRoutingDay = (tableRow, dayValue, removeEntry) => {\n if (removeEntry) {\n let newString = person.time_based_rules[tableRow].day.replace(dayValue, '');\n person.time_based_rules[tableRow].day = newString;\n }\n else { person.time_based_rules[tableRow].day += dayValue; };\n setRuleRows(person.time_based_rules);\n setViewVersion(viewVersion + 1);\n updateSetChange();\n };\n\n async function getLinkedAccounts() {\n if (!linkedAccounts || (linkedAccounts.length === 0)) {\n let respArray = [];\n if (session) {\n if (!session.hasOwnProperty('responsible_for') || !session.responsible_for) { }\n else if (Array.isArray(session.responsible_for)) { respArray.push(...session.responsible_for); }\n else if (session.responsible_for.startsWith('[')) { respArray = session.responsible_for.replace(/[[\\s\\]]/g, '').split(','); }\n else { respArray.push(session.responsible_for); }\n };\n let accountArray = [];\n for (let r = 0; r < respArray.length; r++) {\n let p = respArray[r];\n let pR = await dbClient\n .get({\n Key: { person_id: p },\n TableName: \"People\"\n })\n .promise()\n .catch(error => {\n console.log({ 'Bad get on People - caught error is': error });\n });\n if (pR && pR.Item && pR.Item.name) { accountArray.push(`${pR.Item.name.first} ${pR.Item.name.last} (${p})`); }\n };\n setLinkedAccounts(accountArray);\n }\n }\n\n return (\n
    \n \n {(person && viewVersion > 0) &&\n \n {ruleRows.map((route, i) => (\n \n {(i < lastEntry) &&\n \n {`Message Handling Rule ${i + 1}`}\n \n \n \n \n }\n label={From}\n labelPlacement='start'\n />\n \n }\n label={To}\n labelPlacement='start'\n />\n \n \n \n \n \n \n updateRoutingDay(i, '0', route?.day?.includes('0'))}\n inputProps={{ 'aria-labelledby': `message_routing_${i}_0` }}\n />\n }\n label={Sun}\n labelPlacement='bottom'\n />\n updateRoutingDay(i, '1', route?.day?.includes('1'))}\n inputProps={{ 'aria-labelledby': `message_routing_${i}_1` }}\n />\n }\n label={Mon}\n labelPlacement='bottom'\n />\n updateRoutingDay(i, '2', route?.day?.includes('2'))}\n inputProps={{ 'aria-labelledby': `message_routing_${i}_2` }}\n />\n }\n label={Tue}\n labelPlacement='bottom'\n />\n updateRoutingDay(i, '3', route?.day?.includes('3'))}\n inputProps={{ 'aria-labelledby': `message_routing_${i}_3` }}\n />\n }\n label={Wed}\n labelPlacement='bottom'\n />\n updateRoutingDay(i, '4', route?.day?.includes('4'))}\n inputProps={{ 'aria-labelledby': `message_routing_${i}_4` }}\n />\n }\n label={Thu}\n labelPlacement='bottom'\n />\n updateRoutingDay(i, '5', route?.day?.includes('5'))}\n inputProps={{ 'aria-labelledby': `message_routing_${i}_5` }}\n />\n }\n label={Fri}\n labelPlacement='bottom'\n />\n updateRoutingDay(i, '6', route?.day?.includes('6'))}\n inputProps={{ 'aria-labelledby': `message_routing_${i}_6` }}\n />\n }\n label={Sat}\n labelPlacement='bottom'\n />\n \n \n \n \n }\n \n {(lastEntry === 0) &&\n I prefer to receive communications via...\n }\n {(lastEntry > 0) && (i < lastEntry) &&\n During these times, I prefer...\n }\n {(lastEntry > 0) && (i === lastEntry) &&\n At all other times, use this method...\n }\n \n \n } label={AVA} />\n } label={text} />\n } label={e-Mail} />\n } label={home phone} />\n } label={work phone} />\n } label={surrogate} />\n } label={hold all non-urgent messages} />\n \n \n \n \n \n {(route.method === 'hold') ?\n {`For urgent messages`}\n :\n \n }\n label={{`For urgent messages, wait how many minutes?:`}}\n labelPlacement={'start'}\n />\n Then...\n \n }\n \n \n \n {(route.method !== 'hold') && } label={try again} />}\n } label={try another method} />\n } label={send it to one of my linked accounts} />\n } label={try another address or phone number} />\n } label={do nothing} />\n \n \n {(route.escalationType && (route.escalationType !== 'noAction')) &&\n \n {(route.escalationType === 'retry') &&\n \n Retry no more than\n \n times\n \n }\n {(route.escalationType === 'altAddress') &&\n \n Use this alternate e-Mail address or phone number\n \n \n }\n {(route.escalationType === 'altMethod') &&\n \n Try to reach me via\n \n \n {(route.method !== 'sms') && } label={text} />}\n {(route.method !== 'email') && } label={e-Mail} />}\n {(route.method !== 'voice') && } label={home phone} />}\n {(route.method !== 'office') && } label={work phone} />}\n \n \n \n }\n {(route.escalationType === 'altID') &&\n \n Select a linked account to send to\n \n \n {linkedAccounts.map((presp) => (\n }\n label={{presp}}\n />\n ))\n }\n \n \n \n }\n \n }\n \n \n \n \n }\n label={Treat a message as urgent if it has any of these keywords}\n labelPlacement={'start'}\n />\n \n \n \n {(i !== lastEntry) &&\n \n {\n handleRemoveRule(i);\n }}\n className={classes.rowButtonRed}\n startIcon={}\n >\n Remove this rule\n \n \n }\n \n \n ))}\n \n }\n \n \n
    \n );\n};\n","import React from 'react';\nimport Cropper from \"react-cropper\";\nimport \"cropperjs/dist/cropper.css\";\nimport { API, graphqlOperation } from 'aws-amplify';\nimport { getPerson, getSession, makeName, makeSearchData, formatPhone } from '../../util/AVAPeople';\nimport { makeDate } from '../../util/AVADateTime';\nimport { getObject, cl, dbClient, s3, lambda, cloudfront, titleCase, deepCopy } from '../../util/AVAUtilities';\nimport { createPutFact } from '../../graphql/mutations';\nimport useSession from '../../hooks/useSession';\n\nimport { useSnackbar } from 'notistack';\n\nimport AppBar from '@material-ui/core/AppBar';\nimport Box from '@material-ui/core/Box';\nimport Switch from '@material-ui/core/Switch';\nimport CloseIcon from '@material-ui/icons/Close';\nimport Dialog from '@material-ui/core/Dialog';\nimport IconButton from '@material-ui/core/IconButton';\nimport Paper from '@material-ui/core/Paper';\nimport Slide from '@material-ui/core/Slide';\nimport Toolbar from '@material-ui/core/Toolbar';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport TextField from '@material-ui/core/TextField';\nimport Button from '@material-ui/core/Button';\nimport RadioGroup from '@material-ui/core/RadioGroup';\nimport Radio from '@material-ui/core/Radio';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport FormControl from '@material-ui/core/FormControl';\nimport Slider from '@material-ui/core/Slider';\n\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport HelpOutlineIcon from '@material-ui/icons/HelpOutline';\n\nimport ClientsSection from '../sections/ClientsSection';\nimport RelationshipSection from '../sections/RelationshipSection';\nimport LinkedAccountsSection from '../sections/LinkedAccountsSection';\nimport MessageRouting from '../sections/MessageRouting';\n\nconst useStyles = makeStyles(theme => ({\n title: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n flexGrow: 1\n },\n boxWithRoom: {\n marginTop: 10,\n alignContent: 'center',\n },\n formControl: {\n margin: 0,\n paddingTop: 0,\n },\n formControlLbl: {\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n },\n idText: {\n marginRight: theme.spacing(1),\n },\n picture: {\n width: theme.spacing(16),\n height: theme.spacing(16),\n [theme.breakpoints.down('xs')]: {\n width: theme.spacing(8),\n height: theme.spacing(8),\n },\n },\n photoButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n alignSelf: 'center',\n verticalAlign: 'middle',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n },\n defaultButton: {\n alignSelf: 'end',\n variant: 'outlined',\n verticalAlign: 'end',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n topButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n pConfirmedButton: {\n color: 'green',\n verticalAlign: 'middle',\n textDecoration: 'none',\n textWrap: 'nowrap',\n textTransform: 'none',\n fontWeight: 'bold',\n },\n resetButton: {\n backgroundColor: 'orange',\n marginRight: 10,\n paddingRight: 10,\n paddingLeft: 10,\n verticalAlign: 'middle',\n textDecoration: 'none',\n textWrap: 'nowrap',\n textTransform: 'none',\n },\n infoButton: {\n variant: 'outlined',\n backgroundColor: 'red',\n color: 'white',\n marginRight: 10,\n paddingRight: 10,\n paddingLeft: 10,\n verticalAlign: 'middle',\n textDecoration: 'none',\n textWrap: 'nowrap',\n textTransform: 'none'\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n radioTextBold: {\n fontSize: theme.typography.fontSize * 0.8,\n fontWeight: 'bold',\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n radioTextWithTopMargin: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: theme.spacing(1),\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n lineTextWithTopMargin: {\n marginTop: theme.spacing(1),\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n local_boolean: {\n paddingTop: 16,\n paddingBottom: 16,\n marginRight: 32,\n fontSize: theme.typography.fontSize * 0.857,\n color: (true ? 'black' : '#0000008A')\n },\n local_tiny: {\n paddingTop: 16,\n paddingBottom: 16,\n fontSize: theme.typography.fontSize * 0.5\n },\n idText1: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n idText2: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 5,\n },\n}));\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ patient, picture, groupData, options = {}, open, onClose }) => {\n\n const isMounted = React.useRef(false);\n \n const classes = useStyles();\n\n const [localData, setLocalData] = React.useState({});\n const [patientGroups, setPatientGroups] = React.useState();\n const [responsibleArray, setResponsibleArray] = React.useState();\n const [proxy, setProxy] = React.useState();\n\n const [refreshTrigger, setRefreshTrigger] = React.useState(false);\n\n const [patientPChange, setPatientPChange] = React.useState();\n const [patientSession, setPatientSession] = React.useState();\n const [sessionVersion, setSessionVersion] = React.useState(0);\n\n const [changes, setChangesReact] = React.useState(false);\n const [showQuestionMark, setShowQuestionMark] = React.useState(false);\n const [photoChanges, setPhotoChanges] = React.useState(false);\n const [resettingPwd, setResettingPwd] = React.useState(0);\n const [pwdConfirmed, setPwdConfirmed] = React.useState(false);\n const [fontFactorChanged, setFontFactorChanged] = React.useState(false);\n\n const [editPhotoKey, setEditPhotoKey] = React.useState();\n const [editPhoto, setEditPhoto] = React.useState(null);\n const [cropperInstance, setCropper] = React.useState();\n\n const { enqueueSnackbar } = useSnackbar();\n const { state } = useSession();\n\n const [user_fontSize, setUserFontSize] = React.useState(1);\n const [fontFactor,] = React.useState(1);\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:GroupMemberMaintenance',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: ''\n };\n\n const [reactData, setReactData] = React.useState({\n options\n });\n\n const setChanges = (cValue) => {\n setChangesReact(cValue);\n }\n\n const updateReactData = (newData, force = false) => {\n if (isMounted.current) {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setRefreshTrigger(refreshTrigger => !refreshTrigger); }\n }\n };\n\n React.useEffect(() => {\n async function initialize() {\n if (patient) {\n if (patient.person_id.startsWith('*NEW~')) {\n // every new account is automatically put in an inactive group, the groups name is\n // designated in the customizations table's \"group_assignments\" key\n let inactiveAssignment = state?.session?.group_assignments?.inactive;\n let inactiveGroup;\n if (!inactiveAssignment) {\n inactiveGroup = 'inactive';\n }\n else if (Array.isArray(inactiveAssignment)) {\n inactiveGroup = inactiveAssignment[0];\n }\n else {\n inactiveGroup = inactiveAssignment;\n }\n groupData.selectedID = inactiveGroup;\n // make sure this new person is not automatically put in any public or private groups\n // groupData.privateGroups = {};\n for (let groupID in groupData.privateGroups) {\n groupData.privateGroups[groupID].role = \"non-member\";\n }\n for (let groupID in groupData.publicGroups) {\n groupData.publicGroups[groupID].role = \"non-member\";\n }\n }\n let localPersonRec = await getPersonRec(patient.person_id);\n setPatientGroups(localPersonRec.groups);\n if (localPersonRec.relationships) {\n localPersonRec.relationships.forEach(async (relationship, index) => {\n localPersonRec.relationships[index].name = makeName(relationship.person_id);\n });\n }\n let targetSession = await getSessionData(patient.person_id);\n if (targetSession.customizations && targetSession.customizations.font_size) {\n setUserFontSize(targetSession.customizations.font_size);\n }\n let respArray = [];\n if (!targetSession.hasOwnProperty('responsible_for') || !targetSession.responsible_for) { }\n else if (Array.isArray(targetSession.responsible_for)) { respArray.push(...targetSession.responsible_for); }\n else if (targetSession.responsible_for.startsWith('[')) { respArray = targetSession.responsible_for.replace(/[[\\s\\]]/g, '').split(','); }\n else { respArray.push(targetSession.responsible_for); }\n\n let workingGroupMemberList = [];\n let nameObj = {};\n if (!localData.hasOwnProperty('groupMemberList') || localData.groupMemberList.length === 0) {\n workingGroupMemberList = await getGroupMemberList();\n workingGroupMemberList.forEach(m => {\n nameObj[m.person_id] = `${m.name?.first.charAt(0).toUpperCase()}${m.name?.last.charAt(0).toUpperCase()}${m.name?.last.substring(1)}`;\n });\n }\n\n let finalRespArray = [];\n respArray.forEach(r => { if (nameObj.hasOwnProperty(r)) { finalRespArray.push(r); } });\n\n let workLocalData = {\n ready: true,\n patient_id: (localPersonRec.person_id || ''),\n firstName: (titleCase(localPersonRec.name?.first) || ''),\n lastName: (titleCase(localPersonRec.name?.last) || ''),\n email: (localPersonRec.messaging?.email || ''),\n cell: (localPersonRec.messaging?.sms ? formatPhone(localPersonRec.messaging?.sms) : ''),\n voice: (localPersonRec.messaging?.voice ? formatPhone(localPersonRec.messaging?.voice) : ''),\n office: (localPersonRec.messaging?.office ? formatPhone(localPersonRec.messaging?.office) : ''),\n email_private: localPersonRec.messaging?.email_private,\n sms_private: localPersonRec.messaging?.sms_private,\n voice_private: localPersonRec.messaging?.voice_private,\n office_private: localPersonRec.messaging?.office_private,\n searchTerm: (localPersonRec.search_data || ''),\n local_data: (localPersonRec.local_data || {}),\n local_data_display: prepareLocal(localPersonRec.local_data),\n location: (localPersonRec.location || ''),\n sessionClient: (targetSession.client_id || '#need'),\n sessionPatient: (targetSession.patient_id || '#need'),\n inputPWD: (targetSession.last_login || 'password'), // localData.storePassword ? localData.inputPWD : ''}\n PWDDisplayed: (targetSession.last_login ? (targetSession.storePassword ? targetSession.last_login : '*****') : 'password'),\n priority_activities: localPersonRec.priority_activities,\n favorite_activities: localPersonRec.favorite_activities,\n favorite_blocked: localPersonRec.favorite_blocked,\n last_login: (targetSession.last_login || null),\n preferred_method: localPersonRec.preferred_method || 'AVA',\n respArray: (finalRespArray || []),\n nameObj: (nameObj || {}),\n photoURL: await getObject(`${patient.person_id}`, 'image'),\n requirePassword: (targetSession.hasOwnProperty('requirePassword') ? targetSession.requirePassword : false),\n storePassword: (targetSession.hasOwnProperty('storePassword') ? targetSession.storePassword : true),\n subscription_status: targetSession.subscription_status || 'na',\n groupMemberList: (workingGroupMemberList || []),\n directoryOption: (localPersonRec.directory_option || 'normal'),\n directoryPartner: (localPersonRec.directory_partner || 'na'),\n account_class: (localPersonRec.account_class || ''),\n patientGroups: (localPersonRec.groups)\n };\n if (isNaN(localPersonRec.messaging?.surrogate)) { workLocalData.surrogate = localPersonRec.messaging?.surrogate; }\n else { workLocalData.surrogate = (formatPhone('' + localPersonRec.messaging?.surrogate)); }\n reactData.options.passwordDisplayed = true;\n setLocalData(workLocalData);\n }\n }\n isMounted.current = true;\n initialize();\n return () => { isMounted.current = false; }\n }, [patient]); // eslint-disable-line react-hooks/exhaustive-deps\n\n function prepareLocal(localObj) {\n // takes in {key: value, key2: value2, ...}\n // returns {key: value for display, key2: value for display, ...}\n if (!localObj) { return {}; }\n let oKeys = Object.keys(localObj);\n if (oKeys.length === 0) { return {}; }\n let returnObj = {};\n oKeys.forEach(k => {\n returnObj[k] = localObj[k];\n });\n if (!state.session.local_data) { return returnObj; }\n if (Object.keys(state.session.local_data).length === 0) { return returnObj; }\n for (let ldKey in state.session.local_data) {\n if (localObj.hasOwnProperty(ldKey)) {\n switch (state.session.local_data[ldKey]) {\n case 'phone': {\n returnObj[ldKey] = formatPhone(localObj[ldKey]);\n break;\n }\n case 'boolean': {\n returnObj[ldKey] = localObj[ldKey];\n break;\n }\n case 'date': {\n returnObj[ldKey] = makeDate(localObj[ldKey], { noTime: true, noYearCorrection: true }).absolute;\n break;\n }\n case 'fulldate': {\n returnObj[ldKey] = makeDate(localObj[ldKey], { noTime: true, noYearCorrection: true }).absolute_full;\n break;\n }\n default: { }\n }\n }\n }\n return returnObj;\n }\n\n const getPersonRec = async (pPerson) => {\n let pRec = await getPerson(pPerson, '*all', true);\n if (pRec) { return pRec; }\n else {\n return {\n \"person_id\": pPerson,\n \"location\": \"\",\n \"client_id\": state?.session?.client_id || patient.client_id,\n \"search_data\": \"\",\n \"clients\": [\n {\n \"groups\": [],\n \"id\": state?.session?.client_id || patient.client_id\n }\n ],\n \"name\": {\n \"last\": \"\",\n \"first\": \"\"\n },\n \"directory_option\": \"normal\",\n \"display_name\": \"\",\n \"groups\": [],\n \"preferred_method\": \"AVA\",\n \"relationships\": null,\n \"roles\": [\"patient\"],\n \"messaging\": {},\n \"time_offset\": -5,\n };\n };\n };\n\n const getSessionData = async (pWho) => {\n let sessionRec = await getSession(pWho);\n if (sessionRec.session_id) {\n setPatientSession(sessionRec);\n setPatientPChange(sessionRec.password_change_date);\n return sessionRec;\n }\n else {\n let temp_session = {\n \"session_id\": pWho,\n \"patient_id\": pWho,\n \"user_id\": pWho,\n \"person_id\": pWho,\n \"patient_display_name\": \"New Account\",\n \"user_display_name\": \"New Account\",\n \"assigned_to\": \"\",\n \"client_id\": state?.session?.client_id || patient.client_id,\n \"groups_managed\": [],\n \"kiosk_mode\": false,\n \"last_login\": \"\",\n \"method\": \"add_from_dialog\",\n \"password_change_date\": \"\",\n \"platform\": \"\",\n \"requirePassword\": false,\n \"responsible_for\": [],\n \"status\": {},\n \"storePassword\": true,\n \"subscription_status\": \"na\",\n \"url_parameters\": {},\n \"user_homeClient\": state?.session?.client_id || patient.client_id\n };\n setPatientSession(temp_session);\n return temp_session;\n }\n };\n\n const getGroupMemberList = async () => {\n let invokeFailed = false;\n // setGroupMemberList([]);\n params.Payload = JSON.stringify({\n action: \"get_group_members\",\n clientId: patient.client_id,\n request: {\n \"group_id\": '*ALL',\n }\n });\n const fResp = await lambda\n .invoke(params)\n .promise()\n .catch(err => {\n cl(`AVA encountered an error while retrieving Group list. Error is ${err.message}`);\n });\n if (!invokeFailed) {\n let gML = JSON.parse(fResp.Payload);\n if (gML.status === 200) {\n // setGroupMemberList(gML.body);\n return gML.body;\n }\n };\n return [];\n };\n\n const hiddenFileInput = React.useRef(null);\n const passwordSection = React.useRef(null);\n\n const autoFocus = (element) => {\n if (reactData.options && reactData.options.scrollToPassword && element && passwordSection && passwordSection.current) {\n reactData.options.scrollToPassword = false;\n passwordSection.current.scrollIntoView({\n behavior: 'instant',\n block: 'start',\n });\n updateReactData({\n options: reactData.options\n }, false)\n\n }\n };\n\n const handlePhotoUpload = event => {\n hiddenFileInput.current.click();\n };\n\n const removeTemporaryPhoto = async () => {\n if (editPhotoKey) {\n s3.deleteObject({\n Bucket: 'theseus-medical-storage',\n Key: editPhotoKey,\n }).promise();\n setEditPhotoKey();\n }\n };\n\n const handleAbort = () => {\n setResettingPwd(0);\n setPwdConfirmed(false);\n localData.inputPWD = (patientSession ? (patientSession.last_login || 'password') : 'password');\n setChanges(false);\n setPhotoChanges(false);\n if (editPhotoKey) { removeTemporaryPhoto(); };\n onClose();\n };\n\n async function prepareUserID() {\n if (patient.person_id.startsWith('*NEW~')) {\n if (localData.firstName && localData.lastName) {\n localData.patient_id = await newUserID(localData);\n setRefreshTrigger(!refreshTrigger);\n }\n }\n }\n\n async function newUserID(pLocal) {\n let tryAgain;\n let showWarning = false;\n let newID, namePart;\n let clientPart = `-${state.session.client_id.toLowerCase()}`;\n let numberPart = 1;\n if (pLocal.proposedID) {\n namePart = (pLocal.proposedID.match(/([\\w-]*[^\\d]+)(\\d*)$/))[1];\n newID = pLocal.proposedID;\n }\n else {\n if (!pLocal.lastName) {\n if (!pLocal.firstName) {\n return patient.person_id;\n }\n namePart = pLocal.firstName.trim().toLowerCase();\n }\n else {\n namePart = pLocal.firstName.trim().substr(0, 1).toLowerCase() + pLocal.lastName.toLowerCase().replace(/\\W/g, '');\n }\n newID = `${namePart}${clientPart}`;\n }\n do {\n tryAgain = false;\n let getSessionResult = await getSession(newID);\n if (getSessionResult.hasOwnProperty('session_id')) {\n if (pLocal.proposedID) {\n showWarning = true;\n }\n numberPart++;\n if (newID.includes(clientPart)) {\n newID = `${namePart.replace(clientPart, '')}${numberPart}${clientPart}`;\n }\n else {\n newID = `${namePart}${numberPart}`;\n }\n tryAgain = true;\n }\n } while (tryAgain);\n if (showWarning) {\n enqueueSnackbar(`User ID ${pLocal.proposedID} is not available; AVA proposes ${newID} instead`, { variant: 'error', persist: false });\n showWarning = false;\n setChanges(true);\n }\n return newID;\n }\n\n const handleUpdate = async () => {\n // error chacking\n let errorList = [];\n if (localData.lastName.trim().length === 0) {\n if (localData.firstName.trim().length === 0) {\n errorList.push('First and Last Name are blank');\n }\n else {\n let name_parts = localData.firstName.trim().split(' ');\n if (name_parts.length > 1) {\n localData.firstName = name_parts.shift();\n localData.lastName = name_parts.join(\" \");\n }\n else {\n localData.lastName = name_parts[0];\n localData.firstName = \"\";\n }\n if (patient.person_id.startsWith('*NEW~')) {\n patient.person_id = await newUserID(deepCopy(localData))\n }\n }\n }\n if (errorList.length > 0) {\n enqueueSnackbar(errorList, { variant: 'error', persist: false });\n setChanges(false);\n return;\n }\n // all good\n let updatePerson = {\n client_id: state?.session?.client_id || patient.client_id,\n person_id: localData.patient_id || (patient.person_id.startsWith('*NEW~') ? await newUserID(localData) : patient.person_id),\n first: localData.firstName.substr(0, 1).toUpperCase() + localData.firstName.substr(1),\n last: localData.lastName.substr(0, 1).toUpperCase() + localData.lastName.substr(1),\n email: localData.email,\n sms: localData.cell ? '+1' + localData.cell.replace(/\\D/g, '') : null,\n voice: localData.voice ? '+1' + localData.voice.replace(/\\D/g, '') : null,\n office: localData.office ? '+1' + localData.office.replace(/\\D/g, '') : null,\n email_private: (localData.email_private && 'true'),\n sms_private: (localData.sms_private && 'true'),\n voice_private: (localData.voice_private && 'true'),\n office_private: (localData.office_private && 'true'),\n surrogate: localData.surrogate || '',\n local_data: localData.local_data,\n search_data: makeSearchData([localData]),\n preferred_method: localData.preferred_method || 'AVA',\n requirePassword: localData.requirePassword,\n priority_activities: localData.priority_activities,\n favorite_activities: localData.favorite_activities,\n favorite_blocked: localData.favorite_blocked,\n storePassword: localData.storePassword,\n subscription_status: localData.subscription_status,\n directory_option: localData.directoryOption || 'normal',\n directory_partner: localData.directoryPartner || null,\n time_based_rules: patient.time_based_rules,\n account_class: localData.account_class || '',\n groups: patientGroups || ['inactive'],\n location: localData.location ? localData.location.replace(/,/g, '') : null,\n pwdReset: !(resettingPwd === 0),\n newPassword: localData.inputPWD\n };\n let myClient = state?.session?.client_id || patient.client_id;\n let putPerson = {\n person_id: updatePerson.person_id,\n client_id: myClient,\n \"name\": {\n first: updatePerson.first,\n last: updatePerson.last,\n },\n messaging: {\n email: updatePerson.email,\n sms: updatePerson.sms,\n voice: updatePerson.voice,\n office: updatePerson.office,\n email_private: !!updatePerson.email_private,\n sms_private: !!updatePerson.sms_private,\n voice_private: !!updatePerson.voice_private,\n office_private: !!updatePerson.office_private,\n surrogate: localData.surrogate,\n },\n search_data: updatePerson.search_data,\n local_data: updatePerson.local_data,\n preferred_method: localData.preferred_method || 'AVA',\n priority_activities: localData.priority_activities,\n favorite_activities: localData.favorite_activities,\n favorite_blocked: localData.favorite_blocked,\n requirePassword: localData.requirePassword,\n storePassword: localData.storePassword,\n subscription_status: localData.subscription_status || 'na',\n directory_option: localData.directoryOption || 'normal',\n directory_partner: localData.directoryPartner || 'na',\n time_based_rules: patient.time_based_rules,\n account_class: localData.account_class,\n clients: {\n id: myClient,\n groups: patientGroups || ['inactive']\n },\n groups: patientGroups || ['inactive'],\n location: localData.location ? localData.location.replace(/,/g, '') : null,\n pwdReset: !(resettingPwd === 0),\n newPassword: localData.inputPWD\n };\n updatePerson.messaging = putPerson.messaging;\n updatePerson.name = putPerson.name;\n await dbClient\n .put({\n Item: putPerson,\n TableName: \"People\",\n })\n .promise()\n .catch(error => { cl(`caught error updating People; error is:`, error); });\n\n let updateString = 'newData.' + JSON.stringify(updatePerson);\n cl(updatePerson);\n let newFactData = {\n patient_id: updatePerson.person_id,\n activity_key: 'action.updateUser',\n value: updateString,\n qualifier: null,\n status: 'requested',\n session: {\n user_id: updatePerson.person_id,\n session_id: updatePerson.person_id,\n },\n };\n await API.graphql(graphqlOperation(createPutFact, { input: newFactData })).catch(error => {\n cl(error);\n });\n\n let sessionRec = await getSession(patient.person_id);\n sessionRec.session_id = updatePerson.person_id;\n sessionRec.person_id = updatePerson.person_id;\n sessionRec.user_id = updatePerson.person_id;\n sessionRec.status = {\n 'version': `v${process.env.REACT_APP_AVA_VERSION}`,\n 'environment': window.location.href.split('//')[1].charAt(0).toUpperCase(),\n 'time': new Date().toString(),\n 'action': 'Updated Person record',\n 'source': 'patient_dialog'\n };\n if (proxy) {\n sessionRec.patient_id = proxy;\n }\n else {\n sessionRec.patient_id = localData.patient_id || updatePerson.person_id;\n }\n if (localData.last_login && (resettingPwd < 2)) {\n sessionRec.last_login = localData.last_login;\n }\n if (resettingPwd === 2) {\n sessionRec.last_login = localData.inputPWD;\n sessionRec.password_change_date = new Date().toLocaleString();\n }\n sessionRec.requirePassword = localData.requirePassword;\n sessionRec.storePassword = localData.storePassword;\n sessionRec.subscription_status = localData.subscription_status;\n if (responsibleArray) {\n sessionRec.responsible_for = responsibleArray;\n }\n if ((localData.sessionClient !== myClient)\n || (localData.sessionPatient !== putPerson.person_id)\n || !sessionRec.client_id\n || (sessionRec.client_id === '')) {\n sessionRec.client_id = myClient;\n }\n if (fontFactorChanged) {\n if (!sessionRec.hasOwnProperty('customizations')) {\n sessionRec.customizations = {};\n }\n sessionRec.customizations.font_size = fontFactor * user_fontSize;\n }\n await dbClient\n .put({\n Item: sessionRec,\n TableName: \"SessionsV2\",\n })\n .promise()\n .catch(error => { cl(`caught error updating People; error is:`, error); });\n\n\n // If we changed the person_id, make the original preon_id an inactive account\n if (putPerson.person_id !== patient.person_id) {\n let inactiveAssignment = state?.session?.group_assignments?.inactive;\n let inactiveGroup;\n if (!inactiveAssignment) {\n inactiveGroup = 'inactive';\n }\n else if (Array.isArray(inactiveAssignment)) {\n inactiveGroup = inactiveAssignment[0];\n }\n else {\n inactiveGroup = inactiveAssignment;\n }\n await dbClient\n .update({\n Key: { person_id: patient.person_id },\n UpdateExpression: 'set #g = :g, #c = :c',\n ExpressionAttributeValues: {\n ':g': [inactiveGroup],\n ':c': {\n 'groups': [inactiveGroup],\n 'id': state?.session?.client_id || patient.client_id\n }\n },\n ExpressionAttributeNames: {\n '#g': 'groups',\n '#c': 'clients'\n },\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating People; error is: `, error);\n });\n // copy photo\n let [fileID, extension] = localData.photoURL.split('/').pop().split('?').shift().split('.');\n let copy_response = await s3.copyObject({\n CopySource: `theseus-medical-storage/public/patients/${fileID}.${extension}`,\n Bucket: 'theseus-medical-storage',\n Key: `public/patients/${putPerson.person_id}.${extension}`,\n ACL: 'public-read-write',\n })\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA couldn't save the photo. The reason is ${err.message}`, { variant: 'error', persist: true });\n });\n cl(copy_response);\n enqueueSnackbar(`ID changed to ${putPerson.person_id}. Information updated!`, { variant: 'success', persist: false });\n }\n else {\n enqueueSnackbar(`Profile information updated!`, { variant: 'success', persist: false });\n }\n\n patient.name.first = localData.firstName;\n patient.name.last = localData.lastName;\n setChanges(false);\n setPhotoChanges(false);\n setResettingPwd(0);\n setPwdConfirmed(false);\n onClose(updatePerson);\n };\n\n const handleResetPassword1 = wipPassword => {\n setResettingPwd(2);\n setPwdConfirmed(false);\n // setInputPWD('password');\n localData.inputPWD = wipPassword || ((patientSession && patientSession.last_login) ? patientSession.last_login : 'password');\n };\n\n const handleResetPassword2 = event => {\n setPwdConfirmed(true);\n };\n\n const handleChangePartner = event => {\n localData.directoryPartner = event.target.value;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeUser = async event => {\n localData.patient_id = event.target.value.toLowerCase();\n setRefreshTrigger(!refreshTrigger);\n setShowQuestionMark(true);\n setChanges(false);\n };\n\n const handleBlurUser = async event => {\n let proposedID = event.target.value.toLowerCase();\n if (proposedID !== patient.person_id) {\n localData.patient_id = await newUserID({\n proposedID\n });\n setRefreshTrigger(!refreshTrigger);\n setShowQuestionMark(false);\n setChanges(true);\n }\n };\n\n const handleBlurName = async event => {\n await prepareUserID();\n };\n\n const handleChangeFirstName = async event => {\n localData.firstName = event.target.value;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeLastName = async event => {\n localData.lastName = event.target.value;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeEmail = event => {\n localData.email = event.target.value;\n setRefreshTrigger(!refreshTrigger);\n // setEmail(event.target.value);\n setChanges(true);\n };\n\n const handleChangeCell = event => {\n localData.cell = formatPhone(event.target.value);\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeVoice = event => {\n localData.voice = formatPhone(event.target.value);\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n\n const handleChangeOffice = event => {\n localData.office = formatPhone(event.target.value);\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeSurrogate = event => {\n let checkNum = event.target.value.replace(/[\\d\\s\\-()]/g, '');\n if (checkNum) { localData.surrogate = event.target.value; }\n else { localData.surrogate = formatPhone(event.target.value); }\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n async function handleSaveTemporaryPhoto(pTarget) {\n let pType;\n if (typeof (pTarget) === 'string') { pType = 'jpg'; }\n else { pType = pTarget.type; }\n let s3Resp = await s3\n .upload({\n Bucket: 'theseus-medical-storage',\n Key: `${patient.person_id}_original.jpg`,\n Body: pTarget,\n ACL: 'public-read-write',\n ContentType: pType\n })\n .promise()\n .catch(err => {\n enqueueSnackbar(`Uh oh! AVA couldn't save your file. The reason is ${err.message}`, { variant: 'error', persist: true });\n });\n cl(s3Resp);\n setEditPhotoKey(s3Resp.Key);\n return s3Resp.Location;\n };\n\n async function handleSavePhoto(pTarget) {\n let extension = pTarget.type.split('/')[1];\n if (extension === 'jpeg') { extension = 'jpg'; }\n const pFile = {\n Bucket: 'theseus-medical-storage',\n Key: 'public/patients/' + patient.person_id + '.' + extension,\n Body: pTarget,\n ACL: 'public-read-write',\n ContentType: pTarget.type\n };\n await s3\n .upload(pFile)\n .promise()\n .catch(err => {\n enqueueSnackbar(`Uh oh! AVA couldn't save your file. The reason is ${err.message}`, { variant: 'error', persist: true });\n });\n let cfParm = {\n DistributionId: 'E3DXPQ4WCODC8A',\n InvalidationBatch: {\n CallerReference: new Date().getTime().toString(),\n Paths: {\n Quantity: 1,\n Items: [`/${patient.person_id}.jpg`]\n }\n }\n };\n\n await cloudfront\n .createInvalidation(cfParm)\n .promise()\n .catch(err => {\n cl({\n 'clearing cache - cloudfront invalidation error': {\n err, cfParm\n }\n });\n enqueueSnackbar(`The new image is saved, but you'll still see the old one for a little while`, { variant: 'warning', persist: false });\n });\n localData.photoURL = await getObject(patient.person_id, 'image');\n setLocalData(localData);\n return;\n };\n\n const handleChangeSearch = event => {\n localData.searchTerm = event.target.value;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeMethod = event => {\n localData.preferred_method = event.target.value;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeDirectoryOption = event => {\n localData.directoryOption = event.target.value;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeEmailPrivacy = event => {\n localData.email_private = !localData.email_private;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeSmsPrivacy = event => {\n localData.sms_private = !localData.sms_private;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeVoicePrivacy = event => {\n localData.voice_private = !localData.voice_private;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeOfficePrivacy = event => {\n localData.office_private = !localData.office_private;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeLocation = event => {\n localData.location = event.target.value;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangePassword = event => {\n localData.inputPWD = event.target.value;\n localData.PWDDisplayed = event.target.value;\n setResettingPwd((event.target.value.length > 0) ? 1 : 0);\n setPwdConfirmed(false);\n setRefreshTrigger(!refreshTrigger);\n };\n\n const handleChangeGroups = updatedGroupArray => {\n setPatientGroups(updatedGroupArray);\n setChanges(true);\n };\n\n const handleChangeLinkedAccounts = updatedResponsibleArray => {\n let finalRespArray = [];\n updatedResponsibleArray.forEach(r => { if (localData.nameObj.hasOwnProperty(r)) { finalRespArray.push(r); } });\n localData.respArray = finalRespArray;\n setResponsibleArray(updatedResponsibleArray);\n patientSession.responsible_for = updatedResponsibleArray;\n setSessionVersion(sessionVersion + 1);\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n };\n\n const handleChangeProxy = event => {\n let newProxy = event.target.value;\n if (!newProxy || newProxy === '') { newProxy = patientSession.user_id; }\n setProxy(newProxy);\n patientSession.patient_id = newProxy;\n setSessionVersion(sessionVersion + 1);\n setChanges(true);\n };\n\n function handleChangeSubscriptionStatus(newStatus) {\n localData.subscription_status = newStatus;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n }\n\n const onChangeMethod = tableRow => event => {\n patient.time_based_rules[tableRow].method = event.target.value;\n setChanges(true);\n };\n\n const onChangeEscalationType = tableRow => event => {\n patient.time_based_rules[tableRow].escalationType = event.target.value;\n setChanges(true);\n };\n\n const onChangeEscalationData = tableRow => event => {\n patient.time_based_rules[tableRow].escalationData = event.target.value;\n setChanges(true);\n };\n\n const onChangeWaitTime = tableRow => event => {\n patient.time_based_rules[tableRow].waitTime = event.target.value;\n setChanges(true);\n };\n\n const onChangeKeyWords = tableRow => event => {\n patient.time_based_rules[tableRow].keyWords = event.target.value;\n setChanges(true);\n };\n\n /*\n function recordExists(recordId) {\n if (!recordId) { return false; }\n if (recordId.hasOwnProperty('Count')) { return (recordId.Count > 0); }\n else { return ((recordId.hasOwnProperty(\"Item\") || recordId.hasOwnProperty(\"Items\"))); }\n }\n */\n\n return (\n (localData.ready && (open || refreshTrigger)) ?\n \n \n \n \n \n \n \n {patient?.name?.first} {patient?.name?.last}\n \n {(changes || pwdConfirmed || photoChanges) && ((resettingPwd === 0) || ((resettingPwd === 2) && pwdConfirmed)) &&\n {\n handleUpdate();\n }}\n variant='contained'\n className={classes.topButton}\n >\n {'Save'}\n }\n \n \n \n \n \n \n \n Profile\n \n \n \n \n \n \n { await handleChangeFirstName(event); }}\n onBlur={async () => { await handleBlurName(); }}\n value={localData.firstName}\n helperText='First'\n />\n { await handleChangeLastName(event); }}\n onBlur={async () => { await handleBlurName(); }}\n value={localData.lastName}\n helperText='Last'\n />\n \n \n { await handleChangeUser(event); }}\n onBlur={async (event) => { await handleBlurUser(event); }}\n helperText='User ID'\n />\n {showQuestionMark && }\n \n \n \n \n \n \n \n \n \n \n \n {' '}\n \n \n \n \n \n \n \n {state?.session?.local_data &&\n (Object.keys(state.session.local_data).length > 0) &&\n \n {Object.keys(state.session.local_data).map((local, lX) => (\n (state.session.local_data[local] !== 'boolean') ?\n {\n switch (state.session.local_data[local]) {\n case 'phone': {\n if (event.target.value) {\n localData.local_data[local] = '+1' + Number(event.target.value.replace(/\\D/g, '')).toString();\n }\n else {\n localData.local_data[local] = '';\n }\n localData.local_data_display[local] = formatPhone(event.target.value);\n break;\n }\n case 'fulldate':\n case 'date': {\n let lDate = makeDate(event.target.value, { noTime: true, noYearCorrection: true });\n if (!lDate.error) { localData.local_data[local] = lDate.numeric$; }\n localData.local_data_display[local] = event.target.value;\n break;\n }\n default: {\n localData.local_data[local] = event.target.value.trim();\n localData.local_data_display[local] = event.target.value;\n }\n }\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n }}\n helperText={local}\n />\n :\n \n \n {local}\n \n No\n {\n if (!localData.local_data) {\n localData.local_data = {};\n localData.local_data[local] = true;\n }\n else {\n localData.local_data[local] = !localData.local_data[local];\n }\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n }}\n name={local}\n color=\"primary\"\n />\n Yes\n \n \n \n ))}\n \n }\n \n Simple option - I prefer to always receive communications via...\n {localData.preferred_method &&\n \n \n } label={AVA} />\n } label={text} />\n } label={e-Mail} />\n } label={home phone} />\n } label={work phone} />\n } label={surrogate} />\n } label={use rules to manage messages} />\n \n \n }\n {localData.preferred_method !== 'time_based' &&\n Urgent messages will re-try this method every 30 minutes for 2 hours\n }\n\n With regard to the Directory...\n {localData.directoryOption &&\n \n \n } label={Include my info} />\n } label={Exclude me} />\n } label={Do not print my info with anyone else's} />\n } label={Merge with another account for printing} />\n \n \n }\n {(localData.directoryOption === 'merge') &&\n \n {(localData.respArray && (localData.respArray.length === 0)) ? 'To merge for printing, first link one or more Accounts in the \"Linked Accounts\" section below' : 'Merge with which linked Account?'}\n \n \n {localData.respArray &&\n localData.respArray.map((presp) => (\n \n }\n label={\n \n {localData.nameObj[presp]}\n }\n />\n ))}\n \n \n \n }\n Please don't share my...\n } label={e-Mail address} />\n } label={Cell number} />\n } label={Home number} />\n } label={Work number} />\n\n \n \n \n\n \n \n \n \n {\n localData.preferred_method === 'time_based' &&\n { setChanges(true); }}\n onChangeMethod={onChangeMethod}\n onChangeEscalationType={onChangeEscalationType}\n onChangeWaitTime={onChangeWaitTime}\n onChangeKeyWords={onChangeKeyWords}\n onChangeEscalationData={onChangeEscalationData}\n numberRows={patient.time_based_rules?.length || 1}\n session={patientSession}\n />\n }\n < Box m={2} >\n \n \n \n Font size\n \n \n \n \n \n \n {\n // setFontFactor(newValue / user_fontSize);\n setUserFontSize(newValue);\n setChanges(true);\n setFontFactorChanged(true);\n }}\n aria-labelledby=\"continuous-slider\"\n step={.1}\n min={1}\n max={5}\n />\n \n \n {`This is the default font size for ${patient?.name?.first} ${patient?.name?.last}`}\n \n \n \n \n\n < Box m={2} >\n \n \n \n Photo\n \n \n \n \n \n \n
    \n \n {!editPhoto &&\n \n \n }\n {editPhoto &&\n \n {\n cropperInstance.rotate(90);\n }}\n >\n Rotate\n \n {\n cropperInstance.destroy();\n setEditPhoto(null);\n setPhotoChanges(false);\n removeTemporaryPhoto();\n setRefreshTrigger(!refreshTrigger);\n }}\n >\n Cancel Edits\n \n {\n setEditPhoto(null);\n setPhotoChanges(true);\n cropperInstance\n .getCroppedCanvas()\n .toBlob((async (pBlob) => {\n let editedPhoto = new File([pBlob], patient.person_id, { type: 'image/jpeg' });\n await handleSavePhoto(editedPhoto);\n }), 'image/jpeg');\n setRefreshTrigger(!refreshTrigger);\n }}\n >\n Save Edits\n \n \n }\n \n {editPhoto &&\n {\n setCropper(instance);\n }}\n />\n }\n {\n if (target.target.files.length > 0) {\n setEditPhoto(await handleSaveTemporaryPhoto(target.target.files[0]));\n }\n }}\n />\n
    \n \n \n {((reactData.options && reactData.options.fullAccess) || (state?.user?.account_class && (['master', 'support'].includes(state.user.account_class))))\n &&\n \n \n \n { handleChangeSubscriptionStatus(newStatus); }}\n version={sessionVersion}\n />\n \n }\n \n \n \n \n Log-in Management\n \n \n \n \n \n
    \n
    \n \n Require a password to log in?\n \n Simplified Log-in\n {\n if (localData.requirePassword) { // you are turning password OFF? If turning ON, SAVE button only after confirmed\n setChanges(true);\n setResettingPwd(0);\n }\n else {\n setResettingPwd((localData.inputPWD.length > 4) ? 1 : -1);\n }\n localData.requirePassword = !localData.requirePassword;\n setRefreshTrigger(!refreshTrigger);\n }}\n name=\"PWDrequired\"\n color=\"primary\"\n />\n Password Required\n \n {localData.requirePassword &&\n \n 0) ? 4 : 0}\n borderColor={(resettingPwd === 1) ? 'red' : (pwdConfirmed ? 'green' : 'orange')}\n >\n 4) ? 'New Password' : 'Enter a password - min 5 characters')}\n />\n {(resettingPwd === 1) &&\n (localData.PWDDisplayed !== '*****') &&\n (localData.PWDDisplayed.length > 4) &&\n {\n handleResetPassword1(localData.inputPWD);\n }}\n variant='outlined'\n className={classes.infoButton}\n >\n {`Tap here to set your password to \"${localData.inputPWD}\"`}\n \n }\n {(resettingPwd === 2) && !pwdConfirmed &&\n {\n handleResetPassword2();\n }}\n variant={'outlined'}\n className={classes.resetButton}\n >\n {`Tap here to confirm \"${localData.inputPWD}\" as your password`}\n \n }\n {pwdConfirmed &&\n \n {`\"${localData.inputPWD}\" will be your new password after you tap SAVE above`}\n \n }\n \n \n }\n Allow my password to be stored\n \n No\n {\n localData.storePassword = !localData.storePassword;\n setRefreshTrigger(!refreshTrigger);\n setChanges(true);\n }}\n name=\"PWDstored\"\n color=\"primary\"\n />\n Yes\n \n {patientPChange &&\n {`Password changed: ${patientPChange.split('GMT')[0]} GMT`}\n }\n \n
    \n
    \n
    \n \n
    \n
    \n :\n \n \n \n \n \n \n \n {patient?.name?.first} {patient?.name?.last}\n \n {(changes || pwdConfirmed || photoChanges) && !editPhoto && ((resettingPwd === 0) || ((resettingPwd === 2) && pwdConfirmed)) &&\n \n \n \n \n \n \n \n Profile\n \n \n \n \n \n \n {`Loading`}\n \n \n \n \n \n \n );\n};\n","import React from 'react';\nimport { Box, Typography } from '@material-ui/core/';\nimport { formatPhone } from '../../util/AVAPeople';\nimport { isEmpty } from '../../util/AVAUtilities';\nimport { makeDate } from '../../util/AVADateTime';\n\nimport { AVATextStyle } from '../../util/AVAStyles';\nimport TextField from '@material-ui/core/TextField';\n\nexport default ({ currentValues, ogValues, errorList, setError, reactData, updateField }) => {\n\n const makeLocation = () => {\n if (currentValues.peopleRec.hasOwnProperty('address')) {\n return Object.values(currentValues.peopleRec.address).join(' ');\n }\n else {\n return '';\n }\n };\n\n return (\n \n \n {\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'name.first',\n newData: event.target.value\n },\n {\n tableName: 'sessionRec',\n fieldName: 'user_display_name',\n newData: (`${event.target.value} ${currentValues.peopleRec?.name?.last}`).trim()\n },\n {\n tableName: 'peopleRec',\n fieldName: 'display_name',\n newData: (`${event.target.value} ${currentValues.peopleRec?.name?.last}`).trim()\n }]\n });\n }}\n defaultValue={currentValues.peopleRec.name ? currentValues.peopleRec?.name?.first : ''}\n helperText='First'\n />\n {\n if (isEmpty(event.target.value) && isEmpty(currentValues.peopleRec.name?.first)) {\n // No name at all. This is an error.\n setError({\n errorField: 'last_name',\n errorValue: '',\n isError: true,\n errorMessage: `Please enter a name`\n });\n return;\n }\n // all good\n // do we need to set a user ID?\n if (ogValues.peopleRec.person_id) { }\n // update the data\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'name.last',\n newData: event.target.value\n },\n {\n tableName: 'sessionRec',\n fieldName: 'user_display_name',\n newData: (`${currentValues.peopleRec?.name.first} ${event.target.value}`).trim()\n },\n {\n tableName: 'peopleRec',\n fieldName: 'display_name',\n newData: (`${currentValues.peopleRec?.name.first} ${event.target.value}`).trim()\n }]\n };\n if (errorList.hasOwnProperty('last_name')) {\n updateObj.errorObj = {\n errorField: 'last_name',\n isError: false\n };\n }\n await updateField(updateObj);\n }}\n defaultValue={currentValues.peopleRec.name ? currentValues.peopleRec.name?.last : ''}\n />\n \n \n {\n let number_part = event.target.value.replace(/\\D/g, '');\n let storage_format;\n if (number_part.length > 0) {\n if (number_part.length <= 6) {\n // Invalid phone number. This is an error.\n setError({\n errorField: 'cell_phone',\n errorValue: event.target.value,\n isError: true,\n errorMessage: `${event.target.value} isn't a valid phone number.`\n });\n return;\n }\n else {\n storage_format = `+1${number_part}`;\n }\n }\n else {\n storage_format = ``;\n }\n // all good\n // update the data\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'messaging.sms',\n newData: storage_format\n },\n {\n tableName: 'peopleRec',\n fieldName: 'contact_info.cell.number',\n newData: storage_format\n }]\n };\n // clear error if one existed\n if (errorList.hasOwnProperty('cell_phone')) {\n updateObj.errorObj = {\n errorField: 'cell_phone',\n isError: false\n };\n }\n await updateField(updateObj);\n }}\n defaultValue={((errorList.hasOwnProperty('cell_phone')) && (errorList.cell_phone.errorValue))\n ? errorList.cell_phone.errorValue\n : (formatPhone(currentValues.peopleRec?.contact_info?.cell?.number\n ? currentValues.peopleRec.contact_info.cell.number\n : (currentValues.peopleRec?.messaging?.sms\n ? currentValues.peopleRec?.messaging?.sms\n : ''\n ))\n )\n }\n />\n {\n let number_part = event.target.value.replace(/\\D/g, '');\n let storage_format;\n if (number_part.length > 0) {\n if (number_part.length <= 6) {\n // Invalid phone number. This is an error.\n setError({\n errorField: 'landline_phone',\n errorValue: event.target.value,\n isError: true,\n errorMessage: `${event.target.value} isn't a valid phone number.`\n });\n return;\n }\n else {\n storage_format = `+1${number_part}`;\n }\n }\n else {\n storage_format = ``;\n }\n // all good\n // update the data\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'messaging.voice',\n newData: storage_format\n },\n {\n tableName: 'peopleRec',\n fieldName: 'contact_info.landline.number',\n newData: storage_format\n }]\n };\n // clear error if one existed\n if (errorList.hasOwnProperty('landline_phone')) {\n updateObj.errorObj = {\n errorField: 'landline_phone',\n isError: false\n };\n }\n await updateField(updateObj);\n }}\n defaultValue={((errorList.hasOwnProperty('landline_phone')) && (errorList.landline_phone.errorValue))\n ? errorList.landline_phone.errorValue\n : (formatPhone(currentValues?.peopleRec?.contact_info?.landline?.number\n ? currentValues?.peopleRec?.contact_info?.landline.number\n : (currentValues?.peopleRec?.messaging?.voice\n ? currentValues.peopleRec.messaging?.voice\n : ''\n ))\n )\n }\n />\n {\n let number_part = event.target.value.replace(/\\D/g, '');\n let storage_format;\n if (number_part.length > 0) {\n if (number_part.length <= 6) {\n // Invalid phone number. This is an error.\n setError({\n errorField: 'work_phone',\n errorValue: event.target.value,\n isError: true,\n errorMessage: `${event.target.value} isn't a valid phone number.`\n });\n return;\n }\n else {\n storage_format = `+1${number_part}`;\n }\n }\n else {\n storage_format = ``;\n }\n // all good\n // update the data\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'messaging.office',\n newData: storage_format\n },\n {\n tableName: 'peopleRec',\n fieldName: 'contact_info.work.number',\n newData: storage_format\n }]\n };\n // clear error if one existed\n if (errorList.hasOwnProperty('work_phone')) {\n updateObj.errorObj = {\n errorField: 'work_phone',\n isError: false\n };\n }\n await updateField(updateObj);\n }}\n defaultValue={((errorList.hasOwnProperty('work_phone')) && (errorList.work_phone.errorValue))\n ? errorList.work_phone.errorValue\n : (formatPhone(currentValues.peopleRec.contact_info?.work?.number\n ? currentValues.peopleRec.contact_info?.work.number\n : (currentValues.peopleRec.messaging?.office\n ? currentValues.peopleRec.messaging?.office\n : ''\n ))\n )\n }\n />\n {\n let number_part = event.target.value.replace(/\\D/g, '');\n let storage_format;\n if (number_part.length > 0) {\n if (number_part.length <= 6) {\n // Invalid phone number. This is an error.\n setError({\n errorField: 'alternate_phone',\n errorValue: event.target.value,\n isError: true,\n errorMessage: `${event.target.value} isn't a valid phone number.`\n });\n return;\n }\n else {\n storage_format = `+1${number_part}`;\n }\n }\n else {\n storage_format = ``;\n }\n // all good\n // update the data\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'contact_info.alternate.number',\n newData: storage_format\n }]\n };\n // clear error if one existed\n if (errorList.hasOwnProperty('alternate_phone')) {\n updateObj.errorObj = {\n errorField: 'alternate_phone',\n isError: false\n };\n }\n await updateField(updateObj);\n }}\n defaultValue={((errorList.hasOwnProperty('alternate_phone')) && (errorList.alternate_phone.errorValue))\n ? errorList.alternate_phone.errorValue\n : (formatPhone(currentValues.peopleRec.contact_info?.alternate?.number\n ? currentValues.peopleRec.contact_info?.alternate.number\n : (currentValues.peopleRec.messaging?.alternate\n ? currentValues.peopleRec.messaging?.alternate\n : ''\n ))\n )\n }\n />\n \n \n {\n if (event.target.value !== '') {\n let [, domain] = event.target.value.split('@');\n let valid = false;\n if (domain) {\n valid = ((domain.split('.')).length > 1);\n }\n if (!valid) {\n // Invalid eMail. This is an error.\n setError({\n errorField: 'email',\n errorValue: event.target.value,\n isError: true,\n errorMessage: `${event.target.value} isn't a valid e-Mail address.`\n });\n return;\n }\n }\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'messaging.email',\n newData: event.target.value\n },\n {\n tableName: 'peopleRec',\n fieldName: 'contact_info.email.address',\n newData: event.target.value\n }]\n };\n // clear error if one existed\n if (errorList.hasOwnProperty('email')) {\n updateObj.errorObj = {\n errorField: 'email',\n isError: false\n };\n }\n await updateField(updateObj);\n }}\n defaultValue={((errorList.hasOwnProperty('email')) && (errorList.email.errorValue))\n ? errorList.email.errorValue\n : (currentValues.peopleRec?.contact_info?.email?.address || currentValues.peopleRec.messaging?.email || '')\n }\n helperText={errorList.hasOwnProperty('email') ? errorList.email.errorMessage : 'e-Mail'}\n />\n \n \n {\n if (event.target.value !== '') {\n let [, domain] = event.target.value.split('@');\n let valid = false;\n if (domain) {\n valid = ((domain.split('.')).length > 1);\n }\n if (!valid) {\n // Invalid eMail. This is an error.\n setError({\n errorField: 'email',\n errorValue: event.target.value,\n isError: true,\n errorMessage: `${event.target.value} isn't a valid e-Mail address.`\n });\n return;\n }\n }\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'contact_info.alt_email.address',\n newData: event.target.value\n }]\n };\n // clear error if one existed\n if (errorList.hasOwnProperty('alt_email')) {\n updateObj.errorObj = {\n errorField: 'alt_email',\n isError: false\n };\n }\n await updateField(updateObj);\n }}\n defaultValue={((errorList.hasOwnProperty('alt_email')) && (errorList.alt_email.errorValue))\n ? errorList.alt_email.errorValue\n : (currentValues.peopleRec?.contact_info?.alt_email?.address || '')\n }\n helperText={errorList.hasOwnProperty('alt_email') ? errorList.alt_email.errorMessage : 'Alternate e-Mail'}\n />\n \n {\n currentValues.peopleRec.address.address = event.target.value;\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'address.address',\n newData: event.target.value\n },\n {\n tableName: 'peopleRec',\n fieldName: 'location',\n newData: makeLocation()\n }]\n };\n await updateField(updateObj);\n }}\n defaultValue={currentValues.peopleRec?.address?.address || ''}\n helperText={'Address'}\n />\n {\n currentValues.peopleRec.address.address2 = event.target.value;\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'address.address2',\n newData: event.target.value\n },\n {\n tableName: 'peopleRec',\n fieldName: 'location',\n newData: makeLocation()\n }]\n };\n await updateField(updateObj);\n }}\n defaultValue={currentValues.peopleRec?.address?.address2 || ''}\n helperText={'Address Line 2'}\n />\n \n {\n currentValues.peopleRec.address.city = event.target.value;\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'address.city',\n newData: event.target.value\n },\n {\n tableName: 'peopleRec',\n fieldName: 'location',\n newData: makeLocation()\n }]\n };\n await updateField(updateObj);\n }}\n defaultValue={currentValues.peopleRec?.address?.city || ''}\n helperText={'City'}\n />\n {\n currentValues.peopleRec.address.state = event.target.value;\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'address.state',\n newData: event.target.value\n },\n {\n tableName: 'peopleRec',\n fieldName: 'location',\n newData: makeLocation()\n }]\n };\n await updateField(updateObj);\n }}\n defaultValue={currentValues.peopleRec?.address?.state || ''}\n helperText={'State'}\n />\n {\n currentValues.peopleRec.address.zip_code = event.target.value;\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'address.zip_code',\n newData: event.target.value\n },\n {\n tableName: 'peopleRec',\n fieldName: 'location',\n newData: makeLocation()\n }]\n };\n await updateField(updateObj);\n }}\n defaultValue={currentValues.peopleRec?.address?.zip_code || ''}\n helperText={'Zip'}\n />\n \n {\n if (!currentValues.peopleRec.hasOwnProperty('emergency_contact')) {\n currentValues.peopleRec.emergency_contact = {};\n }\n currentValues.peopleRec.emergency_contact.contact1 = event.target.value;\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'emergency_contact.contact1',\n newData: event.target.value\n }]\n };\n await updateField(updateObj);\n }}\n defaultValue={currentValues.peopleRec.emergency_contact?.contact1 || ''}\n helperText={'Emergency Contact 1 - Name & Phone'}\n />\n {\n if (!currentValues.peopleRec.hasOwnProperty('emergency_contact')) {\n currentValues.peopleRec.emergency_contact = {};\n }\n currentValues.peopleRec.emergency_contact.contact2 = event.target.value;\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'emergency_contact.contact2',\n newData: event.target.value\n }]\n };\n await updateField(updateObj);\n }}\n defaultValue={currentValues.peopleRec.emergency_contact?.contact2 || ''}\n helperText={'Emergency Contact 2 - Name & Phone'}\n />\n {(Object.keys(reactData.local_customFields).length > 0) && Object.keys(reactData.local_customFields).map((this_customField, cFNdx) => (\n \n {(cFNdx === 0) &&\n \n {`Additional important information`}\n \n }\n \n {\n let local_result = '';\n switch (reactData.local_customFields[this_customField].type) {\n case 'phone': {\n if (event.target.value) {\n local_result = formatPhone(`+1${Number(event.target.value.replace(/\\D/g, '')).toString()}`);\n }\n break;\n }\n case 'number': {\n if (event.target.value) {\n let numeric_result = Number(event.target.value.replace(/\\D/g, ''));\n if (isNaN(numeric_result)) {\n local_result = event.target.value; \n }\n else {\n local_result = numeric_result;\n }\n }\n break;\n }\n case 'fulldate':\n case 'date': {\n let lDate = makeDate(event.target.value, { noTime: true, noYearCorrection: true });\n if (!lDate.error) { local_result = lDate.absolute; }\n else {\n setError({\n errorField: `local_data.${this_customField}`,\n errorValue: event.target.value,\n isError: true,\n errorMessage: `${event.target.value} is not a valid date.`\n });\n return;\n }\n break;\n }\n default: {\n local_result = event.target.value.trim();\n }\n }\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: `local_data.${this_customField}`,\n newData: local_result\n }]\n };\n await updateField(updateObj);\n }}\n defaultValue={currentValues.peopleRec?.local_data?.[this_customField] || ''}\n helperText={reactData.local_customFields[this_customField].prompt}\n />\n \n \n ))}\n\n \n \n {`User ID: ${currentValues.peopleRec.person_id}`}\n \n \n \n );\n};\n","import React from 'react';\nimport { Box, Typography } from '@material-ui/core/';\n\nimport { AVATextStyle } from '../../util/AVAStyles';\n\nexport default ({ currentValues, ogValues, errorList, setError, reactData, updateField }) => {\n\n const focusedSection = React.useRef(null);\n const autoFocus = (element) => {\n if (reactData.focusAt === 'Administrative Data') {\n focusedSection.current.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n });\n }\n };\n\n return (\n \n {(Object.keys(reactData.form_fields).length > 0) && Object.keys(reactData.form_fields).map((this_formField, cFNdx) => (\n \n {reactData.form_fields[this_formField].value &&\n \n \n {`${reactData.form_fields[this_formField].prompt}: `}\n \n \n {reactData.form_fields[this_formField].value}\n \n \n }\n \n ))}\n \n );\n};\n","import React from 'react';\nimport { makeArray, isObject, deepCopy } from '../../util/AVAUtilities';\nimport { getImage } from '../../util/AVAPeople';\n\nimport Paper from '@material-ui/core/Paper';\nimport TextField from '@material-ui/core/TextField';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport CheckIcon from '@material-ui/icons/Check';\n\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport CloseIcon from '@material-ui/icons/Close';\n\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\n\nimport { AVAclasses, AVATextStyle, AVATextVariableStyle, AVADefaults } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n formControl: {\n margin: 0,\n paddingTop: 0,\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n dialogPaper: {\n minHeight: '80vh',\n maxHeight: '80vh',\n minWidth: '600px',\n marginTop: '8vh'\n },\n freeInput: {\n marginLeft: '25px',\n marginRight: 2,\n marginBottom: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: theme.spacing(1),\n width: '60%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n firstName: {\n marginLeft: theme.spacing(1),\n },\n lastName: {\n fontWeight: 'bold',\n },\n groupName: {\n fontWeight: 'bold',\n color: 'red'\n },\n orSeparator: {\n marginTop: theme.spacing(1),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(2),\n fontSize: theme.typography.fontSize * 0.8,\n },\n listItem: {\n justifyContent: 'flex-start',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(1),\n },\n idText: {\n paddingTop: 6,\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(1)\n },\n}));\n\nexport default ({\n prompt,\n peopleList,\n onCancel,\n onSelect,\n allowRandom,\n multiSelect = false,\n splitter = ':',\n alreadyChecked,\n options,\n returnValue = 'ID' // returnValue = 'object' returns object with {id: name, id: name, ...}\n}) => {\n\n const [person_filter, setPersonFilter] = React.useState('');\n const [visible_filter, setVisibleFilter] = React.useState('');\n const [random_address, setRandomAddress] = React.useState('');\n const [rowLimit, setRowLimit] = React.useState(20);\n const [maxY, setMaxY] = React.useState(0);\n const [checkList, setCheckList] = React.useState({});\n // const [selectedNames, setSelectedNames] = React.useState([]);\n\n const [reactData, setReactData] = React.useState({\n peopleList: peopleList || []\n });\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const scrollValue = 20;\n var rowsWritten;\n let toggling = false;\n\n const user_fontSize = AVADefaults({ fontSize: 'get' });\n\n const onScroll = event => {\n let newLimit = rowLimit + scrollValue;\n setRowLimit(newLimit);\n setMaxY(Math.max(maxY, newLimit));\n setForceRedisplay(!forceRedisplay);\n };\n\n async function toggleCheck(pIn) {\n // let tempNames = [];\n if (isChecked(pIn.person_id)) {\n delete checkList[pIn.person_id];\n // let nList = Object.keys(checkList);\n // for (let n = 0; n < nList.length; n++) {\n // tempNames.push(pIn.display_name);\n // }\n }\n else {\n checkList[pIn.person_id] = pIn.display_name;\n // if (selectedNames.length > 0) { tempNames = [...selectedNames]; }\n // tempNames.push(pIn.display_name);\n }\n // setSelectedNames(tempNames);\n setCheckList(checkList);\n setForceRedisplay(!forceRedisplay);\n }\n\n function isChecked(pKey) {\n if (pKey in checkList) { return true; }\n else { return false; }\n }\n\n function formatPhone(match) {\n let formatted = '';\n if (match.length > 7) { formatted += match.slice(-10, -7) + ' '; }\n if (match.length > 4) { formatted += match.slice(-7, -4) + '-'; }\n if (match.length > 0) { formatted += match.slice(-4); }\n return formatted;\n }\n\n const handleChangePersonFilter = event => {\n setVisibleFilter(event.target.value);\n if (!event.target.value) {\n setPersonFilter(null);\n setRandomAddress('');\n }\n let filterInput = event.target.value.trim();\n if (filterInput.includes('@')) { // e-Mail address\n setPersonFilter(filterInput.toLowerCase());\n setRandomAddress(filterInput);\n return;\n }\n var filterNumbers = '' + filterInput.replace(/\\D/g, '').substr(-10); // last 10 digits\n if (filterNumbers.length > 6) { // this will be treated as a phone number\n setPersonFilter(filterNumbers);\n setRandomAddress(formatPhone(filterNumbers));\n return;\n }\n setPersonFilter(filterInput.toLowerCase());\n setRandomAddress('');\n return;\n };\n\n const buildList = async () => {\n let peopleListObj = peopleList.map(this_person => {\n let pObj;\n if (isObject(this_person)) {\n pObj = deepCopy(this_person);\n }\n else {\n let parts = this_person.split(splitter);\n pObj = {\n display_name: parts[0],\n person_id: parts[1],\n searchString: parts[2] || this_person\n };\n }\n if (!pObj.hasOwnProperty('last_name')) {\n let ans = pObj.display_name.split(',');\n switch (ans.length) {\n case 3: {\n pObj.last_name = `${ans[0].trim()}, ${ans[1].trim()}`;\n pObj.first_name = ans[2].trim();\n break;\n }\n case 2: {\n if (ans[1].startsWith('group=')) {\n break;\n }\n else {\n pObj.last_name = ans[0].trim();\n pObj.first_name = ans[1].trim();\n break;\n }\n }\n default: {\n let split_on_whitespace = ans[0].trim().split(/[\\s]+/);\n if (split_on_whitespace.length === 1) {\n pObj.last_name = split_on_whitespace[0];\n pObj.first_name = '';\n }\n else {\n pObj.first_name = split_on_whitespace.shift();\n pObj.last_name = split_on_whitespace.join(' ');\n }\n }\n }\n }\n return pObj;\n });\n updateReactData({\n peopleList: peopleListObj\n }, true);\n };\n\n function okToShow(pLine) {\n if (!pLine) { return false; }\n else if (!isObject(pLine)) { return false; }\n else if (!person_filter || (person_filter.trim() === '')) { return true; }\n else if (pLine.searchString) {\n return (pLine.searchString.toLowerCase().includes(person_filter));\n }\n else if (pLine.search_data) {\n return (pLine.search_data.toLowerCase().includes(person_filter));\n }\n else {\n return true;\n }\n }\n\n React.useEffect(() => {\n async function initialize() {\n if (alreadyChecked) {\n let initial_checklist = {};\n makeArray(alreadyChecked).toReversed().forEach(preselected_person => {\n let foundAt = peopleList.findIndex(this_person => {\n return (this_person.person_id === preselected_person);\n });\n if (foundAt > -1) {\n let foundPerson = deepCopy(peopleList[foundAt]);\n initial_checklist[preselected_person] = peopleList[foundAt].display_name;\n peopleList.splice(foundAt, 1);\n peopleList.unshift(foundPerson);\n }\n else {\n initial_checklist[preselected_person] = 'true';\n }\n });\n setCheckList(initial_checklist);\n }\n await buildList();\n }\n initialize();\n }, [peopleList]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n // **************************\n\n return (\n \n \n \n {prompt}\n \n (handleChangePersonFilter(event))}\n value={visible_filter}\n className={classes.freeInput}\n helperText={'Search for...'}\n inputProps={{ style: { fontSize: `${user_fontSize}rem`, lineHeight: `${user_fontSize * 1.2}rem` } }}\n FormHelperTextProps={{ style: { fontSize: `${user_fontSize * 0.75}rem`, lineHeight: `${user_fontSize * 0.9}rem` } }}\n variant={'standard'}\n autoComplete='off'\n />\n \n \n \n \n {rowsWritten = 0}\n \n {reactData.peopleList.map((listEntry, x) => (\n ((rowsWritten <= rowLimit) && okToShow(listEntry) &&\n {\n if (!multiSelect) {\n if (returnValue === 'id') {\n onSelect(listEntry.person_id);\n }\n else {\n onSelect(`${listEntry.display_name}%%${listEntry.person_id}%%${listEntry.searchString}`);\n }\n }\n else {\n if (!toggling) { await toggleCheck(listEntry); }\n toggling = false;\n }\n }}\n variant='outlined' overflow='auto' square\n >\n \n {rowsWritten++}\n \n \n {multiSelect &&\n {\n toggling = true;\n await toggleCheck(listEntry);\n }}\n />\n }\n \n {!listEntry.person_id.startsWith('GRP//') ?\n \n \n {listEntry.last_name}\n \n \n {listEntry.first_name}\n \n {(x > 0) && (x < (peopleList.length - 1)) &&\n ((peopleList[x - 1].display_name === listEntry.display_name)\n || (peopleList[x + 1].display_name === listEntry.display_name)) &&\n \n ({listEntry.person_id})\n \n }\n {listEntry.conflict && listEntry.conflict.map((conflictEntry, c) => (\n \n {conflictEntry}\n \n ))}\n \n :\n \n \n {listEntry.display_name}\n \n \n }\n \n \n )\n ))}\n {(rowsWritten === 0) && (random_address) &&\n {\n onSelect(`*new:address=${random_address}`);\n }}\n button\n >\n \n {'Someone new'}\n ({random_address})\n \n \n }\n {(rowsWritten === 0) && (!random_address) && (peopleList.length === 0) &&\n \n \n \n {'AVA is still loading'}\n \n \n {'Please try again in a moment.'}\n \n \n \n }\n {(rowsWritten === 0) && (!random_address) && (peopleList.length > 0) &&\n \n \n \n {'No names found'}\n \n \n \n }\n \n \n \n {\n onCancel();\n }}\n startIcon={}\n >\n {'Exit'}\n \n {multiSelect && (rowsWritten > 0) &&\n {\n if (returnValue === 'object') { onSelect(checkList); }\n else { onSelect(Object.keys(checkList)); }\n }}\n startIcon={}\n >\n {'Continue'}\n \n }\n \n \n );\n};\n","import React from 'react';\n\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport List from '@material-ui/core/List';\nimport Paper from '@material-ui/core/Paper';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport Typography from '@material-ui/core/Typography';\nimport CircularProgress from '@material-ui/core/CircularProgress';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport useSession from '../../hooks/useSession';\nimport PersonFilter from '../forms/PersonFilter';\n\nconst useStyles = makeStyles(theme => ({\n formControl: {\n margin: 0,\n paddingTop: 0,\n },\n progressBar: {\n marginBottom: theme.spacing(3),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px'\n },\n formControlLbl: {\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n },\n freeInput: {\n marginLeft: '25px',\n marginTop: '5px',\n marginRight: 2,\n marginBottom: '10px',\n paddingLeft: 0,\n paddingRight: 0,\n width: '90%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n minHeight: theme.typography.fontSize * 2.8,\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n titleText: {\n fontSize: '1.3rem',\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n subDescriptionText: {\n marginLeft: theme.spacing(3),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n },\n\n picture: {\n width: theme.spacing(16),\n height: theme.spacing(16),\n [theme.breakpoints.down('xs')]: {\n width: theme.spacing(8),\n height: theme.spacing(8),\n },\n },\n photoButton: {\n alignSelf: 'center',\n size: 'sm',\n variant: 'outlined',\n verticalAlign: 'middle',\n },\n defaultButton: {\n alignSelf: 'end',\n variant: 'outlined',\n verticalAlign: 'end',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n topButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.primary[theme.palette.type],\n },\n resetButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n marginRight: 10,\n },\n infoButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.info[theme.palette.type],\n marginRight: 10,\n paddingRight: 10,\n marginLeft: 10,\n paddingLeft: 10,\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n listItemAVA: {\n fontSize: theme.typography.fontSize * 1.5,\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 5,\n },\n}));\n\nexport default ({ open, multiSelect = false, onClose, onSelect, pReturnValue = 'ID', options = {} }) => {\n // returnValue = 'object' returns object with {id: name, id: name, ...}\n\n const { state } = useSession();\n const { session } = state;\n const [message_targets, setMessageTargets] = React.useState();\n const [loading, setLoading] = React.useState(true);\n\n const classes = useStyles();\n\n if (loading) {\n let response = [];\n if (state.hasOwnProperty('accessList') && state.accessList.hasOwnProperty(state.session.client_id)) {\n let gResponse = [];\n state.groups.adminHierarchy.forEach(gObj => {\n if (gObj.selectable) {\n if (\n state.session.adminAccount\n ||\n (\n state.accessList[state.session.client_id].groups.hasOwnProperty(gObj.id) &&\n (state.accessList[state.session.client_id].groups[gObj.id] > 1) \n )\n ) {\n gResponse.push(`${gObj.name}:GRP//${gObj.id}`);\n }\n }\n });\n gResponse.sort();\n state.accessList[state.session.client_id].list.forEach(a => {\n // list is of the form ::\n response.push(`${a.last}, ${a.first}:${a.id}:${a.display_name}_${a.location}`);\n });\n if (options) {\n if (options === 'groupOnly') {\n response = gResponse;\n }\n else if (options === 'includeGroups') {\n response = response.concat(gResponse);\n }\n }\n }\n setMessageTargets(response);\n setLoading(false);\n }\n\n /*\n React.useEffect(() => {\n let getTargets = ( // get a list of people a user may send messages to: \n async () => {\n setLoading(true);\n let targetObj = await prepareTargets(session.patient_id, session.client_id, { includeGroups: true });\n setMessageTargets(targetObj.responsibleList.sort());\n setLoading(false);\n }\n );\n getTargets();\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n */\n\n const handleClose = () => {\n if (session) {\n }\n onClose();\n };\n\n return (\n \n {loading &&\n \n \n \n \n \n {`Retrieving Names`}\n {`version ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n \n \n \n \n \n }\n {!loading && message_targets &&\n \n \n \n {\n onClose();\n }}\n onSelect={(selectedPerson) => {\n open = false;\n onSelect(selectedPerson);\n }}\n allowRandom={true}\n returnValue={pReturnValue}\n multiSelect={true}\n />\n \n \n \n }\n \n );\n};\n","import React from 'react';\nimport { sendMessages } from '../../util/AVAMessages';\nimport { makeName, getImage } from '../../util/AVAPeople';\nimport { makeArray, s3, dbClient, isEmpty } from '../../util/AVAUtilities';\nimport { Dialog, DialogContent, DialogActions } from '@material-ui/core';\n\nimport { useSnackbar } from 'notistack';\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport SendIcon from '@material-ui/icons/Send';\nimport CloudUploadIcon from '@material-ui/icons/CloudUpload';\nimport DeleteIcon from '@material-ui/icons/Delete';\n\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Typography from '@material-ui/core/Typography';\n\nimport TextField from '@material-ui/core/TextField';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\n\nimport SendMessageDialog from '../dialogs/SendMessageDialog';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport useSession from '../../hooks/useSession';\n\nimport { AVAclasses, AVATextStyle, AVADefaults } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n containerBox: {\n margin: theme.spacing(2),\n },\n contentBox: {\n minWidth: '100%',\n paddingLeft: theme.spacing(3),\n },\n radius_rounded: {\n borderRadius: '30px',\n overflowX: 'hidden'\n },\n dialogBox: {\n paddingTop: 0,\n paddingLeft: 0,\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n overflowX: 'hidden',\n },\n title: {\n marginTop: 0,\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n fontWeight: 'bold'\n },\n imageArea: {\n minWidth: '100px',\n maxWidth: '100px',\n marginTop: theme.spacing(1),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n },\n buttonArea: {\n justifyContent: 'space-around',\n minWidth: '100%',\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center'\n },\n tightRight: {\n marginRight: 0\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 1,\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n marginBottom: 0,\n marginTop: 0,\n paddingLeft: 0,\n },\n radioHeader: {\n fontSize: theme.typography.fontSize * 0.9,\n fontWeight: 'bold',\n marginLeft: 0,\n marginBottom: 0,\n marginTop: 0,\n paddingLeft: 0,\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n minWidth: '100%',\n marginTop: 10,\n marginBottom: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 0,\n },\n}));\n\nexport default ({\n titleText,\n promptText,\n promptUse,\n buttonText,\n sender,\n pRecipientID,\n pRecipientName,\n onCancel,\n onComplete,\n setUrgent = false,\n setMethod,\n allowCancel = true,\n thread_id,\n options = {},\n seedText\n}) => {\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const { enqueueSnackbar } = useSnackbar();\n const { state } = useSession();\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n const setFocus = React.useRef(null);\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n let rList = makeArray(pRecipientID);\n const [reactData, setReactData] = React.useState({\n recipientID: pRecipientID,\n recipientName: pRecipientName,\n selectID: ((rList.length === 1) ? rList[0] : ''),\n IDImage: ((rList.length === 1) ? getImage(rList[0]) : ''),\n newAccount: false,\n titleText: titleText,\n attachmentList: [],\n textInput: makeArray(seedText) || [],\n promptUsage: checkPrompts(promptText, promptUse),\n HTMLMessage: false,\n viewAsHTML: false,\n multipleRecipients: false,\n nameInput: '',\n isUrgent: setUrgent,\n allowReplyAll: false,\n forceMethod: setMethod,\n imageURL: ''\n });\n\n function checkPrompts(promptText, promptUse) {\n let prompts = makeArray(promptText);\n if (prompts.length > 1) {\n if (!promptUse) {\n return ['subject', 'message', 'voicemail'];\n }\n else {\n return makeArray(promptUse);\n }\n }\n else {\n return ['message'];\n }\n }\n\n React.useEffect(() => {\n if (setFocus && setFocus.current) {\n setFocus.current.focus();\n }\n }, []);\n\n const handleChangeTextInput = (event, x) => {\n if (event.target.value && (event.target.value.length === 1)) {\n reactData.textInput[x] = event.target.value.toUpperCase();\n }\n else {\n reactData.textInput[x] = event.target.value;\n }\n if (reactData.promptUsage[x] === 'message') {\n reactData.HTMLMessage = ((reactData.textInput[x].includes('<')) && (reactData.textInput[x].includes('>')));\n }\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n };\n\n const handleChangeNameInput = (event) => {\n reactData.nameInput = event.target.value;\n reactData.forceRedisplay = !reactData.forceRedisplay;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n };\n\n const hiddenFileInput = React.useRef(null);\n\n const handleFileUpload = event => {\n hiddenFileInput.current.click();\n };\n\n async function handleSaveFile(pTarget) {\n let pType = pTarget.type;\n let s3Resp = await s3\n .upload({\n Bucket: 'theseus-medical-storage',\n Key: pTarget.name,\n Body: pTarget,\n ACL: 'public-read-write',\n ContentType: pType\n })\n .promise()\n .catch(err => {\n enqueueSnackbar(`Uh oh! AVA couldn't save your file. The reason is ${err.message}`, { variant: 'error', persist: true });\n });\n reactData.attachmentList.push(s3Resp);\n reactData.forceRedisplay = !reactData.forceRedisplay;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n return s3Resp;\n };\n\n const noInput = () => {\n return !(makeArray(promptText).every((n, p) => { return (!isEmpty(reactData.textInput[p])); }));\n };\n\n const handleSave = async () => {\n let sendToID = reactData.recipientID;\n let sendToName = reactData.recipientName;\n if (reactData.newAccount) {\n [sendToID, sendToName] = await handleAddAccount();\n reactData.newAccount = false;\n setReactData(reactData);\n }\n console.log(sendToName);\n let senderName = await makeName(state.session.user_id);\n let principalMessageText = '';\n let voiceMailText = '';\n let subjectText = '';\n if (reactData.textInput.length > 1) {\n if (!promptUse) {\n promptUse = ['subject', 'message', 'voicemail'];\n }\n else {\n promptUse = makeArray(promptUse);\n }\n promptUse.forEach((u, n) => {\n if (reactData.textInput[n]) {\n switch (u) {\n case 'subject': { subjectText += ' ' + reactData.textInput[n]; break; }\n case 'voicemail': {\n voiceMailText += ' ' + reactData.textInput[n];\n if (!principalMessageText) {\n principalMessageText = voiceMailText;\n }\n break;\n }\n default: { principalMessageText += ' ' + reactData.textInput[n]; }\n }\n }\n });\n }\n else {\n principalMessageText = reactData.textInput[0];\n }\n if (!subjectText) {\n subjectText = `Message from ${senderName}`;\n }\n else {\n principalMessageText += `\\r\\n\\n(sent by ${senderName})`;\n }\n let request = {\n client: sender.client_id,\n author: state.session.user_id,\n person_id: state.session.patient_id,\n messageText: principalMessageText.trim(),\n recipientList: Array.isArray(sendToID) ? sendToID : [sendToID],\n subject: subjectText.trim()\n };\n if (voiceMailText) {\n request.voiceMail = voiceMailText.trim();\n }\n if (reactData.attachmentList.length > 0) { request.attachments = reactData.attachmentList.map(a => { return a.Location; }); }\n if (reactData.isUrgent) { request.preffered_method = 'urgent'; }\n if (reactData.allowReplyAll) { request.allowReplyAll = true; }\n else if (reactData.forceMethod) { request.preffered_method = reactData.forceMethod; }\n if (thread_id) { request.thread_id = thread_id; }\n let response = await sendMessages(request);\n let resp = makeArray(response);\n enqueueSnackbar(resp[0].message, { variant: (resp[0].sent ? 'success' : 'error') });\n onComplete();\n };\n\n function recordExists(recordId) {\n if (!recordId) { return false; }\n if (recordId.hasOwnProperty('Count')) { return (recordId.Count > 0); }\n else { return ((recordId.hasOwnProperty(\"Item\") || recordId.hasOwnProperty(\"Items\"))); }\n }\n\n async function makeUniqueID(fName, lName, pAddress) {\n if (!lName) {\n if (!fName) { return (new Date().getTime().toString()); };\n lName = fName.slice(1);\n }\n let namePart = fName.charAt(0).toLowerCase() + lName.toLowerCase().replace(/\\W/g, '');\n let queryExpression = {\n KeyConditionExpression: 'client_id = :c AND begins_with(person_id, :p)',\n ExpressionAttributeValues: { ':c': sender.client_id, ':p': namePart },\n ExpressionAttributeNames: { '#n': 'name', '#f': 'first', '#l': 'last' },\n TableName: \"People\",\n IndexName: \"client_id-index\",\n ProjectionExpression: \"person_id, #n.#f, #n.#l, messaging\"\n };\n var checkRecs = await dbClient\n .query(queryExpression)\n .promise()\n .catch(error => {\n console.log({ 'Bad query on People in getGroupMembers - caught error is': error });\n });\n let maxID;\n if (recordExists(checkRecs)) {\n let foundAt = checkRecs.Items.findIndex(rec => {\n let numberPart = rec.person_id.slice(namePart.length).trim();\n if (!numberPart) { maxID = 0; }\n else if (!isNaN(numberPart)) { maxID = Math.max(Number(numberPart), maxID); }\n return (Object.values(rec.messaging).includes(pAddress));\n });\n if (foundAt > -1) { return checkRecs.Items[foundAt].person_id; }\n }\n return namePart + (maxID ? (maxID + 1) : ''); // nothing found...\n }\n\n const handleAddAccount = async () => {\n let fName = reactData.recipientName.split(' ')[0];\n let lName = reactData.recipientName.slice(fName.length).trim();\n let pParse = reactData.recipientID.split('=');\n let pAddress = pParse[pParse.length - 1];\n let isEmail = pAddress.includes('@');\n let isPhone = !isNaN(pAddress);\n let workingID = await makeUniqueID(fName, lName, pAddress);\n\n let putPerson = {\n person_id: workingID,\n client_id: sender.client_id,\n \"name\": {\n first: fName,\n last: lName,\n },\n messaging: {\n email: (isEmail ? pAddress : null),\n sms: (isPhone ? `+1${pAddress}` : null),\n voice: (isPhone ? `+1${pAddress}` : null)\n },\n search_data: reactData.recipientName,\n preferred_method: (isPhone ? 'sms' : 'email'),\n requirePassword: false,\n storePassword: true,\n directory_option: 'normal',\n directory_partner: 'na',\n clients: {\n id: sender.client_id,\n groups: ['*none']\n },\n groups: ['*none'],\n location: `Friend of ${sender.patient_display_name} (${sender.patient_id})`,\n };\n await dbClient\n .put({\n Item: putPerson,\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating People; error is:`, error);\n workingID = null;\n });\n return [workingID, reactData.recipientName];\n };\n\n const onNameEnter = async (event) => {\n if (((event.key === 'Enter') || (event.type === 'blur')) && (reactData.newAccount)) {\n reactData.recipientName = event.target.value;\n reactData.forceRedisplay = !reactData.forceRedisplay;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }\n };\n\n function makeTitle(selectedData) {\n let response = '';\n reactData.multipleRecipients = false;\n if (reactData.forceMethod === 'AVA') { response += 'Send an AVA Alert '; }\n else { response += 'Send a '; }\n if (thread_id) { response += 'reply '; }\n else { response += 'message '; }\n let rArray = makeArray(selectedData.recipientID);\n let nArray = makeArray(selectedData.recipientName);\n if (rArray.length === 1) {\n if (rArray[0].startsWith('GRP//')) {\n reactData.multipleRecipients = true;\n response += `to ${nArray[0]}`;\n }\n else {\n let [last, first] = nArray[0].split(/,/);\n response += `to ${first ? (first + ' ') : ''}${last}`;\n reactData.selectID = rArray[0];\n reactData.IDImage = getImage(rArray[0]);\n }\n }\n else {\n reactData.multipleRecipients = true;\n let random = Math.floor(Math.random() * rArray.length);\n let hasGroups = rArray.some(this_item => {\n return this_item.startsWith('GRP//');\n });\n if (rArray[random].startsWith('GRP//')) {\n response += `to multiple people, including ${nArray[random]}`;\n }\n else {\n let [last, first] = nArray[random].split(/,/);\n response += `to ${hasGroups ? 'multiple' : rArray.length} people, including ${first ? (first + ' ') : ''}${last}`;\n }\n }\n reactData.titleText = response;\n setReactData(reactData);\n return response;\n }\n\n // **************************\n\n return (\n \n {(typeof reactData.recipientID === 'string') && (reactData.recipientID === '*select') &&\n {\n onCancel();\n }}\n multiSelect={true}\n pReturnValue={'object'}\n options={options}\n onSelect={async (selectedPerson) => {\n if (Object.keys(selectedPerson).length < 1) {\n enqueueSnackbar(`Please select at least one name`, { variant: 'error' });\n }\n else {\n reactData.imageURL = null;\n reactData.newAccount = false; // future enhancement\n reactData.recipientID = Object.keys(selectedPerson);\n reactData.recipientName = Object.values(selectedPerson);\n makeTitle(reactData);\n reactData.forceRedisplay = !reactData.forceRedisplay;\n setReactData(reactData);\n }\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n }}\n >\n \n }\n {((typeof reactData.recipientID !== 'string') || (reactData.recipientID !== '*select')) &&\n \n \n \n {reactData.titleText || makeTitle(reactData)}\n \n {(reactData.IDImage) && (!reactData.multipleRecipients) &&\n \n }\n \n \n \n\n \n {reactData.newAccount &&\n {\n handleChangeNameInput(event);\n }}\n onKeyPress={(event) => {\n onNameEnter(event);\n }}\n onBlur={(event) => {\n onNameEnter(event);\n }}\n autoComplete='off'\n />\n }\n {makeArray(promptText).map((p, x) =>\n \n {((reactData.promptUsage[x] === 'message') && reactData.viewAsHTML) ?\n \n :\n {\n handleChangeTextInput(event, x);\n }}\n autoComplete='off'\n />\n }\n \n )}\n {reactData.multipleRecipients &&\n \n \n {\n reactData.allowReplyAll = !reactData.allowReplyAll;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n checked={reactData.allowReplyAll}\n />\n Allow Reply all\n \n \n }\n \n \n {\n reactData.isUrgent = !reactData.isUrgent;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n checked={reactData.isUrgent}\n />\n Mark as Urgent\n \n {reactData.HTMLMessage &&\n \n {\n reactData.viewAsHTML = !reactData.viewAsHTML;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n checked={reactData.viewAsHTML}\n />\n View as HTML\n \n }\n \n {(reactData.attachmentList.length > 0) &&\n \n Attachments:\n {reactData.attachmentList.map((a, x) => (\n \n {\n reactData.attachmentList.splice(x, 1);\n reactData.forceRedisplay = !reactData.forceRedisplay;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n />\n {a.Key}\n \n ))}\n \n }\n \n \n \n \n {allowCancel &&\n {\n onCancel();\n }}\n startIcon={}\n >\n {'Back'}\n \n }\n \n }\n onClick={handleFileUpload}\n >\n {'Attach'}\n \n {\n await handleSaveFile(target.target.files[0]);\n reactData.forceRedisplay = !reactData.forceRedisplay;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n />\n {\n await handleSave();\n onCancel();\n }}\n startIcon={}\n >\n {buttonText}\n \n \n \n \n }\n \n );\n};\n","import React from 'react';\n\nimport useSession from '../../hooks/useSession';\n\nimport { Box, Typography, Button } from '@material-ui/core/';\nimport { formatPhone } from '../../util/AVAPeople';\nimport { deepCopy } from '../../util/AVAUtilities';\nimport { AVATextStyle, AVAclasses } from '../../util/AVAStyles';\nimport SendIcon from '@material-ui/icons/Send';\nimport PhoneInTalkIcon from '@material-ui/icons/PhoneInTalk';\nimport InfoIcon from '@material-ui/icons/Info';\n\nimport PeopleMaintenance from '../dialogs/PeopleMaintenance';\nimport MakeMessage from '../forms/MakeMessage';\n\nexport default ({ currentValues, reactData, updateReactData }) => {\n\n const { state } = useSession();\n const isMounted = React.useRef(false);\n\n const AVAClass = AVAclasses();\n\n const makeLocation = () => {\n if (currentValues.peopleRec.hasOwnProperty('address')) {\n if (!currentValues.peopleRec.address.address1 && currentValues.peopleRec.location) {\n return currentValues.peopleRec.location;\n }\n else {\n return (`${currentValues.peopleRec.address.address1 || ''} ${currentValues.peopleRec.address.city || ''} ${currentValues.peopleRec.address.state || ''}`).trim();\n }\n }\n else {\n return currentValues.peopleRec.location;\n }\n };\n\n React.useEffect(() => {\n async function initialize() {\n let reactUpdObj = {};\n if (!reactData.accessList) {\n if (!state.accessList) {\n if (isMounted.current) {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Still loading Account information',\n message: `AVA is still loading. Wait just a moment and try again, please.`\n }\n }, true);\n }\n }\n else {\n reactUpdObj.accessList = deepCopy(state.accessList[state.session.client_id].list);\n if (!currentValues.peopleRec.hasOwnProperty('proxy_allowed_from')) {\n currentValues.peopleRec.proxy_allowed_from = {};\n reactUpdObj.currentValues = currentValues;\n }\n }\n }\n if (Object.keys(reactUpdObj).length > 0) {\n updateReactData(reactUpdObj, true);\n }\n }\n isMounted.current = true;\n initialize();\n return () => { isMounted.current = false; };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {currentValues.peopleRec.hasOwnProperty('person_notes') &&\n (currentValues.peopleRec.person_notes.length > 0) &&\n (currentValues.peopleRec.person_notes.some(n => { return n.urgent; })) &&\n (currentValues.peopleRec.person_notes.filter(n => { return n.urgent; }).map((this_urgentNote, uNx) => (\n \n \n {this_urgentNote.noteText}\n \n \n {`by ${this_urgentNote.user_name} on ${this_urgentNote.last_update}`}\n \n \n )))\n }\n \n \n \n \n {`${currentValues.peopleRec.name?.first} ${currentValues.peopleRec.name?.last}`}\n \n \n {makeLocation()}\n \n {(Object.keys(reactData.local_customFields).length > 0) && Object.keys(reactData.local_customFields).map((this_customField, cFNdx) => (\n (currentValues.peopleRec?.local_data?.[this_customField] &&\n \n \n {`${reactData.local_customFields[this_customField].prompt}: `}\n \n \n {currentValues.peopleRec?.local_data?.[this_customField]}\n \n \n )\n ))}\n\n \n \n {(currentValues.peopleRec?.contact_info?.cell?.number || currentValues.peopleRec?.messaging?.sms) &&\n \n {`Cell phone: ${(formatPhone(currentValues.peopleRec?.contact_info?.cell?.number\n ? currentValues.peopleRec.contact_info.cell.number\n : (currentValues.peopleRec?.messaging?.sms || '')\n ))}`}\n \n }\n {(currentValues.peopleRec?.contact_info?.work?.number) &&\n \n {`Work phone: ${(formatPhone(currentValues.peopleRec?.contact_info?.work?.number))}`}\n \n }\n {(currentValues.peopleRec?.contact_info?.home?.number) &&\n \n {`Home phone: ${(formatPhone(currentValues.peopleRec?.contact_info?.home?.number))}`}\n \n }\n {(currentValues.peopleRec.emergency_contact?.contact1 || currentValues.peopleRec.emergency_contact?.contact2) &&\n \n {`Emergency contacts:`}\n \n }\n {currentValues.peopleRec.emergency_contact?.contact1 &&\n \n {currentValues.peopleRec.emergency_contact.contact1}\n \n }\n {currentValues.peopleRec.emergency_contact?.contact2 &&\n \n {currentValues.peopleRec.emergency_contact.contact2}\n \n }\n {(currentValues.peopleRec.myFamilyMembers &&\n (currentValues.peopleRec.myFamilyMembers.length > 0)) &&\n \n \n {`${currentValues.peopleRec.name?.first} is responsible for:`}\n \n {Object.keys(currentValues.peopleRec.myFamilyMembers).sort((p1, p2) => {\n if (currentValues.peopleRec.myFamilyMembers[p1].type !== currentValues.peopleRec.myFamilyMembers[p2].type) {\n return ((currentValues.peopleRec.myFamilyMembers[p1].type > currentValues.peopleRec.myFamilyMembers[p2].type) ? 1 : -1);\n }\n else {\n return ((currentValues.peopleRec.myFamilyMembers[p1].name > currentValues.peopleRec.myFamilyMembers[p2].name) ? 1 : -1);\n }\n }).map((this_member, memberNdx) => (\n \n {(currentValues.peopleRec.myFamilyMembers[this_member].type.toLowerCase() === 'camper') &&\n \n {`Camper -`}\n \n }\n {\n updateReactData({\n viewFamilyMember: this_member\n }, true);\n }}\n >\n {`${currentValues.peopleRec.myFamilyMembers[this_member].name}`}\n \n \n ))}\n \n }\n {currentValues.peopleRec.proxy_allowed_from &&\n (Object.keys(currentValues.peopleRec.proxy_allowed_from).length > 0) &&\n reactData.accessList &&\n \n \n {`${currentValues.peopleRec.name?.first}'s Caregiver(s):`}\n \n \n {reactData.accessList.map((this_item, tIndex) => (\n currentValues.peopleRec.proxy_allowed_from.hasOwnProperty(this_item.person_id) &&\n {\n updateReactData({\n viewFamilySnapshot: this_item.person_id\n }, true);\n }}\n style={{ marginLeft: '18px', backgroundColor: 'white', color: 'black' }}\n size='small'\n startIcon={}\n >\n \n \n {`${this_item.first} ${this_item.last}`}\n \n \n \n )\n )}\n \n \n }\n {currentValues.peopleRec.myFamilyMembers &&\n (Object.keys(currentValues.peopleRec.myFamilyMembers).length > 0) &&\n reactData.accessList &&\n \n \n {`${currentValues.peopleRec.name?.first} is a Caregiver for:`}\n \n \n {Object.keys(currentValues.peopleRec.myFamilyMembers).map((this_item, tIndex) => (\n {\n updateReactData({\n viewFamilySnapshot: this_item\n }, true);\n }}\n style={{ marginLeft: '18px', backgroundColor: 'white', color: 'black' }}\n size='small'\n >\n \n \n {`${currentValues.peopleRec.myFamilyMembers[this_item].name}`}\n \n \n \n )\n )}\n \n \n }\n {currentValues.peopleRec.hasOwnProperty('person_notes') &&\n (currentValues.peopleRec.person_notes.length > 0) &&\n (currentValues.peopleRec.person_notes.some(n => { return !n.urgent; })) &&\n \n \n {`Notes:`}\n \n {currentValues.peopleRec.person_notes.filter(n => { return !n.urgent; }).map((this_note, nx) => (\n \n \n {this_note.noteText}\n \n \n {`by ${this_note.user_name} on ${this_note.last_update}`}\n \n \n ))}\n \n }\n\n\n\n {reactData.form_fields && (Object.keys(reactData.form_fields).length > 0) &&\n \n {\n let sectionNdx = reactData.sections.findIndex(s => { return (s.section_name === 'Administrative Data');});\n reactData.sections[sectionNdx].isOpen = true;\n updateReactData({\n focusAt: 'Administrative Data',\n sections: reactData.sections\n }, true);\n }}\n className={AVAClass.AVAButton}\n style={{ marginLeft: 0, backgroundColor: 'red', color: 'white' }}\n size='small'\n startIcon={}\n >\n \n \n {`Admin Data`}\n \n \n \n \n }\n\n\n\n\n\n\n\n\n\n\n\n \n \n {(state.session.user_id !== currentValues.peopleRec.person_id) &&\n {\n updateReactData({\n sendMessage: true\n }, true);\n }}\n className={AVAClass.AVAButton}\n style={{ marginLeft: 0, backgroundColor: 'white', color: 'black' }}\n size='small'\n startIcon={}\n >\n \n \n {`Message`}\n \n \n \n }\n {(state.session.user_id !== currentValues.peopleRec.person_id) &&\n (currentValues.peopleRec.contact_info?.cell.number) &&\n }\n >\n \n \n {`Call Cell`}\n \n \n \n }\n {(state.session.user_id !== currentValues.peopleRec.person_id) &&\n (currentValues.peopleRec.contact_info?.work?.number) &&\n }\n >\n \n \n {`Call Work`}\n \n \n \n }\n \n {(reactData.administrative_account || (state.session.user_id === currentValues.peopleRec.person_id)) &&\n \n \n {`User ID: ${currentValues.peopleRec.person_id}`}\n \n \n }\n \n\n {reactData.sendMessage &&\n {\n updateReactData({\n sendMessage: false\n }, true);\n }}\n onComplete={() => {\n updateReactData({\n sendMessage: false\n }, true);\n }}\n setMethod={null}\n allowCancel={true}\n />\n }\n\n {reactData.viewFamilySnapshot &&\n {\n updateReactData({\n viewFamilySnapshot: false\n }, true);\n }}\n />\n }\n\n {reactData.viewFamilyMember &&\n {\n updateReactData({\n viewFamilyMember: false\n }, true);\n }}\n />\n }\n \n );\n};\n","import { cl, recordExists, dbClient } from './AVAUtilities';\nimport { addDays, makeDate } from './AVADateTime';\n\nexport async function createDocument({ docData, author }) {\n // must have client_id, pertains_to, and form_type/form_id\n if (!docData.client_id) {\n if (docData.client) {\n docData.client_id = docData.client;\n }\n else {\n return false;\n }\n };\n if (!docData.pertains_to) {\n if (docData.person_id) {\n docData.pertains_to = docData.person_id;\n }\n else {\n return false;\n }\n }\n if (!docData.form_type) {\n if (docData.form_id) {\n docData.form_type = docData.form_id;\n delete docData.form_id;\n }\n else if (docData.formType) {\n docData.form_type = docData.formType;\n delete docData.formType;\n }\n else {\n return false;\n }\n }\n const today = makeDate('today');\n let docRec = {\n document_id: `${docData.pertains_to}%%${docData.form_type}%%${today.timestamp}`,\n client_id_form_type: `${docData.client_id}%%${docData.form_type}`,\n history: [\n {\n last_update: today.timestamp,\n status: 'created',\n update_by: author || 'createDocument'\n }\n ],\n status: 'not_started',\n };\n const formData = await documentDueDate(docData.client_id, docData.form_type);\n if (!docData.due_date && formData.due_date) {\n docRec.due_date = formData.due_date;\n }\n if (formData.formRec.restricted_access) {\n docRec.restricted_access = formData.formRec.restricted_access;\n }\n let goodPut = true;\n const docOut = Object.assign({}, docRec, docData);\n await dbClient\n .put({\n Item: docOut,\n TableName: 'DocumentMaster'\n })\n .promise()\n .catch(error => {\n cl(`Bad put to DocumentMaster. Error is: ${error}`);\n goodPut = false;\n });\n return (goodPut ? docOut.document_id : false);\n};\n\nexport async function documentDueDate(client_id, formIn, dueDate_key) {\n let formRec;\n if (typeof (formIn) === 'string') { // passed in a form_id\n let formRecIn = await dbClient\n .get({\n Key: {\n client_id: client_id,\n form_id: formIn\n },\n TableName: \"Forms\"\n })\n .promise()\n .catch(error => {\n cl({ [`in documentDueDate, Error reading Forms key=${formIn}`]: error });\n });\n if (!recordExists(formRecIn) || !formRecIn.Item.due_by) {\n return {\n due_date: false,\n formRec: (recordExists(formRecIn) ? formRecIn.Item : {})\n };\n }\n formRec = formRecIn.Item;\n }\n else if (Array.isArray(formIn)) { // passed in an array of possible due dates\n formRec = { due_by: formIn };\n }\n else {\n formRec = formIn; // passed in a whole form_rec (assumed formIn is an object)\n }\n if (!formRec.due_by) {\n return {\n due_date: false,\n formRec\n };\n }\n // due_by works like this...\n // if due_by is single date and the date is in the future, use that date\n // if due_by is an array of dates, take the nearest date that is in the future\n // if due_by is a number, and docData.dueDate_key exists, add/subtract due_by to docData.dueDate_key\n // if due_by is a number, and no docData.dueDate_key exists, add due_by to today\n let date_assigned = false;\n const today = makeDate('today');\n let temp_dueDate = today.numeric$ + 10000; // one year from today\n for (const this_dueBy of [formRec.due_by].flat()) {\n let candidate = Number(this_dueBy);\n if ((candidate > today.numeric$) && (candidate < temp_dueDate)) { // is it a date in the future that is earlier than the current temp_dueDate?\n temp_dueDate = candidate;\n date_assigned = true;\n }\n else if (candidate < 20000000) { // it is not a date at all\n let checkMe = addDays((dueDate_key || today.date), candidate);\n if (checkMe.numeric$ > today.numeric$) {\n temp_dueDate = checkMe.numeric$;\n date_assigned = true;\n break;\n }\n }\n }\n return {\n due_date: (date_assigned ? temp_dueDate : false),\n formRec\n };\n};\n\nexport async function updateDocument({ docData, author, isNew = false, save_type, url, pending }) {\n // save_type is one of 'final', 'in_process', 'on_timeout', 'printed', 'uploaded'\n if ((save_type === 'uploaded') && !url) {\n return false;\n }\n let docBasis = {};\n const now = new Date().getTime();\n if (!docData.document_id) {\n return false;\n }\n else {\n if (!docData.client_id) {\n if (docData.client) {\n docData.client_id = docData.client;\n }\n else {\n return false;\n }\n };\n if (!docData.pertains_to) {\n if (docData.person_id) {\n docData.pertains_to = docData.person_id;\n }\n else {\n return false;\n }\n }\n if (!docData.form_type) {\n if (docData.form_id) {\n docData.form_type = docData.form_id;\n delete docData.form_id;\n }\n else if (docData.formType) {\n docData.form_type = docData.formType;\n delete docData.formType;\n }\n else {\n return false;\n }\n }\n if (!docData.client_id || !docData.pertains_to || !docData.form_type) {\n let fetchedRec = await dbClient\n .get({\n Key: {\n document_id: docData.document_id\n },\n TableName: \"DocumentMaster\"\n })\n .promise()\n .catch(error => {\n cl(`in updateDocument, bad get to DocumentMaster with ${docData.document_id || '(null)'}. Error is: ${error}`);\n });\n if (recordExists(fetchedRec)) {\n docBasis = fetchedRec.Item;\n }\n }\n else {\n docBasis = {\n document_id: docData.document_id || `${docData.pertains_to}%%${docData.form_type}%%${now}`,\n client_id_form_type: `${docData.client_id}%%${docData.form_type}`,\n history: [\n {\n last_update: now,\n status: 'created',\n update_by: author || 'updateDocument'\n }\n ],\n status: 'not_started',\n };\n }\n }\n let docOut = Object.assign({}, docBasis, docData);\n if (isNew) {\n const formData = await documentDueDate(docOut.client_id, docOut.form_type);\n if (!docOut.due_date && formData.due_date) {\n docOut.due_date = formData.due_date;\n }\n if (formData.formRec.restricted_access) {\n docOut.restricted_access = formData.formRec.restricted_access;\n }\n }\n // save_type is one of 'save_final', 'in_process', 'on_timeout', 'printed', 'uploaded', 'cancelled'\n if (docOut.history[0].status === 'on_timeout') {\n docOut.history.splice(0, 1);\n }\n docOut.history.unshift({\n last_update: now,\n status: pending ? 'pending' : save_type,\n update_by: author || 'updateDocument'\n });\n if (url) {\n docOut.history[0].url = url;\n }\n if (((save_type === 'printed') && !pending) || (save_type === 'uploaded')) {\n docOut.status = 'complete';\n }\n else {\n docOut.status = (pending ? 'pending' : 'in_process');\n }\n let goodPut = true;\n await dbClient\n .put({\n Item: docOut,\n TableName: 'DocumentMaster'\n })\n .promise()\n .catch(error => {\n cl(`Bad put to DocumentMaster. Error is: ${error}`);\n goodPut = false;\n });\n return (goodPut ? docOut : false);\n};","import React from 'react';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport Box from '@material-ui/core/Box';\n\nimport Button from '@material-ui/core/Button';\nimport GoBackIcon from '@material-ui/icons/SettingsBackupRestore';\nimport CheckIcon from '@material-ui/icons/DoneSharp';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport { Typography } from '@material-ui/core';\n\nimport { AVATextStyle } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n title: {\n marginTop: theme.spacing(3),\n marginRight: theme.spacing(2),\n fontSize: theme.typography.fontSize * 1.5,\n fontWeight: 'bold',\n },\n radius_rounded: {\n borderRadius: '30px',\n },\n page: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(4),\n },\n notTitle: {\n marginRight: theme.spacing(2),\n },\n}));\n\nexport default ({ promptText, cancelText = 'Cancel', confirmText = 'Confirm', onCancel, onConfirm, options = {} }) => {\n\n const AVAButton = {\n margin: '8px',\n paddingLeft: '16px',\n paddingRight: '16px',\n borderRadius: '16px',\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n };\n\n function makeLine(str) {\n let work = str.match(/[<[].*?[>\\]]/g);\n if (work && work.length > 0) {\n work.forEach(w => {\n str = str.replace(w, '');\n });\n }\n return str;\n }\n\n function blankLine(p) {\n let a = p.match(/(\\[.+\\])/gm);\n let ans;\n if (!a) {\n ans = p;\n }\n else {\n ans = p.replace(a.pop(), '');\n }\n return (!ans || (ans.trim() === ''))\n }\n\n function makeIndent(str) {\n let a = str.match(/(indent=.)/g);\n if (!a) {\n return '0';\n }\n else {\n return a[0].split('=')[1];\n }\n }\n\n let promptLines = [];\n if (Array.isArray(promptText)) { promptLines = promptText; }\n else { promptLines = [promptText]; }\n\n const classes = useStyles();\n\n // **************************\n\n return (\n \n \n \n {promptLines[0].includes('[bold]')\n ? (promptLines[0].includes('[italic]') ? {makeLine(promptLines[0])} : {makeLine(promptLines[0])})\n : (promptLines[0].includes('[italic]') ? {makeLine(promptLines[0])} : `${makeLine(promptLines[0])}`)\n }\n \n \n \n {promptLines.map((pLine, index) => (\n (index > 0 ?\n (blankLine(pLine)\n ?\n \n :\n \n \n {pLine.includes('[bold]')\n ? (pLine.includes('[italic]') ? {makeLine(pLine)} : {makeLine(pLine)})\n : (pLine.includes('[italic]') ? {makeLine(pLine)} : `${makeLine(pLine)}`)\n }\n \n \n )\n : null)\n ))}\n \n \n {(cancelText !== '*none*') &&\n }\n size='small'\n onClick={() => {\n onCancel();\n }}>\n {cancelText}\n \n }\n {(confirmText !== '*none*') &&\n }\n size='small'\n onClick={() => {\n onConfirm();\n }}>\n {confirmText}\n \n }\n \n \n );\n};\n","import React from 'react';\nimport { useSnackbar } from 'notistack';\nimport { s3, elastictranscoder, makeArray } from '../util/AVAUtilities';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Typography from '@material-ui/core/Typography';\nimport LinearProgress from '@material-ui/core/LinearProgress';\n\nimport TextField from '@material-ui/core/TextField';\n\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport CloudUploadIcon from '@material-ui/icons/CloudUpload';\nimport DeleteIcon from '@material-ui/icons/Delete';\n\nimport Paper from '@material-ui/core/Paper';\nimport Button from '@material-ui/core/Button';\nimport Box from '@material-ui/core/Box';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport { AVAclasses, AVATextStyle, AVADefaults } from '../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n radius_rounded: {\n borderRadius: '30px',\n marginX: 2,\n marginTop: 3\n },\n progressBar: {\n marginBottom: theme.spacing(3),\n marginLeft: theme.spacing(1),\n marginTop: theme.spacing(0.5),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px'\n },\n AVATitle: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n },\n}));\n\nexport default ({ onCancel, onLoad, options = {} }) => {\n\n const AVAClass = AVAclasses();\n const classes = useStyles();\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n // if options.buttonText, use buttontext as follows:\n // [0] - use as default (not shown when no file has been selected yet)\n // [1] - (optional) use when exactly one file has already been selected\n // [2] - (optional) use when more than one file has been selected\n const [reactData, setReactData] = React.useState({\n uploadList: [],\n buttonText: (options.buttonText ? makeArray(options.buttonText)[0] : 'Continue'),\n saving: false,\n focusOn: 0,\n loadProgress: [],\n title: [options.title || 'Upload a File'].flat(),\n attachmentList: (options.allowAttach && options.attachmentList ? options.attachmentList : []),\n });\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n\n const { enqueueSnackbar } = useSnackbar();\n\n const hiddenFileInput = React.useRef(null);\n\n const handleFileUpload = event => {\n hiddenFileInput.current.click();\n };\n\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n const handleChangeTextInput = (event, index) => {\n reactData.uploadList[index].fName = event.target.value;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n };\n\n function loadingInProgress(index = 'all') {\n if (!reactData.loadProgress) {\n return false;\n }\n if (index !== 'all') {\n return (reactData.loadProgress[index] && reactData.loadProgress[index].loading);\n }\n else {\n return (reactData.loadProgress.some(i => {\n return (i.loading);\n }));\n }\n }\n\n let upload;\n async function handleSaveFile(pTarget) {\n let pType = pTarget.type;\n upload = s3.upload({\n partSize: 10 * 1024 * 1024,\n queueSize: 4,\n Bucket: 'theseus-medical-storage',\n Key: pTarget.name,\n Body: pTarget,\n ACL: 'public-read-write',\n ContentType: pType\n });\n let reactData_index = reactData.attachmentList.push({\n Key: pTarget.name\n }) - 1;\n reactData.loadProgress[reactData_index] = {\n loading: true,\n fileName: '',\n total: 1,\n progress: 0\n };\n updateReactData({ loadProgress: reactData.loadProgress }, true);\n let s3Resp = await performUpload();\n reactData.attachmentList[reactData_index] = s3Resp;\n if (!reactData.textInput) { reactData.textInput = { 's3file': s3Resp.Location }; }\n else { reactData.textInput.s3file = s3Resp.Location; }\n let [extension] = pTarget.name.split('.').slice(-1);\n if (options.buttonText && Array.isArray(options.buttonText)) {\n if (options.buttonText[2] && reactData.uploadList.length > 1) {\n reactData.buttonText = options.buttonText[2];\n }\n else { reactData.buttonText = options.buttonText[1]; }\n }\n reactData.loadProgress[reactData_index] = {\n loading: false,\n fileName: '',\n total: 1,\n progress: 0\n };\n if (extension.toLowerCase() === 'mov') {\n var converterParms = {\n PipelineId: '1626108726566-cv5z9u',\n Input: {\n Key: pTarget.name,\n },\n Output: {\n Key: `${pTarget.name.split('.').slice(0, -1).join('.')}.mp4`,\n PresetId: '1351620000001-000001',\n },\n };\n let converterOK = true;\n let data = await elastictranscoder\n .createJob(converterParms)\n .promise()\n .catch(err => {\n enqueueSnackbar(`Conversion unsuccessful`, { variant: 'failure', persist: true });\n converterOK = false;\n });\n if (false) { console.log(data); }\n if (converterOK) {\n s3Resp.Location = `${s3Resp.Location.split('.').slice(0, -1).join('.')}.mp4`;\n extension = 'mp4';\n }\n }\n reactData.uploadList.push({ fName: pTarget.name, fType: extension, fLoc: s3Resp.Location });\n updateReactData({\n loadProgress: reactData.loadProgress,\n attachmentList: reactData.attachmentList,\n textInput: reactData.textInput,\n uploadList: reactData.uploadList,\n buttonText: reactData.buttonText\n }, true);\n return s3Resp;\n\n function performUpload() {\n return new Promise(function (resolve, reject) {\n upload\n .send((err, good) => {\n if (err) {\n if (err.code === 'RequestAbortedError') {\n enqueueSnackbar(`AVA stopped loading at your request.`, { variant: 'error', persist: false });\n }\n else {\n enqueueSnackbar(`Uh oh! AVA couldn't save your file. The reason is ${err.message}`, { variant: 'error', persist: true });\n }\n reject({});\n }\n else {\n resolve(good);\n }\n });\n upload.on('httpUploadProgress', progress => {\n if (reactData.loadProgress[reactData_index].loading === 'abort') {\n upload.abort();\n reactData.loadProgress.splice(reactData_index, 1);\n }\n else {\n let pFactor = 1000;\n do {\n pFactor *= 10;\n }\n while (progress.total > (1000 * pFactor));\n let adjust = (progress.total / pFactor) / (window.window.innerWidth * .8);\n pFactor = pFactor * adjust;\n reactData.loadProgress[reactData_index] = {\n loading: true,\n fileName: progress.key,\n total: (progress.total / pFactor),\n progress: ((progress.loaded * 100) / progress.total)\n };\n }\n updateReactData({ loadProgress: reactData.loadProgress }, true);\n });\n });\n };\n };\n\n /****** FOR FUTURE REFERENCE\n * THIS CODE SUPPORT MULTI-PART UPLOADS\n async function handleMultiPartUpload(pTarget) {\n try {\n // Multipart upload will pass chunks of 10Mb\n let partSize = 10000000;\n let numberOfParts = 10;\n if (fileSize > (partSize * numberOfParts)) { partSize = fileSize / 10; }\n else { numberOfParts = Math.ceil(fileSize / partSize); }\n\n if ((numberOfParts === 1) || forceSingle) {\n enqueueSnackbar(`AVA is saving your ${pType.toLowerCase()} with the name ${pMediaData.Key}`, { variant: 'info', persist: false });\n let uploadOK = true;\n await s3\n .putObject(pMediaData)\n .promise()\n .catch(err => {\n uploadOK = false;\n enqueueSnackbar(`Uh oh! AVA couldn't save that. The reason is ${err.message}`,\n { variant: 'error', persist: true });\n });\n if (uploadOK) {\n closeSnackbar();\n enqueueSnackbar(`${pMediaData.Key} was saved successfully`, { variant: 'success', persist: true });\n return pMediaData.Key;\n };\n return null;\n }\n\n // this is a multi-part load\n enqueueSnackbar(`AVA broke your ${pType.toLowerCase()} with the name ${pMediaData.Key} into ${numberOfParts} pieces and is uploading them now`, { variant: 'info', persist: false });\n let upParms = {\n Bucket: pMediaData.Bucket,\n Key: pMediaData.Key,\n ACL: pMediaData.ACL,\n ContentType: pMediaData.ContentType,\n Metadata: pMediaData.MetaData\n };\n let mpUp = await s3.createMultipartUpload(upParms).promise();\n uploadId = mpUp.UploadId;\n\n const uploadPromises = [];\n // Upload each part.\n for (let i = 0; i < numberOfParts; i++) {\n const start = i * partSize;\n const end = start + partSize;\n let uPartParm = {\n Bucket: pMediaData.Bucket,\n Key: pMediaData.Key,\n UploadId: uploadId,\n Body: buffer.subarray(start, end),\n PartNumber: i + 1,\n };\n uploadPromises.push(s3.uploadPart(uPartParm).promise());\n }\n\n const uploadResults = await Promise.all(uploadPromises);\n let upDone = {\n Bucket: pMediaData.Bucket,\n Key: pMediaData.Key,\n UploadId: uploadId,\n MultipartUpload: {\n Parts: uploadResults.map(({ ETag }, i) => ({\n ETag,\n PartNumber: i + 1,\n })),\n }\n };\n let s3Resp = await s3.completeMultipartUpload(upDone).promise();\n enqueueSnackbar(`All parts of ${s3Resp.Key} were saved successfully to ${s3Resp.Location}`, { variant: 'success', persist: true });\n return pMediaData.Key;\n\n // Verify the output by downloading the file from the Amazon Simple Storage Service (Amazon S3) console.\n // Because the output is a 25 MB string, text editors might struggle to open the file.\n }\n catch (err) {\n console.error(err);\n enqueueSnackbar(`That didn't work. ${err}`, { variant: 'error', persist: true });\n if (uploadId) {\n let s3Bad = await s3.abortMultipartUpload({\n Bucket: pMediaData.Bucket,\n Key: pMediaData.Key,\n UploadId: uploadId,\n }).promise();\n console.log(s3Bad);\n }\n }\n */\n\n const handleSave = () => {\n onLoad(reactData.uploadList);\n };\n\n return (\n \n \n {[options.title || 'Upload a File'].flat().map((this_title, ndx) => (\n \n {this_title}\n \n ))}\n \n \n \n {(reactData.uploadList.length > 0) && false &&\n \n {reactData.uploadList.map((fObj, cIndex) => (\n \n \n \n {\n handleChangeTextInput(event, cIndex);\n }}\n autoComplete='off'\n />\n \n {\n reactData.uploadList.splice(cIndex, 1);\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n />\n \n \n ))}\n \n }\n {(reactData.attachmentList && reactData.attachmentList.length > 0) &&\n \n \n {`File${(reactData.attachmentList.length > 1) ? 's' : ''}:`}\n \n {reactData.attachmentList.map((a, x) => (\n \n \n \n {\n reactData.attachmentList.splice(x, 1);\n reactData.forceRedisplay = !reactData.forceRedisplay;\n if (loadingInProgress(x)) {\n reactData.loadProgress[x].loading = 'abort';\n }\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n }}\n />\n \n {`${a.Key} - ${loadingInProgress(x) ? ((Math.floor((reactData.loadProgress[x].progress) * 100) / 100).toString() + '%') : 'Done!'}`}\n \n {!loadingInProgress(x) && }\n \n {loadingInProgress(x) &&\n \n \n \n }\n \n \n ))}\n \n }\n \n \n \n \n onCancel()}\n startIcon={}\n >\n {`${loadingInProgress('all') ? 'Stop/' : ''}Exit`}\n \n \n {(!options.oneOnly || (reactData.uploadList.length === 0)) &&\n \n }\n onClick={handleFileUpload}\n >\n {`Choose ${(reactData.uploadList.length === 0) ? 'a file' : 'more'}`}\n \n {\n let s3Data = await handleSaveFile(target.target.files[0]);\n console.log(s3Data);\n }}\n />\n \n }\n {(reactData.uploadList.length > 0) &&\n {\n handleSave();\n }}\n startIcon={}\n >\n {reactData.buttonText}\n \n }\n \n \n \n \n \n \n );\n};","import React from 'react';\n\nimport { dbClient, cl, makeArray, deepCopy, isEmpty, getDb, sentenceCase, listFromArray, array_in_array, recordExists, isObject, titleCase, uuid, isMobile } from '../../util/AVAUtilities';\nimport { AVAclasses, AVATextStyle } from '../../util/AVAStyles';\nimport { formatPhone, getPerson, makeName } from '../../util/AVAPeople';\nimport { makeDate } from '../../util/AVADateTime';\nimport AVAConfirm from './AVAConfirm';\nimport AVAUploadFile from '../../util/AVAUploadFile';\n\nimport { sendMessages } from '../../util/AVAMessages';\nimport { printDocumentB, printEmptyDocument, printDocumentHybrid } from '../../util/AVAMessages';\nimport SignatureCanvas from 'react-signature-canvas';\nimport Select from \"react-dropdown-select\";\nimport CloudUploadIcon from '@material-ui/icons/CloudUpload';\nimport PrintIcon from '@material-ui/icons/Print';\nimport { Dialog, DialogContent, Snackbar, Box, Typography, FormControlLabel, Button, TextField, Checkbox } from '@material-ui/core';\nimport { Alert, AlertTitle } from '@material-ui/lab/';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport AVA_AlertSound from '../../ava_alert.mp3';\nimport useSound from 'use-sound';\n\nimport useSession from '../../hooks/useSession';\nimport { useIdleTimer } from 'react-idle-timer';\nimport { updateDocument, createDocument } from '../../util/AVADocuments';\n\nconst useStyles = makeStyles(theme => ({\n dialogBox: {\n paddingTop: 0,\n paddingLeft: 0,\n paddingBottom: theme.spacing(1),\n overflowX: 'hidden',\n marginLeft: theme.spacing(2),\n },\n buttonArea: {\n justifyContent: 'space-around',\n minWidth: '100%',\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center'\n },\n formControl: {\n margin: 0,\n paddingTop: 0,\n paddingBottom: 0,\n },\n formControlCheckGroup: {\n marginTop: 0,\n paddingTop: 0,\n },\n formControlTitle: {\n margin: 0,\n marginLeft: 0,\n marginRight: '2px',\n paddingTop: '16px',\n paddingBottom: 0,\n fontSize: theme.typography.fontSize * 0.8,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: 0,\n marginBottom: 0,\n },\n imageArea: {\n minWidth: '150px',\n maxWidth: '150px'\n },\n formControlDays: {\n margin: 0,\n marginLeft: '-8px',\n marginRight: '2px',\n height: 1,\n fontSize: theme.typography.fontSize * 0.8,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: '10px',\n marginBottom: '25px',\n },\n radioDays: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: '-8px',\n marginRight: '16px',\n '&.MuiInputBase-input': {\n paddingBottom: '0px'\n }\n },\n clientBackground: {\n borderRadius: '30px',\n maxWidth: '95%',\n paddingLeft: '4px',\n paddingRight: '4px',\n marginLeft: '4px',\n marginRight: '4px'\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n breakRow: {\n flexBasis: '100%',\n height: 0\n },\n inputDisplay: {\n '&.MuiInputBase-input': {\n paddingBottom: '0px',\n color: 'red'\n },\n '&.MuiInput-input': {\n paddingBottom: '22px',\n color: 'red'\n },\n '&.MuiInputBase-root': {\n 'Mui-disabled': {\n color: 'black'\n }\n }\n }\n}));\n\nexport default ({ request = {}, onClose }) => {\n const classes = useStyles();\n const AVAClass = AVAclasses();\n const signatureRef = [React.useRef(null), React.useRef(null), React.useRef(null)];\n\n const { state } = useSession();\n\n let options = {};\n if (Array.isArray(request)) {\n request.forEach((req) => {\n if (typeof (req) === 'string') {\n let [key, value] = req.split('=');\n options[key] = value;\n }\n else {\n Object.assign(options, req);\n }\n });\n }\n else if (typeof (request) === 'string') {\n options.document_id = request;\n options.form_id = request;\n }\n else {\n options = Object.assign({}, request);\n }\n\n const [play] = useSound(AVA_AlertSound, { volume: 1 });\n\n const nowObj = new Date();\n\n const [reactData, setReactData] = React.useState({\n form_id: options.form_id,\n options,\n document_id: options.document_id,\n document_title: options.document_title,\n fields: {},\n /* \n fields is keyed by field_name: {\n prompt:\n type:\n value:\n valueText:\n selectionObj:\n options:\n isError: \n errorMessage:\n }\n */\n sections: {},\n /* \n sections comes directly from FormRec.sections and describes the sequence: [{\n sectionName:\n fields: []\n }]\n */\n formRec: {},\n sessionRec: {},\n peopleRec: {},\n docRec: {},\n familyRec: false,\n family_id: options.family_id || false,\n newPerson: false,\n newFamily: false,\n stage: 'initialize',\n messageList: ['In progress'],\n errorsOnForm: 0,\n formUpdates: 0,\n lastActiveTime: nowObj,\n version: 1,\n idleState: false,\n pertains_to: options.person_id,\n clientSampleMode: (!options.person_id || (options.person_id === state.session.client_id))\n });\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) {\n setForceRedisplay(!forceRedisplay);\n }\n };\n\n const isInitializing = () => {\n return ((reactData.stage === 'still_initializing') || (reactData.stage === 'initialize'));\n };\n\n const valuesChanged = () => {\n return !!reactData.formUpdates;\n };\n\n const oneMinute = 1000 * 60;\n const msBeforeSleeping = 1 * oneMinute;\n\n function onAction() {\n let now = new Date();\n if ((reactData.idleState) || ((now.getTime() - reactData.lastActiveTime.getTime()) > oneMinute)) {\n cl(`Action/Update at ${now.toLocaleString()}. Last active at ${reactData.lastActiveTime.toLocaleString()}`);\n updateReactData({\n lastActiveTime: now,\n idleState: false,\n }, false);\n }\n reset();\n };\n\n const onIdle = async () => {\n let now = new Date();\n let minutesSinceActive = 0;\n let reactUpdObj = {\n idleState: true,\n enteredIdleStateTime: now,\n };\n if (!reactData.idleState) {\n // if we weren't previously in an idle state and we are now...\n if (!isInitializing && valuesChanged) {\n cl(`Auto save at ${now.toLocaleString()}.`);\n let response = await handleSave({\n document_id: reactData.document_id,\n final: false,\n timeout: true\n });\n if (response.goodPut) {\n reactUpdObj.formUpdates = 0;\n reactUpdObj.document_id = response.document_id;\n reactUpdObj.recWritten = response.recWritten;\n }\n }\n updateReactData(reactUpdObj, true);\n }\n else {\n minutesSinceActive = Math.floor((now.getTime() - reactData.enteredIdleStateTime.getTime()) / oneMinute);\n cl(`Still idle at ${new Date().toLocaleString()}. Idle for ${minutesSinceActive} minutes.`);\n }\n if (minutesSinceActive > 5) {\n onClose('timeout', {\n document_id: reactData.document_id,\n document_title: reactData.document_title,\n document_status: (reactData.clientSampleMode ? 'cancel' : 'work_in_process'),\n pertains_to: reactData.pertains_to,\n recWritten: reactData.recWritten\n });\n }\n else if (minutesSinceActive > 3) {\n updateReactData({\n alert: {\n severity: 'info',\n title: `Are you there?`,\n message:
    We haven't heard from you in over {minutesSinceActive} minutes.
    \n We'll automatically {reactData.clientSampleMode ? '' : 'save your work and '} close this form in {5 - minutesSinceActive} minutes.
    \n To keep this form active, just move your mouse or tap somewhere.
    \n }\n }, true);\n }\n else if (minutesSinceActive === 5) {\n play();\n updateReactData({\n alert: {\n severity: 'warning',\n title: `Close imminent`,\n message:
    Heads up! We'll automatically {reactData.clientSampleMode ? '' : 'save your work and '} close this form in 1 minute!
    \n To keep this form active, just move your mouse or tap somewhere.
    \n }\n }, true);\n }\n reset();\n };\n\n const { start, reset } = useIdleTimer({\n onIdle,\n onAction,\n timeout: msBeforeSleeping,\n throttle: 500\n });\n\n // **************************\n\n const setFieldDefault = async ({ this_field }) => {\n let response = {};\n // Set default value\n const defaultObj = {};\n if (!reactData.formRec.fields.hasOwnProperty(this_field)) {\n const formFieldRec = await getDb({\n Key: {\n client_id: state.session.client_id,\n field_name: this_field\n },\n TableName: \"Form_Fields\"\n });\n if (formFieldRec) {\n reactData.formRec.fields[this_field] = formFieldRec;\n updateReactData({\n formRec: reactData.formRec\n }, false);\n }\n else {\n response.ignore = true;\n return response;\n }\n }\n if (reactData.formRec.fields[this_field].default) {\n if (reactData.formRec.fields[this_field].default.source) {\n let sourceDefaults = [];\n if (Array.isArray(reactData.formRec.fields[this_field].default.source)) {\n sourceDefaults = reactData.formRec.fields[this_field].default.source;\n }\n else {\n sourceDefaults = [reactData.formRec.fields[this_field].default.source];\n }\n for (const this_default of sourceDefaults) {\n // if defaultObj has a source, the source is going to tell you where to find the default data\n // this should be EITHER an array OR a string; we want to make an array out of it\n defaultObj.source_path = makeArray(this_default, '.');\n const source_file = defaultObj.source_path.shift();\n if (source_file.toLowerCase().startsWith('session')) {\n if (!reactData.sessionRec[reactData.pertains_to]) {\n reactData.sessionRec[reactData.pertains_to] = await getDb({\n Key: {\n session_id: reactData.pertains_to\n },\n TableName: \"SessionsV2\"\n });\n updateReactData({\n sessionRec: reactData.sessionRec\n }, false);\n }\n response.value = resolve({\n object: reactData.sessionRec[reactData.pertains_to],\n key: defaultObj.source_path\n });\n }\n else if ((source_file.toLowerCase().startsWith('person'))\n || (source_file.toLowerCase().startsWith('people'))) {\n response.value = resolve({\n object: reactData.peopleRec[reactData.pertains_to],\n key: defaultObj.source_path\n });\n }\n else if (source_file.startsWith('family')) {\n // we need to get the familyRec; do we have it already?\n if (source_file.toLowerCase().startsWith('family')) {\n if (!reactData.familyRec && reactData.family_id) {\n reactData.familyRec = await getDb({\n Key: {\n client_id: state.session.client_id,\n composite_key: reactData.family_id\n },\n TableName: \"FamilyGroups\"\n });\n updateReactData({\n familyRec: reactData.familyRec\n }, false);\n }\n }\n if (reactData.familyRec) {\n response.value = resolve({\n object: reactData.familyRec,\n key: defaultObj.source_path\n });\n }\n }\n else if (source_file.toLowerCase().startsWith('user')) {\n if (!reactData.peopleRec[state.session.user_id]) {\n reactData.peopleRec[state.session.user_id] = await getDb({\n Key: {\n person_id: state.session.user_id\n },\n TableName: \"People\"\n });\n updateReactData({\n peopleRec: reactData.peopleRec\n }, false);\n }\n response.value = resolve({\n object: reactData.peopleRec[state.session.user_id],\n key: defaultObj.source_path\n });\n }\n else if (source_file.startsWith('formData')) {\n if (reactData.options.hasOwnProperty('formData') && defaultObj.source_path[0]) {\n response.value = reactData.options.formData[defaultObj.source_path[0]];\n }\n }\n if (response.value) {\n break;\n }\n }\n }\n if (!response.value && reactData.formRec.fields[this_field].default.value) {\n defaultObj.value_path = makeArray(reactData.formRec.fields[this_field].default.value, '.');\n if (defaultObj.value_path[0].toLowerCase() === 'date') {\n response.value = makeDate(defaultObj.value_path[1], { notime: true })[defaultObj.value_path[2]];\n }\n else if (defaultObj.value_path[0].toLowerCase() === 'time') {\n response.value = makeDate(defaultObj.value_path[1])[defaultObj.value_path[2]];\n }\n else if (defaultObj.value_path[0].toLowerCase() === 'name') {\n let pertains_to;\n if (['person', 'patient', 'pertains', 'pertain_to'].includes(defaultObj.value_path[1])) {\n pertains_to = reactData.pertains_to;\n }\n else if (defaultObj.value_path[1] === 'user') {\n pertains_to = state.session.user_id;\n }\n else {\n pertains_to = defaultObj.value_path[1];\n }\n response.value = makeName(pertains_to);\n }\n else if (defaultObj.value_path[0].toLowerCase() === 'makenewaccount') {\n response.value = await makeNewUser({\n tableDefaults: reactData.formRec.fields[this_field].default.tables,\n });\n }\n else if (defaultObj.value_path[0].toLowerCase() === 'field') {\n if (defaultObj.value_path[1]) {\n response.value = reactData.fields[defaultObj.value_path[1]].value;\n }\n }\n else if (defaultObj.value_path.length === 1) {\n response.value = defaultObj.value_path[0];\n }\n }\n }\n else if (reactData.fields[this_field]?.prompt && reactData.fields[this_field]?.prompt?.value) {\n if (['image', 'html'].includes(reactData.fields[this_field]?.value.type || reactData.fields[this_field]?.default?.type)) {\n response.value = reactData.fields[this_field]?.prompt?.value;\n }\n }\n if (!response.value) {\n response.value = null;\n }\n // if prompt.ignore_if exists, check the value\n if (reactData.fields[this_field]?.prompt?.ignore_if) {\n response.ignore = false;\n const ignoreList = makeArray(reactData.fields[this_field]?.prompt?.ignore_if);\n if (!response.value) {\n if (ignoreList.includes('%%no_data%%')) {\n response.ignore = true;\n return response;\n }\n }\n else if (array_in_array(ignoreList, response.value)) {\n response.ignore = true;\n return response;\n }\n }\n return response;\n };\n\n const initializeBlank = async ({ form_id }) => {\n const formRec = await getDb({\n Key: {\n client_id: state.session.client_id,\n form_id\n },\n TableName: \"Forms\"\n });\n if (!formRec) {\n return {\n fields: {},\n sections: []\n };\n }\n updateReactData({\n peopleRec: {},\n formRec\n }, false);\n let response = {\n fields: {},\n sections: formRec.sections,\n document_title: `${formRec.form_name}`\n };\n for (let this_section of response.sections) {\n this_section.section_name = await resolveVariables(this_section.section_name);\n let field_variables = {};\n let field_key;\n // for (let this_field of this_section.fields) {\n for (let [index, this_field] of this_section.fields.entries()) {\n if (isObject(this_field)) {\n field_variables = Object.assign({}, this_field);\n field_key = this_field.form_field;\n this_field = this_field.field_name;\n this_section.fields[index] = this_field;\n }\n response.fields[this_field] = {};\n // Set default value\n const defaultObj = {};\n if (!formRec.fields.hasOwnProperty(this_field)) {\n const formFieldRec = await getDb({\n Key: {\n client_id: state.session.client_id,\n field_name: field_key || this_field\n },\n TableName: \"Form_Fields\"\n });\n if (formFieldRec) {\n if (field_variables.prompt) {\n formFieldRec.prompt.value = field_variables.prompt;\n }\n if (field_variables.default_source && formFieldRec.default.source && formFieldRec.default.source.startsWith('%%')) {\n formFieldRec.default.source = field_variables.default_source;\n }\n if (field_variables.saveAs && formFieldRec.value.saveAs && formFieldRec.value.saveAs.startsWith('%%')) {\n formFieldRec.value.saveAs = field_variables.saveAs;\n }\n formRec.fields[this_field] = formFieldRec;\n updateReactData({\n formRec\n }, false);\n }\n else {\n response.fields[this_field].ignore = true;\n continue;\n }\n }\n if (formRec.fields[this_field].default) {\n if (formRec.fields[this_field].default.source) {\n let sourceDefaults = [];\n if (Array.isArray(formRec.fields[this_field].default.source)) {\n sourceDefaults = formRec.fields[this_field].default.source;\n }\n else {\n sourceDefaults = [formRec.fields[this_field].default.source];\n }\n for (const this_default of sourceDefaults) {\n defaultObj.source_path = makeArray(this_default, '.');\n const source_file = defaultObj.source_path.shift();\n if (source_file.toLowerCase().startsWith('session')) {\n response.fields[this_field].value = '';\n }\n else if ((source_file.toLowerCase().startsWith('person')) || (source_file.toLowerCase().startsWith('people'))) {\n response.fields[this_field].value = '';\n }\n else if (source_file.startsWith('family')) {\n response.fields[this_field].value = '';\n }\n else if (source_file.toLowerCase().startsWith('user')) {\n if (!reactData.peopleRec[state.session.user_id]) {\n reactData.peopleRec[state.session.user_id] = await getDb({\n Key: {\n person_id: state.session.user_id\n },\n TableName: \"People\"\n });\n updateReactData({\n peopleRec: reactData.peopleRec\n }, false);\n }\n response.fields[this_field].value = resolve({\n object: reactData.peopleRec[state.session.user_id],\n key: defaultObj.source_path\n });\n }\n else if (source_file.startsWith('formData')) {\n if (reactData.options.hasOwnProperty('formData') && defaultObj.source_path[0]) {\n response.fields[this_field].value = reactData.options.formData[defaultObj.source_path[0]];\n }\n }\n if (response.fields[this_field].value) {\n break;\n }\n }\n }\n if (!response.fields[this_field].value && formRec.fields[this_field].default.value) {\n defaultObj.value_path = makeArray(formRec.fields[this_field].default.value, '.');\n if (defaultObj.value_path[0].toLowerCase() === 'date') {\n response.fields[this_field].value = makeDate(defaultObj.value_path[1], { notime: true })[defaultObj.value_path[2]];\n }\n else if (defaultObj.value_path[0].toLowerCase() === 'time') {\n response.fields[this_field].value = makeDate(defaultObj.value_path[1])[defaultObj.value_path[2]];\n }\n else if (defaultObj.value_path[0].toLowerCase() === 'name') {\n if (['person', 'patient', 'pertains', 'pertain_to'].includes(defaultObj.value_path[1])) {\n response.fields[this_field].value = makeName(reactData.pertains_to);\n }\n else if (defaultObj.value_path[1] === 'user') {\n response.fields[this_field].value = makeName(state.session.user_id);\n }\n else {\n response.fields[this_field].value = '';\n }\n }\n else if (defaultObj.value_path[0].toLowerCase() === 'makenewaccount') {\n response.fields[this_field].value = response.value = await makeNewUser({\n tableDefaults: formRec.fields[this_field]?.default?.tables,\n });\n }\n else if (defaultObj.value_path.length === 1) {\n response.fields[this_field].value = defaultObj.value_path[0];\n }\n }\n }\n else if (formRec.fields[this_field]?.prompt && formRec.fields[this_field]?.prompt?.value) {\n if (['image', 'html'].includes(formRec.fields[this_field]?.value.type || formRec.fields[this_field]?.default?.type)) {\n response.fields[this_field].value = formRec.fields[this_field]?.prompt?.value;\n }\n }\n if (!response.fields[this_field].value) {\n if (formRec.fields[this_field].prompt?.occurrences && (formRec.fields[this_field].prompt.occurrences > 1)) {\n response.fields[this_field].value = new Array(formRec.fields[this_field].prompt.occurrences).fill(null);\n }\n else {\n response.fields[this_field].value = null;\n }\n }\n // if prompt.ignore_if exists, check the value\n if (formRec.fields[this_field]?.prompt?.ignore_if) {\n const ignoreList = makeArray(formRec.fields[this_field]?.prompt?.ignore_if);\n if (!response.fields[this_field].value) {\n if (ignoreList.includes('%%no_data%%')) {\n response.fields[this_field].ignore = true;\n }\n }\n else if (ignoreList.includes(response.fields[this_field].value)) {\n response.fields[this_field].ignore = true;\n }\n }\n // Set type\n response.fields[this_field].type = formRec.fields[this_field]?.value.type || formRec.fields[this_field]?.default?.type || 'text';\n // Set default valueText (this may require conversion of value data as in types phone or date or time)\n response.fields[this_field].valueText = await formatValue({\n rawValue: response.fields[this_field].value,\n type: response.fields[this_field].type\n });\n // set prompt\n response.fields[this_field].prompt = formRec.fields[this_field]?.prompt || { value: sentenceCase(this_field) };\n // Selection Obj should be set for the special case - type = select or type = select & text\n if (response.fields[this_field].type.startsWith('select')) {\n response.fields[this_field].selectionObj = formRec.fields[this_field]?.value.selection;\n }\n // set options\n response.fields[this_field].options = {\n required: !!formRec.fields[this_field].value.required,\n log_results: formRec.fields[this_field].value.log_results || false,\n viewOnly: (formRec.fields[this_field].value.edit === 'view'),\n hidden: (formRec.fields[this_field].value.edit === 'hidden'),\n ifEmpty: formRec.fields[this_field].options ? formRec.fields[this_field].options.ifEmpty : null,\n resetFields: (formRec.fields[this_field].value.resetFields\n || (formRec.fields[this_field].options ? formRec.fields[this_field].options.resetFields : null))\n };\n }\n };\n return response;\n };\n\n const initializeDoc = async ({ form_id, pertains_to, preset_values }) => {\n const formRec = await getDb({\n Key: {\n client_id: state.session.client_id,\n form_id\n },\n TableName: \"Forms\"\n });\n if (!formRec) {\n return {\n fields: {},\n sections: []\n };\n }\n /*\n fields as follows:\n prompt:\n type:\n value:\n valueText:\n selectionObj:\n options:\n isError: \n errorMessage:\n */\n let pertains_to_name;\n reactData.peopleRec[pertains_to] = await getDb({\n Key: {\n person_id: pertains_to\n },\n TableName: \"People\"\n });\n if (!reactData.peopleRec[pertains_to]) {\n reactData.peopleRec[pertains_to] = {};\n };\n updateReactData({\n family_id: reactData.peopleRec[pertains_to].family_id || false,\n peopleRec: reactData.peopleRec,\n formRec\n }, false);\n if (reactData.clientSampleMode) {\n pertains_to_name = state.session.client_name;\n }\n else {\n pertains_to_name = reactData.peopleRec[pertains_to].display_name;\n }\n if (!pertains_to_name && (reactData.peopleRec[pertains_to] && reactData.peopleRec[pertains_to].hasOwnProperty('name'))) {\n pertains_to_name = (`${reactData.peopleRec[pertains_to]?.name.first} ${reactData.peopleRec[pertains_to]?.name.last}`).trim();\n }\n let tempTitle;\n if (pertains_to_name) {\n tempTitle = `${formRec.form_name} for ${pertains_to_name}`;\n }\n else {\n tempTitle = `${formRec.form_name}`;\n }\n let response = {\n fields: {},\n // sections: formRec.sections,\n sections: [],\n document_title: reactData.document_title || tempTitle\n };\n for (let this_section of formRec.sections) {\n if (this_section.occurrences && !isNaN(this_section.occurrences)) {\n for (let section_number = 1; section_number <= this_section.occurrences; section_number++) {\n response.sections.push(deepCopy(this_section));\n this_section.section_name = this_section.section_name.replace(section_number.toString(), `${section_number + 1}`);\n for (let [field_index, this_field] of this_section.fields.entries()) {\n this_section.fields[field_index].field_name = this_field.field_name.replace(section_number.toString(), `${section_number + 1}`);\n this_section.fields[field_index].default_source = this_field.default_source.replace(section_number.toString(), `${section_number + 1}`);\n this_section.fields[field_index].saveAs = this_field.saveAs.replace(section_number.toString(), `${section_number + 1}`);\n }\n }\n }\n else {\n response.sections.push(this_section);\n }\n }\n for (let this_section of response.sections) {\n this_section.section_name = await resolveVariables(this_section.section_name);\n let field_variables = {};\n let field_key;\n // for (let this_field of this_section.fields) {\n for (let [index, this_field] of this_section.fields.entries()) {\n if (isObject(this_field)) {\n field_variables = Object.assign({}, this_field);\n field_key = this_field.form_field;\n this_field = this_field.field_name;\n this_section.fields[index] = this_field;\n }\n response.fields[this_field] = {};\n // Set default value\n const defaultObj = {};\n if (!formRec.fields.hasOwnProperty(this_field)) {\n const formFieldRec = await getDb({\n Key: {\n client_id: state.session.client_id,\n field_name: field_key || this_field\n },\n TableName: \"Form_Fields\"\n });\n if (formFieldRec) {\n if (field_variables.prompt) {\n formFieldRec.prompt.value = field_variables.prompt;\n }\n if (field_variables.default_source && formFieldRec.default.source && formFieldRec.default.source.startsWith('%%')) {\n formFieldRec.default.source = field_variables.default_source;\n }\n if (field_variables.saveAs && formFieldRec.value.saveAs && formFieldRec.value.saveAs.startsWith('%%')) {\n formFieldRec.value.saveAs = field_variables.saveAs;\n }\n if (field_variables.occurrences) {\n formFieldRec.prompt.occurrences = field_variables.occurrences;\n }\n if (field_variables.newLine) {\n formFieldRec.prompt.newLine = field_variables.newLine;\n };\n if (field_variables.width) {\n formFieldRec.prompt.width = field_variables.width;\n }\n formRec.fields[this_field] = formFieldRec;\n updateReactData({\n formRec\n }, false);\n }\n else {\n response.fields[this_field].ignore = true;\n continue;\n }\n }\n if (formRec.fields[this_field].default) {\n if (formRec.fields[this_field].default.source) {\n let sourceDefaults = [];\n if (Array.isArray(formRec.fields[this_field].default.source)) {\n sourceDefaults = formRec.fields[this_field].default.source;\n }\n else {\n sourceDefaults = [formRec.fields[this_field].default.source];\n }\n for (const this_default of sourceDefaults) {\n // if defaultObj has a source, the source is going to tell you where to find the default data\n // this should be EITHER an array OR a string; we want to make an array out of it\n defaultObj.source_path = makeArray(this_default, '.');\n const source_file = defaultObj.source_path.shift();\n if (source_file.toLowerCase().startsWith('session')) {\n if (!reactData.sessionRec[pertains_to]) {\n reactData.sessionRec[pertains_to] = await getDb({\n Key: {\n session_id: pertains_to\n },\n TableName: \"SessionsV2\"\n });\n updateReactData({\n sessionRec: reactData.sessionRec\n }, false);\n }\n response.fields[this_field].value = resolve({\n object: reactData.sessionRec[pertains_to],\n key: defaultObj.source_path\n });\n }\n else if ((source_file.toLowerCase().startsWith('person')) || (source_file.toLowerCase().startsWith('people'))) {\n response.fields[this_field].value = resolve({\n object: reactData.peopleRec[pertains_to],\n key: defaultObj.source_path\n });\n }\n else if (source_file.startsWith('family')) {\n if (source_file.toLowerCase().startsWith('family')) {\n if (!reactData.familyRec && reactData.family_id) {\n reactData.familyRec = await getDb({\n Key: {\n client_id: state.session.client_id,\n composite_key: reactData.family_id\n },\n TableName: \"FamilyGroups\"\n });\n updateReactData({\n familyRec: reactData.familyRec\n }, false);\n }\n }\n if (reactData.familyRec) {\n response.fields[this_field].value = resolve({\n object: reactData.familyRec,\n key: defaultObj.source_path\n });\n }\n }\n else if (source_file.toLowerCase().startsWith('user')) {\n if (!reactData.peopleRec[state.session.user_id]) {\n reactData.peopleRec[state.session.user_id] = await getDb({\n Key: {\n person_id: state.session.user_id\n },\n TableName: \"People\"\n });\n updateReactData({\n peopleRec: reactData.peopleRec\n }, false);\n }\n response.fields[this_field].value = resolve({\n object: reactData.peopleRec[state.session.user_id],\n key: defaultObj.source_path\n });\n }\n else if (source_file.startsWith('formData')) {\n if (reactData.options.hasOwnProperty('formData') && defaultObj.source_path[0]) {\n response.fields[this_field].value = reactData.options.formData[defaultObj.source_path[0]];\n }\n }\n if (response.fields[this_field].value) {\n break;\n }\n }\n }\n if (!response.fields[this_field].value && formRec.fields[this_field].default.value) {\n defaultObj.value_path = makeArray(formRec.fields[this_field].default.value, '.');\n if (defaultObj.value_path[0].toLowerCase() === 'date') {\n response.fields[this_field].value = makeDate(defaultObj.value_path[1], { notime: true })[defaultObj.value_path[2]];\n }\n else if (defaultObj.value_path[0].toLowerCase() === 'time') {\n response.fields[this_field].value = makeDate(defaultObj.value_path[1])[defaultObj.value_path[2]];\n }\n else if (defaultObj.value_path[0].toLowerCase() === 'name') {\n let pertains_to;\n if (['person', 'patient', 'pertains', 'pertain_to'].includes(defaultObj.value_path[1])) {\n pertains_to = reactData.pertains_to;\n }\n else if (defaultObj.value_path[1] === 'user') {\n pertains_to = state.session.user_id;\n }\n else {\n pertains_to = defaultObj.value_path[1];\n }\n response.fields[this_field].value = makeName(pertains_to);\n }\n else if (defaultObj.value_path[0].toLowerCase() === 'makenewaccount') {\n response.fields[this_field].value = response.value = await makeNewUser({\n tableDefaults: formRec.fields[this_field]?.default?.tables,\n });\n }\n else if (defaultObj.value_path.length === 1) {\n response.fields[this_field].value = defaultObj.value_path[0];\n }\n }\n }\n else if (formRec.fields[this_field]?.prompt && formRec.fields[this_field]?.prompt?.value) {\n if (['image', 'html'].includes(formRec.fields[this_field]?.value.type || formRec.fields[this_field]?.default?.type)) {\n response.fields[this_field].value = formRec.fields[this_field]?.prompt?.value;\n }\n }\n if (!response.fields[this_field].value) {\n if (formRec.fields[this_field].prompt?.occurrences && (formRec.fields[this_field].prompt.occurrences > 1)) {\n response.fields[this_field].value = new Array(formRec.fields[this_field].prompt.occurrences).fill(null);\n }\n else {\n response.fields[this_field].value = null;\n }\n }\n // Set type\n response.fields[this_field].type = formRec.fields[this_field]?.value.type || formRec.fields[this_field]?.default?.type || 'text';\n // Override computed defaults with preset values (if any)\n if (preset_values && preset_values[this_field]) {\n response.fields[this_field].og_default = await formatValue({\n rawValue: response.fields[this_field].value,\n type: response.fields[this_field].type\n });\n response.fields[this_field].value = preset_values[this_field];\n }\n // if prompt.ignore_if exists, check the value\n if (formRec.fields[this_field]?.prompt?.ignore_if) {\n const ignoreList = makeArray(formRec.fields[this_field]?.prompt?.ignore_if);\n if (!response.fields[this_field].value) {\n if (ignoreList.includes('%%no_data%%')) {\n response.fields[this_field].ignore = true;\n }\n }\n else if (array_in_array(ignoreList, response.fields[this_field].value)) {\n response.fields[this_field].ignore = true;\n }\n }\n // Set default valueText (this may require conversion of value data as in types phone or date or time)\n response.fields[this_field].valueText = await formatValue({\n rawValue: response.fields[this_field].value,\n type: response.fields[this_field].type\n });\n // set prompt\n response.fields[this_field].prompt = formRec.fields[this_field]?.prompt || { value: sentenceCase(this_field) };\n // Selection Obj should be set for the special case - type = select or type = select & text\n if (response.fields[this_field].type.startsWith('select')) {\n response.fields[this_field].selectionObj = formRec.fields[this_field]?.value.selection;\n if ((response.fields[this_field].value) && (Array.isArray(response.fields[this_field].value))\n && (response.fields[this_field].selectionObj.selectionList && Array.isArray(response.fields[this_field].selectionObj.selectionList))\n ) {\n let bonusList = [];\n for (let this_value of response.fields[this_field].value) {\n if (!response.fields[this_field].selectionObj.selectionList.includes(this_value)) {\n bonusList.push(this_value);\n }\n }\n if (bonusList.length > 0) {\n response.fields[this_field].bonusText = listFromArray(bonusList);\n }\n }\n }\n // set options\n response.fields[this_field].options = {\n required: !!formRec.fields[this_field].value.required,\n log_results: formRec.fields[this_field].value.log_results || false,\n viewOnly: (formRec.fields[this_field].value.edit === 'view'),\n hidden: (formRec.fields[this_field].value.edit === 'hidden'),\n ifEmpty: formRec.fields[this_field].options ? formRec.fields[this_field].options.ifEmpty : null,\n resetFields: (formRec.fields[this_field].value.resetFields\n || (formRec.fields[this_field].options ? formRec.fields[this_field].options.resetFields : null))\n\n };\n if (response.fields[this_field].type === 'signature') {\n response.fields[this_field].options.sigRefNumber = formRec.fields[this_field].sigRefNumber;\n }\n // set saveAs\n if (!isEmpty(formRec.fields[this_field].value.saveAs)) {\n let wip_saveAs = makeArray(formRec.fields[this_field].value.saveAs, \".\");\n const wip_file = wip_saveAs[0].slice(0, 6).toLowerCase();\n let found_index = ['person', 'people', 'sessio', 'family'].findIndex(this_word => {\n return (wip_file === this_word);\n });\n if (found_index < 0) {\n wip_saveAs.unshift('peopleRec');\n }\n else if (found_index < 2) {\n wip_saveAs[0] = 'peopleRec';\n }\n else if (found_index === 2) {\n wip_saveAs[0] = 'sessionRec';\n }\n else if (found_index === 3) {\n wip_saveAs[0] = 'familyRec';\n }\n response.fields[this_field].saveAs = wip_saveAs;\n }\n else {\n response.fields[this_field].saveAs = false;\n }\n // set logAs\n if (!isEmpty(formRec.fields[this_field].value.log_results)) {\n response.fields[this_field].logAs = formRec.fields[this_field].value.log_results.path;\n }\n else {\n response.fields[this_field].logAs = false;\n }\n // finish initializations\n response.fields[this_field].isError = false;\n }\n this_section.section_name = await resolveVariables(this_section.section_name, response.fields);\n };\n return response;\n };\n\n const resolve = ({ object, key }) => {\n const this_key = key.shift();\n if (!object || !object.hasOwnProperty(this_key)) {\n return null;\n }\n if (key.length === 0) {\n return deepCopy(object[this_key]);\n }\n else {\n return resolve({ object: object[this_key], key });\n }\n };\n\n const formatValue = async ({ rawValue, type }) => {\n let source = makeArray(rawValue);\n let response = [];\n for (let [index, this_value] of source.entries()) {\n switch (type) {\n case 'phone': {\n // return formatPhone(rawValue);\n response[index] = formatPhone(this_value);\n break;\n }\n case 'date_select':\n case 'date': {\n // return makeDate(rawValue, { noTime: true, noYearCorrection: true }).absolute;\n response[index] = makeDate(this_value, { noTime: true, noYearCorrection: true }).absolute;\n break;\n }\n case 'time': {\n // return makeDate(rawValue, { noTime: true, noYearCorrection: true }).timeOnly;\n response[index] = makeDate(this_value, { noTime: true, noYearCorrection: true }).timeOnly;\n break;\n }\n case 'id': {\n if (reactData.peopleRec[rawValue]) {\n // return reactData.peopleRec[rawValue].display_name\n // || (`${reactData.peopleRec[rawValue]?.name.first} ${reactData.peopleRec[rawValue]?.name.last}`).trim();\n response[index] = reactData.peopleRec[this_value].display_name\n || (`${reactData.peopleRec[this_value]?.name.first} ${reactData.peopleRec[this_value]?.name.last}`).trim();\n break;\n }\n else {\n // return await makeName(rawValue);\n response[index] = await makeName(this_value);\n break;\n }\n }\n default: {\n // return rawValue;\n response[index] = this_value;\n }\n }\n }\n if (source.length === 1) {\n return response[0];\n }\n else {\n return response;\n }\n };\n\n const makeNextAction = ({ instruction }) => {\n let response = {\n action: instruction.action\n };\n if (instruction.target) {\n response.target = reconcilePrompt({\n rawValue: instruction.target,\n this_field: 'null'\n });\n }\n return response;\n };\n\n const makeNewUser = async ({ tableDefaults }) => {\n let response;\n let formatter = `%%first_name//^[a-zA-Z]{1}%%%%last_name%%-%%client_id%%`;\n let candidate = reconcilePrompt({\n rawValue: formatter,\n this_field: 'person_id'\n });\n candidate = candidate.replace(/\\s/gm, '').toLowerCase();\n let isExisting = await getPerson(candidate);\n if (isEmpty(isExisting)) {\n response = candidate.toLowerCase();\n }\n else {\n // try alternate format\n let formatterB = `%%first_name%%%%last_name%%-%%client_id%%`;\n let candidateB = reconcilePrompt({\n rawValue: formatterB,\n this_field: 'person_id'\n });\n candidateB = candidateB.replace(/\\s/gm, '').toLowerCase();\n isExisting = await getPerson(candidateB);\n if (isEmpty(isExisting)) {\n response = candidateB.toLowerCase();\n }\n else {\n // start trying numbers\n let num = 0;\n do {\n num++;\n candidateB = candidate.replace('-', `${num}-`);\n isExisting = await getPerson(candidateB);\n }\n while (!isEmpty(isExisting) && (num < 20));\n if (isEmpty(isExisting)) {\n response = candidateB.toLowerCase();\n }\n else {\n response = `${new Date().getTime()}-${candidate.split('-')[1]}`;\n }\n }\n }\n reactData.peopleRec[response] = Object.assign({},\n tableDefaults.personRec,\n {\n person_id: response,\n client_id: state.session.client_id,\n });\n reactData.sessionRec[response] = Object.assign({},\n tableDefaults.sessionRec,\n {\n session_id: response,\n patient_id: response,\n person_id: response,\n client_id: state.session.client_id,\n user_homeClient: state.session.client_id,\n user_id: response\n });\n if (!reactData.family_id) {\n reactData.family_id = `family_${new Date().getTime()}`;\n reactData.newFamily = true;\n reactData.familyRec = Object.assign({},\n {\n client_id: state.session.client_id,\n composite_key: reactData.family_id,\n record_type: 'header',\n role: 'family',\n family_id: reactData.family_id,\n }\n );\n };\n if (reactData.newFamily) {\n reactData.familyRec.family_name = reactData.fields['last_name']\n ? `The ${reactData.fields['last_name'].value} Family`\n : (reactData.fields['first_name'] ? `${reactData.fields['first_name'].value}'s Family` : 'My Family');\n }\n updateReactData({\n newPerson: true,\n newFamily: reactData.newFamily,\n family_id: reactData.family_id,\n peopleRec: reactData.peopleRec,\n sessionRec: reactData.sessionRec,\n familyRec: reactData.familyRec,\n pertains_to: response\n }, false);\n return response;\n };\n\n const handleChangeValue = async ({ newText, newValue, newList, prop, occ_index, sentenceCase }) => {\n if (sentenceCase && newText && (newText.length === 1)) {\n newText = newText.toUpperCase();\n }\n if (reactData.fields[prop].prompt?.occurrences && (reactData.fields[prop].prompt.occurrences > 1)) {\n reactData.fields[prop].value[occ_index] = newValue || newList || newText;\n }\n else {\n reactData.fields[prop].value = newValue || newList || newText;\n }\n reactData.fields[prop].valueText = await formatValue({\n rawValue: reactData.fields[prop].value,\n type: reactData.fields[prop].type\n });\n if (reactData.fields[prop].options.resetFields) {\n for (const this_resetter of makeArray(reactData.fields[prop].options.resetFields)) {\n const { ignore, value } = await setFieldDefault({ this_field: this_resetter });\n reactData.fields[this_resetter].value = value;\n if (ignore) {\n reactData.fields[this_resetter].ignore = ignore;\n }\n else {\n reactData.fields[this_resetter].ignore = false;\n }\n reactData.fields[this_resetter].valueText = await formatValue({\n rawValue: reactData.fields[this_resetter].value,\n type: reactData.fields[this_resetter].type\n });\n }\n }\n updateReactData({\n formUpdates: reactData.formUpdates++,\n fields: reactData.fields\n }, true);\n };\n\n const handleMakeSelection = async (props) => {\n if (isEmpty(reactData.fields[props.prop].value)) {\n reactData.fields[props.prop].value = [props.clickText];\n }\n else {\n if (!Array.isArray(reactData.fields[props.prop].value)) {\n reactData.fields[props.prop].value = [reactData.fields[props.prop].value];\n }\n let foundAt = reactData.fields[props.prop].value.indexOf(props.clickText);\n if (foundAt < 0) {\n reactData.fields[props.prop].value.push(props.clickText);\n if (reactData.fields[props.prop].selectionObj.max\n && (reactData.fields[props.prop].value.length > reactData.fields[props.prop].selectionObj.max)) {\n reactData.fields[props.prop].value.shift();\n }\n }\n else {\n reactData.fields[props.prop].value.splice(foundAt, 1);\n }\n }\n if (reactData.fields[props.prop].options.resetFields) {\n for (const this_resetter of makeArray(reactData.fields[props.prop].options.resetFields)) {\n if (!reactData.fields[this_resetter]) {\n continue;\n }\n const { ignore, value } = await setFieldDefault({ this_field: this_resetter });\n reactData.fields[this_resetter].value = deepCopy(value);\n if (ignore) {\n reactData.fields[this_resetter].ignore = ignore;\n }\n else {\n reactData.fields[this_resetter].ignore = false;\n }\n reactData.fields[this_resetter].valueText = await formatValue({\n rawValue: reactData.fields[this_resetter].value,\n type: reactData.fields[this_resetter].type\n });\n }\n }\n updateReactData({\n formUpdates: reactData.formUpdates++,\n fields: reactData.fields\n }, true);\n };\n\n const reconcilePrompt = ({ rawValue, this_field }) => {\n let response = rawValue;\n if (!rawValue) { return this_field; }\n let answer = response.match(/%%.*?%%/);\n let rememberAnswer = false;\n if (answer) {\n do {\n let variable = answer[0];\n if (variable === '%%value%%') {\n let vValue = (reactData.fields[this_field] ? reactData.fields[this_field].valueText : '');\n if (!vValue) {\n vValue = `<${titleCase(this_field.toLowerCase().replace(/[^a-z]/, ' '))}>`;\n }\n response = response.replace(variable, vValue);\n }\n else if ((variable === '%%default%%') || (variable === '%%OG_default%%')) {\n let vValue = (reactData.fields[this_field] ? (reactData.fields[this_field].og_default || reactData.fields[this_field].valueText) : '');\n if (!vValue) {\n vValue = `<${titleCase(this_field.toLowerCase().replace(/[^a-z]/, ' '))}>`;\n }\n response = response.replace(variable, vValue);\n if (variable === '%%OG_default%%') {\n rememberAnswer = true;\n }\n }\n else {\n let extracted_field = variable.slice(2, -2);\n if (reactData.fields[extracted_field] && reactData.fields[extracted_field].valueText) {\n let vValue = reactData.fields[extracted_field].valueText;\n if (!vValue) {\n vValue = `<${titleCase(extracted_field.toLowerCase().replace(/[^a-z]/, ' '))}>`;\n }\n response = response.replace(variable, vValue);\n }\n else if (extracted_field.includes('//')) {\n let [field_part, regex_part] = extracted_field.split('//');\n if (reactData.fields[field_part]) {\n let vValue = reactData.fields[field_part].value.match(RegExp(regex_part, 'gm'))[0];\n if (!vValue) {\n vValue = `<${titleCase(field_part.toLowerCase().replace(/[^a-z]/, ' '))}>`;\n }\n response = response.replace(variable, vValue);\n }\n else {\n response = response.replace(variable, '');\n }\n }\n else if (extracted_field === 'client_id') {\n response = response.replace(variable, state.session.client_id);\n }\n else {\n response = response.replace(variable, '');\n }\n }\n answer = response.match(/%%.*?%%/);\n }\n while (answer);\n }\n if (!response.endsWith(')') && reactData.fields[this_field] && reactData.fields[this_field].prompt.show_log && reactData.fields[this_field].logAs) {\n let path = reactData.fields[this_field].logAs.split('.');\n let pathFile = path.shift();\n let logLine = resolve({\n object: reactData[pathFile]?.[reactData.pertains_to],\n key: path\n });\n response += ` (${logLine})`;\n }\n if (rememberAnswer) {\n reactData.fields[this_field].prompt.value = response;\n }\n return response;\n };\n\n // **************************\n\n const AVACheckBoxGroup = (props) => {\n // props should contain\n // prop\n // text - an array of options, each can independently go true or false\n return (\n \n \n {reconcilePrompt({\n rawValue: reactData.fields[props.prop].prompt.value,\n this_field: props.prop\n })}\n \n \n \n {(props.text).map((text, tIndex) => (\n {\n await handleMakeSelection({\n clickText: text,\n prop: props.prop\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n }\n label={{text}}\n labelPlacement='end'\n />\n ))}\n {(props.withPrompt) &&\n {\n if (!reactData.fields[props.prop].value) {\n reactData.fields[props.prop].value = [];\n }\n reactData.fields[props.prop].bonusText = event.target.value;\n updateReactData({\n formUpdates: reactData.formUpdates++,\n fields: reactData.fields\n }, true);\n }}\n helperText={props.withPrompt}\n />\n }\n />\n }\n \n \n \n );\n };\n\n // **************************\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n const handleAbort = () => {\n onClose(0, {\n document_id: null,\n document_status: 'aborted'\n });\n };\n\n const handleReview = async () => {\n let messageList = ['There are problems with this form'];\n let errorsOnForm = 0;\n let activeErrors = 0;\n for (const sectionObj of reactData.sections) {\n let suppressSection = dontShowSection(sectionObj);\n if (suppressSection !== 'data') {\n for (const this_field of sectionObj.fields) {\n if (reactData.fields[this_field].ignore) {\n continue;\n }\n reactData.fields[this_field].isError = false;\n if (reactData.fields[this_field]?.options?.ifEmpty && isEmpty(reactData.fields[this_field].value)) {\n reactData.fields[this_field].value = reconcilePrompt({\n rawValue: reactData.fields[this_field].options.ifEmpty,\n this_field\n });\n }\n if (reactData.fields[this_field]?.options?.required || reactData.fields[this_field]?.value?.required) {\n if (((reactData.fields[this_field].type === 'signature')\n && ((signatureRef[reactData.fields[this_field].options.sigRefNumber].current) && (signatureRef[reactData.fields[this_field].options.sigRefNumber].current.isEmpty())))\n || ((reactData.fields[this_field].type !== 'signature')\n && (isEmpty(reactData.fields[this_field].value)))) {\n if (!suppressSection) {\n activeErrors++;\n reactData.fields[this_field].errorMessage = `${reconcilePrompt({\n rawValue: reactData.fields[this_field].prompt.value,\n this_field\n })} is required`;\n reactData.fields[this_field].isError = true;\n messageList.push(reactData.fields[this_field].errorMessage);\n }\n errorsOnForm++;\n }\n }\n else if (reactData.fields[this_field].type.startsWith('select')) {\n let mySelections = [];\n if (reactData.fields[this_field].value) {\n mySelections = ([reactData.fields[this_field].value].flat()).filter(v => {\n return (reactData.fields[this_field].selectionObj.selectionList.includes(v));\n });\n }\n if (reactData.fields[this_field].selectionObj.min) {\n if (isEmpty(mySelections)) {\n if (!suppressSection) {\n activeErrors++;\n reactData.fields[this_field].errorMessage = `Please make a selection for ${reconcilePrompt({\n rawValue: reactData.fields[this_field].prompt.value,\n this_field\n })}`;\n reactData.fields[this_field].isError = true;\n messageList.push(reactData.fields[this_field].errorMessage);\n }\n errorsOnForm++;\n }\n else if (mySelections.length < reactData.fields[this_field].selectionObj.min) {\n if (!suppressSection) {\n activeErrors++;\n reactData.fields[this_field].errorMessage = `You must make at least ${reactData.fields[this_field].selectionObj.min} selections for ${reconcilePrompt({\n rawValue: reactData.fields[this_field].prompt.value,\n this_field\n })}`;\n reactData.fields[this_field].isError = true;\n messageList.push(reactData.fields[this_field].errorMessage);\n }\n errorsOnForm++;\n }\n }\n }\n };\n }\n }\n if (!activeErrors) {\n if (errorsOnForm) {\n messageList = ['Your part of this form looks good!', 'Tap \"Submit\" below to save it and submit for review'];\n }\n else {\n messageList = ['This form is complete!', 'Tap \"Complete\" below to save it'];\n }\n }\n updateReactData({\n messageList,\n errorsOnForm,\n activeErrors,\n fields: reactData.fields,\n stage: 'confirm'\n }, true);\n };\n\n const resolveValue = (object, key, value) => {\n const this_key = key.shift();\n if (key.length === 0) {\n object[this_key] = value;\n return object;\n }\n else if (isEmpty(object)) {\n let resolvedObj = resolveValue({}, key, value);\n object = resolvedObj;\n return object;\n }\n else if (!object.hasOwnProperty(this_key)) {\n let resolvedObj = resolveValue({}, key, value);\n object[this_key] = resolvedObj;\n return object;\n }\n else {\n let resolvedObj = resolveValue(object[this_key], key, value);\n object[this_key] = resolvedObj;\n return object;\n }\n };\n\n const handleSave = async ({ document_id, final, timeout, pending = false }) => {\n let response = { goodPut: true };\n // always save this in DocumentsInProcess\n if (!document_id) {\n document_id = reactData.document_id || `${state.session.patient_id}_${reactData.form_id}_${new Date().getTime()}`;\n updateReactData({\n document_id\n }, false);\n }\n // updates to the Database as per instructions in fields[this_field].saveAs\n let needsUpdate = {\n peopleRec: false,\n sessionRec: false,\n familyRec: false\n };\n let field_values = {};\n let now = makeDate(new Date());\n for (const this_field in reactData.fields) {\n if (reactData.fields[this_field].bonusText) {\n if (reactData.fields[this_field].value) {\n let valueArray = makeArray(reactData.fields[this_field].value);\n valueArray.push(reactData.fields[this_field].bonusText);\n reactData.fields[this_field].value = valueArray;\n reactData.fields[this_field].valueText = listFromArray(valueArray);\n }\n else {\n reactData.fields[this_field].value = reactData.fields[this_field].bonusText;\n reactData.fields[this_field].valueText = reactData.fields[this_field].bonusText;\n }\n }\n if (!reactData.fields[this_field].options?.viewOnly) {\n field_values[this_field] = reactData.fields[this_field].value;\n }\n if (!reactData.fields[this_field].ignore) {\n if (reactData.fields[this_field].saveAs) {\n const save_instructions = reactData.fields[this_field].saveAs;\n const save_file = save_instructions.shift();\n if (save_file === 'peopleRec') {\n if (!reactData.peopleRec.hasOwnProperty(reactData.pertains_to)) {\n reactData.peopleRec[reactData.pertains_to] = await getDb({\n Key: {\n person_id: reactData.pertains_to\n },\n TableName: \"People\"\n });\n updateReactData({\n peopleRec: reactData.peopleRec\n }, false);\n }\n reactData.peopleRec[reactData.pertains_to] = resolveValue(\n reactData.peopleRec[reactData.pertains_to],\n save_instructions,\n reactData.fields[this_field].value\n );\n needsUpdate.peopleRec = true;\n }\n else if (save_file === 'sessionRec') {\n if (!reactData.sessionRec.hasOwnProperty(reactData.pertains_to)) {\n reactData.sessionRec[reactData.pertains_to] = await getDb({\n Key: {\n person_id: reactData.pertains_to\n },\n TableName: \"SessionsV2\"\n });\n updateReactData({\n sessionRec: reactData.sessionRec\n }, false);\n }\n reactData.sessionRec[reactData.pertains_to] = resolveValue(\n reactData.sessionRec[reactData.pertains_to],\n save_instructions,\n reactData.fields[this_field].value\n );\n needsUpdate.sessionRec = true;\n }\n else if (save_file === 'familyRec') {\n // we need to get the familyRec; do we have it already? \n if (!reactData.familyRec && reactData.family_id) {\n reactData.familyRec = await getDb({\n Key: {\n client_id: state.session.client_id,\n composite_key: reactData.family_id\n },\n TableName: \"FamilyGroups\"\n });\n updateReactData({\n familyRec: reactData.familyRec\n }, false);\n }\n if (reactData.familyRec) {\n reactData.familyRec = resolveValue(\n reactData.familyRec,\n save_instructions,\n reactData.fields[this_field].value\n );\n needsUpdate.familyRec = true;\n }\n }\n }\n if ((!!reactData.fields[this_field].options?.log_results)\n && (!reactData.fields[this_field].options.log_results.if_value\n || reactData.fields[this_field].options.log_results.if_value.some(v => {\n if (typeof (reactData.fields[this_field].value) === 'string') { return v = reactData.fields[this_field].value; }\n else { return reactData.fields[this_field].value.includes(v); }\n }))) {\n const log_instructions = reactData.fields[this_field].options.log_results.path.split('.');\n const log_file = log_instructions.shift();\n if (log_file === 'peopleRec') {\n if (!reactData.peopleRec.hasOwnProperty(reactData.pertains_to)) {\n reactData.peopleRec[reactData.pertains_to] = await getDb({\n Key: {\n person_id: reactData.pertains_to\n },\n TableName: \"People\"\n });\n updateReactData({\n peopleRec: reactData.peopleRec\n }, false);\n }\n reactData.peopleRec[reactData.pertains_to] = resolveValue(\n reactData.peopleRec[reactData.pertains_to],\n log_instructions,\n sentenceCase(`Previously ${reactData.fields[this_field].value} ${now.oaDate} by ${state.profile.name.first} ${state.profile.name.last}`)\n );\n needsUpdate.peopleRec = true;\n }\n else if (log_file === 'sessionRec') {\n if (!reactData.sessionRec.hasOwnProperty(reactData.pertains_to)) {\n reactData.sessionRec[reactData.pertains_to] = await getDb({\n Key: {\n person_id: reactData.pertains_to\n },\n TableName: \"SessionsV2\"\n });\n updateReactData({\n sessionRec: reactData.sessionRec\n }, false);\n }\n reactData.sessionRec[reactData.pertains_to] = resolveValue(\n reactData.sessionRec[reactData.pertains_to],\n log_instructions,\n sentenceCase(`Previously ${reactData.fields[this_field].value} ${now.oaDate} by ${state.profile.name.first} ${state.profile.name.last}`)\n );\n needsUpdate.sessionRec = true;\n }\n }\n\n }\n }\n if (needsUpdate.peopleRec || reactData.newPerson) {\n if (reactData.newFamily) {\n reactData.peopleRec[reactData.pertains_to].family_id = reactData.family_id;\n }\n await dbClient\n .put({\n Item: reactData.peopleRec[reactData.pertains_to],\n TableName: 'People'\n })\n .promise()\n .catch(error => {\n cl(`Bad put to People. Error is: ${error}`);\n response = { goodPut: false, putError: `Bad put to People. Error is: ${error}` };\n });\n }\n if (needsUpdate.sessionRec) {\n await dbClient\n .put({\n Item: reactData.sessionRec[reactData.pertains_to],\n TableName: 'SessionsV2'\n })\n .promise()\n .catch(error => {\n cl(`Bad put to SessionsV2. Error is: ${error}`);\n response = { goodPut: false, putError: `Bad put to SessionsV2. Error is: ${error}` };\n });\n }\n\n // updates - if any - are done\n // if this is the type of document that needs to generate a final printout, do that now\n let url;\n if (final && !reactData.formRec?.options?.noFinal) {\n // render signatures (if any) before printing\n let signatures = [];\n for (const this_field in reactData.fields) {\n if (reactData.fields[this_field].ignore) {\n continue;\n }\n if ((reactData.fields[this_field].type === 'signature') && (signatureRef[reactData.fields[this_field].options.sigRefNumber].current)) {\n signatures[reactData.fields[this_field].options.sigRefNumber] = signatureRef[reactData.fields[this_field].options.sigRefNumber].current.getTrimmedCanvas().toDataURL('image/png');\n }\n if (reactData.fields[this_field].prompt) {\n reactData.fields[this_field].prompt.value =\n reconcilePrompt({\n rawValue: reactData.fields[this_field].prompt.value,\n this_field\n });\n }\n };\n const s3Results = await printDocumentB({\n documentList: [{\n sections: reactData.sections,\n fields: reactData.fields,\n docID: document_id,\n signatures,\n client_id: state.session.client_id,\n title: reactData.document_title\n }]\n });\n url = s3Results[0].s3Location;\n }\n\n // printing is done (or wasn't necessary)\n // save_type is one of 'final', 'in_process', 'on_timeout', 'printed'\n let docData = {\n client_id: state.session.client_id,\n document_id,\n title: reactData.document_title,\n pertains_to: reactData.pertains_to,\n status: url ? (pending ? 'pending' : 'complete') : 'in_process', // need to set pending when appropriate\n form_type: reactData.form_id,\n client_id_form_type: `${state.session.client_id}%%${reactData.form_id}`,\n field_values,\n options: reactData.formRec.options\n };\n if (reactData.docRec?.history) {\n docData.history = reactData.docRec?.history;\n }\n const recWritten = await updateDocument({\n docData,\n author: state.session.patient_id,\n isNew: false,\n pending,\n save_type: url ? 'printed' : (final ? 'save_final' : (timeout ? 'on_timeout' : 'in_process')),\n url\n });\n response.location = url;\n response.document_status = docData.status;\n response.status = docData.status;\n response.document_id = docData.document_id;\n if (final && reactData.formRec?.options?.messaging) {\n // conditional based on responses should be allowed here\n // in user lists, user can be a person: person_id, group: group_id, or author: true\n for (let this_instruction of [reactData.formRec?.options?.messaging].flat()) {\n if (this_instruction.hasOwnProperty('status') && this_instruction.status !== docData.status) {\n continue;\n }\n if (this_instruction.hasOwnProperty('send_message')) {\n if (this_instruction.send_message.attach) {\n this_instruction.send_message.url = url;\n };\n if (!this_instruction.send_message.subject) {\n this_instruction.send_message.subject = `Form update - status is ${docData.status}`;\n }\n else {\n this_instruction.send_message.subject = await deepResolve(this_instruction.send_message.subject, reactData.peopleRec[reactData.pertains_to]);\n }\n this_instruction.send_message.text = await deepResolve(this_instruction.send_message.text, reactData.peopleRec[reactData.pertains_to]);\n await sendMessage(this_instruction.send_message);\n }\n if (this_instruction.hasOwnProperty('instruction') && (this_instruction.instruction === 'create_form')) {\n await createForm({ // finishing this form issues an instruction to create another form (\"teacher recommendation\" use case, for example)\n instructions: this_instruction,\n source_doc: document_id,\n doc_location: response.location\n });\n }\n }\n }\n updateReactData({\n document_id,\n docRec: recWritten,\n recWritten: recWritten,\n dataSaved: true,\n }, true);\n return response;\n };\n\n\n async function sendMessage(send_instructions) {\n let postTime = new Date().getTime();\n let newMessageThread = `${postTime}.${uuid(6)}`;\n let message_id = `${postTime}.${uuid(6)}.0~CuredMessage`;\n const reply_to = [state.session.person_id];\n let recipient_key = [send_instructions.send_to].flat();\n let PostOfficeRec = {\n Item: {\n thread_id: newMessageThread,\n message_id,\n allowReplyAll: false,\n client_id: state.session.client_id,\n deliver_time: postTime,\n from: state.session.patient_id,\n message_text: send_instructions.text,\n patient_id: state.session.patient_id,\n preferred_method: null,\n recipient_base: 'list',\n recipient_key,\n subject: send_instructions.subject || ``,\n reply_to\n },\n TableName: 'PostOffice'\n };\n if (send_instructions.attach) {\n PostOfficeRec.Item.attachments = [send_instructions.url];\n }\n await dbClient\n .put(PostOfficeRec)\n .promise()\n .catch(error => {\n cl(`Error writing to Post Office; error is ${error}`);\n });\n return;\n }\n\n let preset_values = {};\n async function createForm({ instructions, source_doc, doc_location }) {\n // { \n // instruction: 'create_form',\n // form_id: make a new form of type form_id as wip \n // fields: [ {: }, {: {form: }}, (as a string - same as { : {form: }})\n // assign_to: [user, user, (author), (pertains_to)...] put it on the forms list for this/these people\n // pertains_to: \n // document_title: (optional) \n // restricted_access: 'admin_only'\n // message: {text: , subject: } \n // }, {}, ...]\n /*\n Example: {\n \"form_id\": \"recommendation_response\",\n \"assign_to\": [\n \"rsteele\"\n ],\n \"document_title\": \"Test Title\",\n \"fields\": [\n {\n \"camper_first_name\": \"%%camper_first_name%% %%camper_last_name%%\"\n },\n \"camper_last_name\",\n \"camper_school_grade_2024_2025\",\n \"teachers_name\",\n \"teachers_email\"\n ],\n \"instruction\": \"create_form\",\n \"message\": {\n \"subject\": \"Test subject goes here\",\n \"text\": \"This is the message\";\n },\n \"pertains_to\": \"ava-campdemo\",\n \"restricted_access\": \"admin_only\";\n }\n */\n\n // prepare data fields\n if (instructions.fields) {\n // array - each entry is one of these forms: \n // object with key = field to set and value is a string {: }, \n // or object with key = field to set and value is an object as in {: {form: }}, \n // or a string = field name from the source form\n for (let this_field of instructions.fields) {\n if (!isObject(this_field)) {\n if (reactData.fields.hasOwnProperty(this_field)) {\n preset_values[this_field] = reactData.fields[this_field].value;\n }\n }\n else {\n for (const [key, value] of Object.entries(this_field)) {\n if (typeof (value) === 'string') {\n preset_values[key] = await resolveVariables(value);\n }\n else {\n if (reactData.fields.hasOwnProperty(value.form)) {\n preset_values[key] = reactData.fields[value.form].value;\n }\n }\n }\n }\n }\n }\n let newDocumentID = await createDocument({\n docData: {\n client_id: state.session.client_id,\n form_type: instructions.form_id,\n pertains_to: instructions.pertains_to,\n field_values: preset_values\n },\n author: state.session.user_id\n });\n\n // Send messages (optional)\n if (instructions.message) {\n // the message.text and message.subject may contain variables in the form %%field_name%%\n let final_messageText = await resolveVariables(instructions.message.text);\n let jumpTo = window.location.origin;\n for (const this_assignment of instructions.assign_to) {\n let final_html = final_messageText + `

    Please click on this link to respond.`;\n final_messageText += `\\r\\n\\nClick on this link to respond: ${jumpTo}?document=${newDocumentID}&&docUser=${this_assignment}`;\n await sendMessages({\n client: state.session.client_id,\n author: state.session.user_id,\n person_id: state.session.patient_id,\n messageText: final_messageText,\n htmlText: final_html,\n recipientList: this_assignment,\n attachments: doc_location,\n subject: instructions.message.subject\n ? await resolveVariables(instructions.message.subject)\n : `A message from ${reactData.peopleRec[instructions.pertains_to].display_name || 'AVA Document Management'}`\n });\n }\n }\n\n }\n\n async function deepResolve(s, o) {\n let a = s.match(/(.*?)%%(.*?)%%(.*)/);\n if (a) {\n do {\n let v = '';\n if (preset_values && preset_values.hasOwnProperty(a[2])) {\n v = preset_values[a[2]];\n }\n else if (reactData.fields.hasOwnProperty(a[2])) {\n v = await formatValue({\n rawValue: reactData.fields[a[2]].value,\n type: reactData.fields[a[2]].type\n });\n }\n else if (o) {\n v = resolve({\n object: o,\n key: a[2].split('.')\n });\n }\n s = `${a[1]}${v}${a[3]}`;\n a = s.match(/(.*?)%%(.*?)%%(.*)/);\n } while (a);\n }\n return s;\n }\n\n async function resolveVariables(s, o) {\n let a = s.match(/(.*?)%%(.*?)%%(.*)/);\n if (a) {\n do {\n let v = '';\n if (preset_values && preset_values.hasOwnProperty(a[2])) {\n v = preset_values[a[2]];\n }\n else if (reactData.fields.hasOwnProperty(a[2])) {\n if (!reactData.fields[a[2]].value) {\n v = `<${reactData.fields[a[2]]?.prompt?.value || titleCase(a[2].toLowerCase().replace(/[^a-z]/, ' '))}>`;\n }\n else {\n v = await formatValue({\n rawValue: reactData.fields[a[2]].value,\n type: reactData.fields[a[2]].type\n });\n }\n }\n else if (o && o.hasOwnProperty(a[2])) {\n if (!o[a[2]].value) {\n v = `<${o[a[2]]?.prompt?.value || titleCase(a[2].toLowerCase().replace(/[^a-z]/, ' '))}>`;\n }\n else {\n v = await formatValue({\n rawValue: o[a[2]].value,\n type: o[a[2]].type\n });\n }\n }\n s = `${a[1]}${v}${a[3]}`;\n a = s.match(/(.*?)%%(.*?)%%(.*)/);\n } while (a);\n }\n return s;\n }\n\n async function printWIP({ document_id }) {\n let signatures = [];\n for (const this_field in reactData.fields) {\n if (reactData.fields[this_field].ignore) {\n continue;\n }\n if ((reactData.fields[this_field].type === 'signature')\n && (!signatureRef[reactData.fields[this_field].options.sigRefNumber].current.isEmpty())) {\n signatures[reactData.fields[this_field].options.sigRefNumber] = signatureRef[reactData.fields[this_field].options.sigRefNumber].current.getTrimmedCanvas().toDataURL('image/png');\n }\n reactData.fields[this_field].prompt.value =\n reconcilePrompt({\n rawValue: reactData.fields[this_field].prompt.value,\n this_field\n });\n };\n await printDocumentHybrid({\n documentList: [{\n sections: reactData.sections,\n fields: reactData.fields,\n docID: document_id,\n signatures,\n client_id: state.session.client_id,\n title: reactData.document_title\n }]\n });\n }\n\n async function initialize() {\n // request can pass in a document_id - in this case, we'll try to pick up the WIP document and continue with it\n // if document_id is not found in DocumentsInProcess, check to see if it is in DocumentsAssigned in which case we will launch a new document\n // if it is also not in DocumentsAssigned, check Documents to see if it is completed. If found there, offer to display it.\n // If no document_id is sent in, or the document_id wasn't found in the process above, look for a form_id\n // If a form_id is sent in, create a new document from that form\n // Otherwise the call returns an error.\n\n if (reactData.document_id) {\n // first, look to see if the referenced document_id is completed. If it is, show it and leave\n let docRec = await dbClient\n .get({\n Key: {\n document_id: reactData.document_id\n },\n TableName: \"DocumentMaster\"\n })\n .promise()\n .catch(error => {\n cl(`in FormFillB -> initialize, bad get to DocumentMaster with ${reactData.document_id || '(null)'}. Error is: ${error}`);\n });\n if (recordExists(docRec)) {\n if (docRec.Item.status === 'complete') {\n window.open(\n docRec.Item.history[0].url,\n docRec.Item.status,\n `name=${docRec.Item.status}, left=${20}, top=${20}`\n );\n handleAbort();\n }\n else {\n const { fields, sections, document_title } = await initializeDoc({\n form_id: docRec.Item.form_type,\n pertains_to: docRec.Item.pertains_to,\n preset_values: docRec.Item.field_values\n });\n updateReactData({\n document_title: docRec.Item.title || document_title,\n pertains_to: docRec.Item.pertains_to,\n form_id: docRec.Item.form_type,\n fields,\n sections,\n docRec: docRec.Item,\n formRec: { options: docRec.Item.options },\n stage: 'fill'\n }, true);\n return;\n }\n }\n }\n // if we got here, there was no existing document found with the passed in document_id\n // or no document_id was passed in at all. \n // In this case, look for a DocumentinProcess for this person and formType...\n if (reactData.form_id && reactData.pertains_to && !reactData.options.start_from_scratch) {\n let queryObj = {\n KeyConditionExpression: 'pertains_to = :p and form_type = :f',\n ScanIndexForward: false,\n TableName: 'DocumentMaster',\n IndexName: 'person_form-index',\n ExpressionAttributeValues: {\n ':p': reactData.pertains_to,\n ':f': reactData.form_id\n }\n };\n let queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`in FormFillB -> initialize, bad get to DocumentMaster with pertains_to=${reactData.pertains_to || '(null)'} and form_id=${reactData.form_id || '(null)'}. Error is: ${error}`);\n });\n if (recordExists(queryResult)) {\n for (const this_document of queryResult.Items) {\n if (this_document.status !== 'complete') {\n const { fields, sections, document_title } = await initializeDoc({\n form_id: this_document.form_type,\n pertains_to: this_document.pertains_to,\n preset_values: this_document.field_values\n });\n updateReactData({\n document_id: this_document.document_id,\n document_title: this_document.title || document_title,\n pertains_to: this_document.pertains_to,\n form_id: this_document.form_type,\n fields,\n sections,\n formRec: { options: this_document.options },\n stage: 'fill'\n }, true);\n return;\n }\n }\n }\n }\n // we couldn't find an appropriate document to continue with, so we'll start a new one\n const { fields, sections, document_title } = await initializeDoc({\n form_id: reactData.form_id,\n pertains_to: reactData.pertains_to\n });\n let nowTime = new Date().getTime();\n updateReactData({\n document_id: `${reactData.pertains_to}_${reactData.form_id}_${nowTime}`,\n pertains_to: reactData.pertains_to,\n form_id: reactData.form_id,\n document_title,\n fields,\n sections,\n stage: 'fill'\n }, true);\n return;\n }\n\n const dontShowSection = (this_sectionObj) => {\n if (this_sectionObj.hasOwnProperty('show_if')) {\n let reason = 'unknown';\n for (const this_test of this_sectionObj.show_if) {\n if (this_test.hasOwnProperty('pertainsTo_memberOf')) {\n if (reactData.peopleRec[reactData.pertains_to].groups.some(g => { return [this_test.memberOf].flat().includes(g); })) {\n return false;\n }\n else { reason = 'pertains_to'; }\n }\n else if (this_test.hasOwnProperty('memberOf')) {\n if (state.patient.groups.some(g => { return [this_test.memberOf].flat().includes(g); })) {\n return false;\n }\n else { reason = 'memberOf'; }\n }\n else {\n const this_value = reactData.fields[this_test.field].value;\n if (array_in_array(this_test.values, this_value)) {\n return false;\n }\n else { reason = 'data'; }\n }\n }\n return reason;\n }\n else {\n return false;\n }\n };\n\n /********************\n * \n * Initialize\n * \n ********************/\n\n React.useEffect(() => {\n async function goLoad() {\n if (reactData.options.mode === 'printEmpty') {\n const { fields, sections, document_title } = await initializeBlank({ form_id: reactData.form_id });\n await printEmptyDocument({\n documentList: [{\n sections,\n fields,\n client_id: state.session.client_id,\n title: document_title\n }]\n });\n onClose();\n }\n else {\n await initialize();\n if (!reactData.sections) {\n onClose();\n }\n start(); // idle timer\n updateReactData({\n stage: 'fill'\n }, true);\n }\n }\n if (reactData.stage === 'initialize') {\n goLoad();\n }\n }, [reactData.form_id, reactData.document_id]); // eslint-disable-line react-hooks/exhaustive-deps\n\n // **************************\n\n return (\n 0)) || true}\n key={`wholeScreen__`}\n onClose={handleAbort}\n classes={{ paper: classes.clientBackground }}\n >\n {!isInitializing() &&\n \n \n \n {reactData.document_title}\n \n \n \n {reactData.sections.map((sectionObj, sectionNdx) => (\n (!dontShowSection(sectionObj) &&\n \n \n {sectionObj.section_name}\n \n {sectionObj.fields.map((this_field, fieldNdx) => (\n (reactData.fields.hasOwnProperty(this_field) &&\n (!reactData.fields[this_field].options || !reactData.fields[this_field].options.hidden) &&\n !reactData.fields[this_field].ignore &&\n\n \n {new Array(reactData.fields[this_field].prompt?.occurrences || 1).fill(0).map((a_zero, occ_index) => (\n \n {reactData.fields[this_field].prompt.newLine && (occ_index === 0) &&\n \n {''}\n \n }\n {(reactData.fields[this_field].type === 'text') &&\n {\n await handleChangeValue({\n newText: event.target.value,\n prop: this_field,\n occ_index,\n sentenceCase: true\n });\n }}\n helperText={((occ_index > 0) ? null : reconcilePrompt({\n rawValue: reactData.fields[this_field].prompt.value,\n this_field\n }))}\n />\n }\n {(reactData.fields[this_field].type === 'header') && (occ_index === 0) &&\n \n {reactData.fields[this_field].prompt.value}\n \n }\n {(reactData.fields[this_field].type === 'image') &&\n \n }\n {(reactData.fields[this_field].type === 'phone') &&\n {\n if (event.target.value) {\n let fPhone = formatPhone(event.target.value);\n await handleChangeValue({\n newText: fPhone,\n newValue: `+1${fPhone.replace(/\\D/g, '')}`,\n occ_index,\n prop: this_field,\n sentenceCase: false\n });\n }\n }}\n helperText={((occ_index > 0) ? null : reconcilePrompt({\n rawValue: reactData.fields[this_field].prompt.value,\n this_field\n }))}\n />\n }\n {(reactData.fields[this_field].type === 'date_select') &&\n \n {\n if (event.target.value) {\n let dObj = makeDate(event.target.value, { noTime: true, noYearCorrection: true });\n if (!dObj.error) {\n await handleChangeValue({\n newText: dObj.absolute,\n newValue: dObj.numeric$,\n occ_index,\n prop: this_field,\n sentenceCase: false\n });\n }\n }\n }}\n />\n {reactData.fields[this_field].prompt.newLine && (occ_index === 0) &&\n \n {reconcilePrompt({\n rawValue: reactData.fields[this_field].prompt.value,\n this_field\n })}\n \n }\n \n }\n {((reactData.fields[this_field].type === 'date')\n || (reactData.fields[this_field].type === 'time')) &&\n {\n if (event.target.value) {\n let dObj = makeDate(event.target.value, { noTime: (reactData.fields[this_field].type === 'date'), noYearCorrection: true });\n if (!dObj.error) {\n await handleChangeValue({\n newText: dObj.absolute,\n newValue: ((reactData.fields[this_field].type === 'date')\n ? dObj.numeric$\n : dObj.timestamp),\n prop: this_field,\n occ_index,\n sentenceCase: false\n });\n }\n }\n }}\n helperText={((occ_index > 0) ? null : reconcilePrompt({\n rawValue: reactData.fields[this_field].prompt.value,\n this_field\n }))}\n />\n }\n {(reactData.fields[this_field].type.startsWith('select')) &&\n \n \n \n }\n {(reactData.fields[this_field].type === 'html') &&\n \n \n \n }\n {(reactData.fields[this_field].type === 'image') &&\n \n }\n {(reactData.fields[this_field].type === 'url') &&\n \n \n {reactData.fields[this_field].prompt.helper || `Tap here for ${reconcilePrompt({\n rawValue: reactData.fields[this_field].prompt.value,\n this_field\n })}`}\n \n \n }\n {(reactData.fields[this_field].type === 'signature') &&\n \n \n {(occ_index === 0) &&\n \n {reconcilePrompt({\n rawValue: reactData.fields[this_field].prompt.value,\n this_field\n })}\n \n }\n \n {signatureRef[reactData.fields[this_field].options.sigRefNumber || 0].current &&\n {\n signatureRef[reactData.fields[this_field].options.sigRefNumber || 0].current.clear();\n setForceRedisplay(!forceRedisplay);\n }}\n >\n {'Clear'}\n \n }\n \n \n }\n {(reactData.fields[this_field].type === 'id') &&\n \n \n {\n return {\n label: (reactData.peopleList[reactData.fields[this_field].choose.ref].find(this_person => {\n return (this_person.value === this_value);\n })).label,\n value: this_value\n };\n })\n : []\n )\n ) : []\n }\n placeholder={``}\n onChange={async (values) => {\n if (values.length > 0) {\n await handleChangeValue({\n newText: values[0].label,\n newValue: values[0].value,\n occ_index,\n prop: this_field,\n sentenceCase: false\n });\n }\n }}\n />\n {(occ_index === 0) &&\n \n \n {reconcilePrompt({\n rawValue: reactData.fields[this_field].prompt.value,\n this_field\n })}\n \n \n }\n \n \n }\n \n\n ))}\n \n )\n )\n )}\n \n )\n ))}\n \n \n {\n updateReactData({\n stage: 'exit'\n }, true);\n }}\n >\n {'Exit'}\n \n \n {!reactData.formRec?.options?.noSaveContinue && !reactData.clientSampleMode &&\n {\n const document_id = reactData.document_id || `${state.session.patient_id}_${reactData.form_id}_${new Date().getTime()}`;\n await handleSave({\n document_id,\n final: false\n });\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'lightcyan', color: 'black' }}\n size='small'\n >\n {isMobile() ? 'Save' : 'Save/Continue'}\n \n }\n {!reactData.clientSampleMode &&\n {\n await handleReview();\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n >\n {'Finish'}\n \n }\n {\n await printWIP({ document_id: reactData.document_id });\n }}\n edge=\"start\"\n />\n {!reactData.clientSampleMode &&\n {\n updateReactData({\n stage: 'upload'\n }, true);\n }}\n />\n }\n \n \n \n }\n {(reactData.stage === 'upload') &&\n {\n updateReactData({\n stage: 'fill'\n }, true);\n }}\n onLoad={async (response) => {\n const docRec = await updateDocument({\n docData: Object.assign({},\n reactData.docRec,\n {\n document_id: reactData.document_id,\n form_type: reactData.form_id,\n pertains_to: reactData.pertains_to,\n client_id: state.session.client_id\n }\n ),\n author: state.session.user_id,\n save_type: 'uploaded',\n url: response[0].fLoc\n });\n if (!docRec) {\n updateReactData({\n stage: 'fill'\n }, true);\n }\n else {\n onClose('docAdded',\n {\n document_id: reactData.document_id,\n document_title: reactData.document_title,\n document_status: 'uploaded',\n location: response[0],\n pertains_to: reactData.pertains_to,\n recWritten: docRec,\n nextAction: (reactData.formRec?.options?.onFinish\n ? makeNextAction({ instruction: reactData.formRec?.options?.onFinish })\n : null\n )\n }\n );\n };\n }}\n />\n }\n {(reactData.stage === 'confirm') &&\n {\n updateReactData({\n stage: 'fill'\n }, true);\n }}\n onConfirm={async () => {\n let response = await handleSave({\n document_id: reactData.document_id,\n final: true,\n pending: !!reactData.errorsOnForm\n });\n if (!response.goodPut) {\n updateReactData({\n stage: 'error',\n errorMessage: makeArray(response.putError)\n }, true);\n }\n else {\n onClose('docAdded',\n {\n document_id: reactData.document_id,\n document_title: reactData.document_title,\n document_status: response.status,\n location: response.location,\n pertains_to: reactData.pertains_to,\n recWritten: Object.assign({}, response.recWritten, reactData.peopleRec[reactData.pertains_to]),\n nextAction: (reactData.formRec?.options?.onFinish\n ? makeNextAction({ instruction: reactData.formRec?.options?.onFinish })\n : null\n )\n }\n );\n }\n }}\n />\n }\n {(reactData.stage === 'exit') &&\n {\n updateReactData({\n stage: 'fill'\n }, true);\n }}\n onConfirm={async () => {\n if (reactData.dataSaved) {\n onClose('docAdded',\n {\n document_id: reactData.document_id,\n document_title: reactData.document_title,\n document_status: 'work_in_process',\n pertains_to: reactData.pertains_to,\n recWritten: reactData.recWritten\n }\n );\n }\n else {\n onClose('aborted',\n {\n document_id: 'n/a',\n document_status: 'aborted'\n }\n );\n }\n }}\n allowCancel={true}\n />\n }\n {(reactData.stage === 'error') &&\n {\n updateReactData({\n stage: 'fill'\n }, true);\n }}\n />\n }\n {\n reactData.alert &&\n {\n updateReactData({\n alert: false\n }, true);\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center'\n }}\n >\n \n {([reactData.alert.action].flat()).map((this_action, actionNdx) => (\n this_action.function()}\n >\n {this_action.text}\n \n ))}\n \n : null\n )}\n variant='filled'\n onClose={() => {\n updateReactData({\n alert: false\n }, true);\n }}\n >\n {reactData.alert.title && {reactData.alert.title}}\n {reactData.alert.message}\n \n \n }\n \n );\n\n};\n","import React from 'react';\nimport useSession from '../../hooks/useSession';\n\nimport { dbClient, recordExists, cl, deepCopy } from '../../util/AVAUtilities';\nimport { AVATextStyle } from '../../util/AVAStyles';\nimport { makeDate } from '../../util/AVADateTime';\nimport { documentDueDate } from '../../util/AVADocuments';\n\nimport { Typography, Box } from '@material-ui/core/';\n\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle';\nimport EditIcon from '@material-ui/icons/Edit';\nimport AddCircleIcon from '@material-ui/icons/AddCircle';\nimport RadioButtonUncheckedIcon from '@material-ui/icons/RadioButtonUnchecked';\nimport DynamicFeedIcon from '@material-ui/icons/DynamicFeed';\n\nimport FormFillB from '../forms/FormFillB';\n\nexport default ({ currentValues, reactData, updateReactData }) => {\n\n const { state } = useSession();\n const isMounted = React.useRef(false);\n\n const checkCircleDisplayed = React.useRef(false);\n const circleDisplayed = React.useRef(false);\n const orangeCircleDisplayed = React.useRef(false);\n const redCircleDisplayed = React.useRef(false);\n\n const redPencilDisplayed = React.useRef(false);\n const orangePencilDisplayed = React.useRef(false);\n const pencilDisplayed = React.useRef(false);\n\n const addAmendmentDisplayed = React.useRef(false);\n const historyAmendmentDisplayed = React.useRef(false);\n const historyDisplayed = React.useRef(false);\n\n async function initialize() {\n let masterFormList = {};\n if (!reactData.groupObj) {\n if (!state.groups) {\n if (isMounted.current) {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Still loading Group information',\n message: `AVA is still loading. Wait just a moment and try again, please.`\n }\n }, true);\n return;\n }\n }\n else {\n updateReactData({\n groupObj: deepCopy(state.groups)\n }, true);\n }\n }\n // get all the groups that this person belongs to\n // and build myFormListObj with one object for each form assigned to members of this person's groups\n let my_form_people = [currentValues.peopleRec.person_id];\n if (currentValues.peopleRec.myFamilyMembers && (Object.keys(currentValues.peopleRec.myFamilyMembers).length > 0)) {\n for (let this_person in currentValues.peopleRec.myFamilyMembers) {\n my_form_people.push(this_person);\n }\n }\n for (let this_person of my_form_people) {\n let myFormListObj = {};\n let myPersonRec = await dbClient\n .get({\n Key: {\n person_id: this_person\n },\n TableName: \"People\"\n })\n .promise()\n .catch(error => {\n console.log({ 'Error reading People': error });\n });\n if (recordExists(myPersonRec)) {\n for (let this_groupID of myPersonRec.Item.groups) {\n // get all the forms that are assigned people in this group \n let this_group;\n let groupRec = await dbClient\n .get({\n Key: {\n client_id: state.session.client_id,\n group_id: this_groupID\n },\n TableName: \"Groups\"\n })\n .promise()\n .catch(error => {\n console.log({ 'Error reading Groups': error });\n });\n if (recordExists(groupRec)) {\n this_group = groupRec.Item;\n }\n if (this_group && this_group.forms) {\n for (let this_form of this_group.forms) {\n const formData = await documentDueDate(state.session.client_id, this_form);\n let view_only = false;\n if (formData) {\n if (formData.formRec?.options?.restricted_access && !reactData.administrative_account) {\n if (formData.formRec.options.restricted_access === 'admin_only') {\n continue;\n }\n if (formData.formRec.options.restricted_access === 'view_only') {\n view_only = true;\n }\n }\n myFormListObj[this_form] = {\n why: this_group.group_name,\n form_id: this_form,\n form_name: formData.formRec.form_name,\n options: formData.formRec.options || {},\n dueDate: formData.due_date,\n view_only,\n wipDocs: [],\n assignedDocs: [],\n completedDocs: [],\n isUpdating: false,\n isAmending: false\n };\n }\n }\n }\n }\n // get all Documents for this person\n let allDocs = await dbClient\n .query({\n KeyConditionExpression: 'pertains_to = :p',\n IndexName: 'person_form-index',\n TableName: 'DocumentMaster',\n ExpressionAttributeValues: {\n ':p': this_person\n }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading CompletedDocuments; error is ${error}`);\n });\n if (recordExists(allDocs)) {\n for (const this_doc of allDocs.Items) {\n if ((this_doc.restricted_access === 'admin_only') && (!reactData.administrative_account)) {\n continue; // skip this document\n }\n if (!myFormListObj.hasOwnProperty(this_doc.form_type)) {\n let view_only = false;\n const formData = await documentDueDate(state.session.client_id, this_doc.form_type);\n if (formData.formRec?.options?.restricted_access && !reactData.administrative_account) {\n if (formData.formRec.options.restricted_access === 'admin_only') {\n continue;\n }\n if (formData.formRec.options.restricted_access === 'view_only') {\n view_only = true;\n }\n }\n myFormListObj[this_doc.form_type] = {\n why: `Assigned by ${this_doc.history[this_doc.history.length - 1].update_by}`,\n form_id: this_doc.form_type,\n form_name: formData.formRec.form_name || this_doc.form_type,\n dueDate: formData.due_date,\n options: formData.formRec.options || {},\n view_only,\n wipDocs: [],\n assignedDocs: [],\n completedDocs: [],\n isUpdating: false,\n isAmending: false\n };\n }\n if (this_doc.status === 'complete') {\n const completed_count = myFormListObj[this_doc.form_type].completedDocs.length;\n const cObj = {\n document_id: this_doc.document_id,\n location: this_doc.history[0].url,\n last_update: this_doc.history[0].last_update,\n date_completed: makeDate(this_doc.history[0].last_update).relative,\n title: this_doc.title,\n amendments: this_doc.amendments\n };\n if ((completed_count === 0) || (this_doc.history[0].last_update > myFormListObj[this_doc.form_type].completedDocs[0].last_update)) {\n myFormListObj[this_doc.form_type].completedDocs.unshift(cObj);\n }\n else if (this_doc.history[0].last_update < myFormListObj[this_doc.form_type].completedDocs[completed_count - 1].last_update) {\n myFormListObj[this_doc.form_type].completedDocs.push(cObj);\n }\n else {\n const foundAt = myFormListObj[this_doc.form_type].completedDocs.findIndex(d => {\n return (d.last_update < this_doc.history[0].last_update);\n });\n myFormListObj[this_doc.form_type].completedDocs.splice(foundAt, 0, cObj);\n }\n }\n else if ((this_doc.status === 'in_process') || (this_doc.status === 'pending')) {\n if ((myFormListObj[this_doc.form_type].wipDocs.length > 0) && (myFormListObj[this_doc.form_type].wipDocs[0].last_update < this_doc.history[0].last_update)) {\n myFormListObj[this_doc.form_type].wipDocs.unshift({\n document_id: this_doc.document_id,\n last_update: this_doc.history[0].last_update,\n doc_status: this_doc.status,\n due_date: this_doc.due_date || myFormListObj[this_doc.form_type].dueDate,\n title: this_doc.title\n });\n }\n else {\n myFormListObj[this_doc.form_type].wipDocs.push({\n document_id: this_doc.document_id,\n last_update: this_doc.history[0].last_update,\n doc_status: this_doc.status,\n due_date: this_doc.due_date || myFormListObj[this_doc.form_type].dueDate,\n title: this_doc.title\n });\n }\n }\n else {\n myFormListObj[this_doc.form_type].assignedDocs.push({\n document_id: this_doc.document_id,\n last_update: this_doc.history[0].last_update,\n due_date: this_doc.due_date || myFormListObj[this_doc.form_type].dueDate,\n title: this_doc.title\n });\n }\n }\n }\n masterFormList[myPersonRec.Item.person_id] = {\n person_id: myPersonRec.Item.person_id,\n person_first_name: myPersonRec.Item.name.first,\n myFormListObj\n };\n }\n }\n updateReactData({\n masterFormList,\n formsInitialized: true\n }, true);\n }\n\n const setPencilColor = (rObj) => {\n if (!rObj || (rObj.completedDocs.length > 0)) {\n pencilDisplayed.current = true;\n return null;\n }\n else if (rObj.wipDocs.length > 0) {\n orangePencilDisplayed.current = true;\n return 'orange';\n }\n else {\n redPencilDisplayed.current = true;\n return 'red';\n }\n };\n\n const setCheckCircleColor = (rObj) => {\n if (!rObj) {\n checkCircleDisplayed.current = true;\n return 'green';\n }\n if (!rObj || (rObj.completedDocs.length > 0)) {\n circleDisplayed.current = true;\n return null;\n }\n else if (rObj.wipDocs.length > 0) {\n orangeCircleDisplayed.current = true;\n return 'orange';\n }\n else {\n redCircleDisplayed.current = true;\n return 'red';\n }\n };\n\n const setRefTrue = (refToSet) => {\n if (refToSet) {\n refToSet.current = true;\n }\n return null;\n };\n\n React.useEffect(() => {\n initialize();\n isMounted.current = true;\n return () => { isMounted.current = false; };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const editForm = (this_person_id, this_formID) => {\n if (reactData.masterFormList[this_person_id].myFormListObj[this_formID].wipDocs.length > 0) {\n reactData.masterFormList[this_person_id].myFormListObj[this_formID].isUpdating = reactData.masterFormList[this_person_id].myFormListObj[this_formID].wipDocs[0].document_id;\n }\n else if (reactData.masterFormList[this_person_id].myFormListObj[this_formID].assignedDocs.length > 0) {\n reactData.masterFormList[this_person_id].myFormListObj[this_formID].isUpdating = reactData.masterFormList[this_person_id].myFormListObj[this_formID].assignedDocs[0].document_id;\n }\n else {\n reactData.masterFormList[this_person_id].myFormListObj[this_formID].isUpdating = 'new';\n }\n updateReactData({\n masterFormList: reactData.masterFormList\n }, true);\n };\n\n return (\n \n {!reactData.formHistoryMode && reactData.formsInitialized &&\n \n {isMounted.current && reactData.formsInitialized && Object.keys(reactData.masterFormList).length === 0 &&\n \n {`No Forms were found for you.`}\n \n }\n {Object.values(reactData.masterFormList).map(({\n person_id,\n person_first_name,\n myFormListObj }, pIndex) => (\n \n \n {`${person_first_name}'s Forms`}\n \n {\n Object.keys(myFormListObj).map((this_formID, form_index) => (\n \n \n \n {((reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs.length > 0) &&\n (reactData.masterFormList[person_id].myFormListObj[this_formID].wipDocs.length === 0)) ?\n \n {\n let nowJ = new Date().getTime();\n window.open(`${reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs[0].location}?qt=${nowJ.toString()}`\n , reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs[0].date_completed);\n }}\n size='small'\n />\n \n :\n ((!reactData.masterFormList[person_id].myFormListObj[this_formID].view_only\n || (\n (reactData.masterFormList[person_id].myFormListObj[this_formID].wipDocs.length > 0)\n && reactData.masterFormList[person_id].myFormListObj[this_formID].wipDocs[0].hasOwnProperty('assigned_to')\n && reactData.masterFormList[person_id].myFormListObj[this_formID].wipDocs[0].assigned_to.hasOwnProperty(state.session.patient_id)\n && reactData.masterFormList[person_id].myFormListObj[this_formID].wipDocs[0].assigned_to[state.session.patient_id] !== 'view_only'\n )\n )\n ?\n \n {\n editForm(person_id, this_formID);\n }}\n style={AVATextStyle({\n size: 1.5,\n margin: { right: 0.5 },\n color: setPencilColor(reactData.masterFormList[person_id].myFormListObj[this_formID])\n })}\n size='small'\n />\n \n :\n \n \n \n\n )\n }\n \n {\n if (reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs.length > 0) {\n let nowJ = new Date().getTime();\n window.open(`${reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs[0].location}?qt=${nowJ.toString()}`\n , reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs[0].date_completed);\n }\n else if (!reactData.masterFormList[person_id].myFormListObj[this_formID].view_only) {\n editForm(person_id, this_formID);\n }\n }}\n style={AVATextStyle({\n size: 1.5,\n margin: { left: 0 },\n color: ((reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs.length === 0) ? ((reactData.masterFormList[person_id].myFormListObj[this_formID].wipDocs.length > 0) ? 'orange' : 'red') : null)\n })}\n >\n {reactData.masterFormList[person_id].myFormListObj[this_formID].form_name}\n \n {(reactData.masterFormList[person_id].myFormListObj[this_formID].dueDate || (reactData.masterFormList[person_id].myFormListObj[this_formID].wipDocs.length > 0)) &&\n (reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs.length === 0) &&\n 0) ? 'orange' : 'red')\n })}\n >\n {(reactData.masterFormList[person_id].myFormListObj[this_formID].wipDocs.length > 0)\n ? `${((reactData.masterFormList[person_id].myFormListObj[this_formID].wipDocs[0].doc_status === 'pending') ? 'Pending review' : 'Started but incomplete')}`\n : `Not started`\n }\n {(reactData.masterFormList[person_id].myFormListObj[this_formID].dueDate) &&\n ` - Due by ${makeDate(reactData.masterFormList[person_id].myFormListObj[this_formID].dueDate).relative}`\n }\n \n }\n {(reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs.length > 0) &&\n \n \n {reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs[0].title}\n \n \n {`Completed ${makeDate(reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs[0].last_update).relative}`}\n \n \n }\n \n \n \n {(reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs.length > 0) &&\n \n {reactData.masterFormList[person_id].myFormListObj[this_formID].options?.allowAmendments &&\n reactData.administrative_account &&\n \n {\n reactData.masterFormList[person_id].myFormListObj[this_formID].isAmending = reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs[0].document_id;\n updateReactData({\n isAmendingForm: {\n person_id,\n form_id: this_formID,\n document_id: reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs[0].document_id\n },\n myFormListObj: reactData.masterFormList[person_id].myFormListObj\n }, true);\n }}\n />\n \n }\n {(reactData.masterFormList[person_id].myFormListObj[this_formID].completedDocs.length > 1) &&\n \n {\n updateReactData({\n formHistoryMode: {\n person_id,\n this_formID\n }\n }, true);\n }}\n />\n \n }\n {(reactData.masterFormList[person_id].myFormListObj[this_formID].wipDocs.length === 0) &&\n (reactData.administrative_account || !reactData.masterFormList[person_id].myFormListObj[this_formID].view_only) &&\n \n {\n editForm(person_id, this_formID);\n }}\n size='small'\n />\n \n }\n \n }\n \n \n {reactData.masterFormList[person_id].myFormListObj[this_formID].isUpdating &&\n {\n reactData.masterFormList[person_id].myFormListObj[this_formID].isUpdating = false;\n updateReactData({\n masterFormList: reactData.masterFormList\n }, false);\n await initialize();\n }}\n />\n }\n {reactData.masterFormList[person_id].myFormListObj[this_formID].isPrinting &&\n {\n reactData.masterFormList[person_id].myFormListObj[this_formID].isPrinting = false;\n updateReactData({\n masterFormList: reactData.masterFormList\n }, true);\n }}\n />\n }\n \n ))\n }\n \n ))}\n \n }\n {reactData.isAmendingForm &&\n {\n reactData.masterFormList[reactData.isAmendingForm.person_id][reactData.isAmendingForm.form_id].isAmending = false;\n updateReactData({\n isAmendingForm: false,\n masterFormList: reactData.masterFormList\n }, true);\n }}\n />\n }\n {reactData.formHistoryMode &&\n \n \n {`History - ${reactData.masterFormList[reactData.formHistoryMode.person_id].myFormListObj[reactData.formHistoryMode.this_formID].form_name}`}\n \n {reactData.masterFormList[reactData.formHistoryMode.person_id].myFormListObj[reactData.formHistoryMode.this_formID].completedDocs.map((this_doc, docNdx) => (\n \n \n {\n let printList = ([this_doc.file_location || this_doc.location]).concat(\n this_doc.amendments\n ? this_doc.amendments.map(this_amendment => {\n return this_amendment.file_location;\n })\n : []\n );\n printList.forEach((this_document, ndx) => {\n if (this_document) {\n window.open(this_document);\n }\n });\n }}\n >\n \n {this_doc.title}\n \n \n {`Completed ${this_doc.date_completed}`}\n \n \n \n {reactData.masterFormList[reactData.formHistoryMode.person_id].myFormListObj[reactData.formHistoryMode.this_formID].options?.allowAmendments &&\n reactData.administrative_account &&\n \n {\n reactData.masterFormList[reactData.formHistoryMode.person_id].myFormListObj[reactData.formHistoryMode.this_formID].isAmending = this_doc.document_id;\n updateReactData({\n isAmendingForm: {\n form_id: reactData.formHistoryMode,\n document_id: this_doc.document_id\n },\n masterFormList: reactData.masterFormList\n }, true);\n }}\n />\n \n }\n \n \n \n ))}\n {\n updateReactData({\n formHistoryMode: false\n }, true);\n }}\n >\n \n {`Exit history mode`}\n \n \n \n }\n {!reactData.formHistoryMode &&\n isMounted.current &&\n reactData.formsInitialized &&\n Object.keys(reactData.masterFormList).length > 0 &&\n \n \n {`Icon guide`}\n \n {checkCircleDisplayed.current &&\n \n \n \n {`View a completed form`}\n \n \n }\n {(circleDisplayed.current || redCircleDisplayed.current || orangeCircleDisplayed.current) &&\n \n \n \n {`You will be able to view this form after it is completed`}\n \n \n }\n {redPencilDisplayed.current &&\n \n \n \n {`Start a new form`}\n \n \n }\n {orangePencilDisplayed.current &&\n \n \n \n {`Update an incomplete or pending form`}\n \n \n }\n {addAmendmentDisplayed.current &&\n \n \n \n {`Amend a completed form`}\n \n \n }\n {pencilDisplayed.current &&\n \n \n \n {`Replace a completed form`}\n \n \n }\n {historyDisplayed.current &&\n \n \n \n {`Show history`}\n \n \n }\n \n }\n {reactData.formHistoryMode &&\n isMounted.current &&\n reactData.formsInitialized &&\n historyAmendmentDisplayed.current &&\n \n \n {`Icon guide - History screen`}\n \n {historyAmendmentDisplayed.current &&\n \n \n \n {`Amend a completed form`}\n \n \n }\n \n }\n \n );\n};","import React from 'react';\nimport { Box, Typography, Switch, Checkbox } from '@material-ui/core/';\nimport { getPerson } from '../../util/AVAPeople';\n\nimport TextField from '@material-ui/core/TextField';\nimport { makeDate } from '../../util/AVADateTime';\nimport { AVATextStyle } from '../../util/AVAStyles';\n\nexport default ({ currentValues, ogValues, errorList, reactData, setError, updateField }) => {\n\n return (\n \n \n {\n let proposedID = event.target.value.trim().toLowerCase();\n if ((proposedID !== currentValues.peopleRec.person_id) || (errorList.hasOwnProperty('person_id'))) { // id changed or previously in error?\n if (!proposedID) {\n proposedID = ogValues.peopleRec.person_id;\n }\n else if (proposedID !== ogValues.peopleRec.person_id) { // We don't need to check the ID if you changed it back to its og value\n // check to see if that ID is available\n const person_id_exists = await getPerson(proposedID, 'validate');\n if (person_id_exists) {\n // it DOES exist already. This is an error\n setError({\n errorField: 'person_id',\n errorValue: proposedID,\n isError: true,\n errorMessage: `The ID ${proposedID} is already taken.`\n });\n return;\n }\n }\n // all good\n // update the data\n let updateObj = {\n updateList: [{\n tableName: 'peopleRec',\n fieldName: 'person_id',\n newData: proposedID\n },\n {\n tableName: 'sessionRec',\n fieldName: 'session_id',\n newData: proposedID\n },\n {\n tableName: 'sessionRec',\n fieldName: 'user_id',\n newData: proposedID\n }]\n };\n // clear error if one existed\n if (errorList.hasOwnProperty('person_id')) {\n updateObj.errorObj = {\n errorField: 'person_id',\n isError: false\n };\n }\n await updateField(updateObj);\n }\n }}\n helperText={errorList.hasOwnProperty('person_id') ? errorList.person_id.errorMessage : 'User ID'}\n />\n \n \n {!reactData.mandatory_passwords\n // Require Password \n ? \n \n {'Require a password to log in?'}\n \n \n \n {'Simplified Log-in'}\n \n {\n const newValue = !currentValues.peopleRec.requirePassword;\n let updateObj = {\n updateList: [{\n tableName: 'peopleRec',\n fieldName: 'requirePassword',\n newData: newValue\n },\n {\n tableName: 'sessionRec',\n fieldName: 'requirePassword',\n newData: newValue\n }]\n };\n if (newValue && (!currentValues.sessionRec.last_login || (currentValues.sessionRec.last_login.length < 5))) {\n updateObj.errorObj = {\n errorField: 'password',\n errorValue: currentValues.sessionRec.last_login,\n isError: true,\n errorMessage: `Please enter a password that is at least 5 characters in length`\n };\n }\n await updateField(updateObj);\n }}\n name=\"PWDrequired\"\n color=\"primary\"\n />\n \n {'Password Required'}\n \n \n \n : \n {`${reactData.client_name} requires passwords for all accounts`}\n \n }\n {reactData.administrative_account &&\n // Force Password change\n \n \n {'Force Password Change?'}\n \n \n \n {'No'}\n \n {\n const newValue = !currentValues.sessionRec.forceSetPassword;\n let updateObj = {\n updateList: [{\n tableName: 'peopleRec',\n fieldName: 'forceSetPassword',\n newData: newValue\n },\n {\n tableName: 'sessionRec',\n fieldName: 'forceSetPassword',\n newData: newValue\n }]\n };\n await updateField(updateObj);\n }}\n name=\"ForcePWDchange\"\n color=\"primary\"\n />\n \n {'Yes'}\n \n \n \n }\n {currentValues.peopleRec.requirePassword &&\n \n {\n let proposedPass = event.target.value.trim();\n if (proposedPass.length < 5) { // invalid password\n if ((!proposedPass || (proposedPass.length === 0)) && ogValues.sessionRec.last_login) {\n proposedPass = ogValues.sessionRec.last_login;\n }\n else { // Don't have a good password yet\n setError({\n errorField: 'password',\n errorValue: proposedPass,\n isError: true,\n errorMessage: `Please enter a password that is at least 5 characters in length`\n });\n return;\n }\n }\n // all good\n // update the data\n let updateObj = {\n updateList: [{\n tableName: 'peopleRec',\n fieldName: 'newPassword',\n newData: proposedPass\n },\n {\n tableName: 'sessionRec',\n fieldName: 'last_login',\n newData: proposedPass\n },\n {\n tableName: 'peopleRec',\n fieldName: 'password_change_date',\n newData: `${makeDate(new Date()).oaDate}`\n },\n {\n tableName: 'sessionRec',\n fieldName: 'password_change_date',\n newData: `${makeDate(new Date()).oaDate}`\n }\n ]\n };\n // clear error if one existed\n if (errorList.hasOwnProperty('person_id')) {\n updateObj.errorObj = {\n errorField: 'password',\n isError: false\n };\n }\n await updateField(updateObj);\n }}\n helperText={errorList.hasOwnProperty('password') ? errorList.password.errorMessage : 'Password'}\n />\n \n }\n {reactData.administrative_account && !reactData.master_account &&\n \n \n {`Account Class`}\n \n \n {[{ option: 'support', label: 'Support' },\n { option: 'admin', label: 'Admin' },\n { option: 'camper', label: 'Camper' },\n { option: 'family', label: 'Family/Other' },\n { option: '', label: 'Standard' }\n ].map((this_option, tIndex) => (\n \n {\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'account_class',\n newData: this_option.option\n }]\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n \n {`${this_option.label}`}\n \n \n ))}\n \n \n }\n {reactData.master_account &&\n \n \n {`Account Class`}\n \n \n {[{ option: 'master', label: 'Master' },\n { option: 'support', label: 'Support' },\n { option: 'admin', label: 'Admin' },\n { option: 'camper', label: 'Camper' },\n { option: 'family', label: 'Family/Other' },\n { option: '', label: 'Standard' }\n ].map((this_option, tIndex) => (\n \n {\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'account_class',\n newData: this_option.option\n }]\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n \n {`${this_option.label}`}\n \n \n ))}\n \n \n }\n \n \n );\n};\n","import React from 'react';\n\nimport Typography from '@material-ui/core/Typography';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport { Box, Checkbox, IconButton, TextField, Button } from '@material-ui/core';\n\nimport { formatPhone } from '../../util/AVAPeople';\nimport { isEmpty, isMobile } from '../../util/AVAUtilities';\nimport { AVATextStyle, AVAclasses } from '../../util/AVAStyles';\nimport { makeTime } from '../../util/AVADateTime';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport ArrowDownwardIcon from '@material-ui/icons/ArrowDownward';\nimport ArrowUpwardIcon from '@material-ui/icons/ArrowUpward';\n\nexport default ({ currentValues, errorList, setError, updateField, reactData }) => {\n\n const AVAClass = AVAclasses();\n\n const messageOptions = [\n {\n option: 'ava',\n label: 'AVA',\n enabled: ' only',\n show: true,\n exclusive: true\n },\n {\n option: 'sms',\n label: `Text message`,\n enabled: (isEmpty(currentValues.peopleRec.contact_info?.cell?.number) ? false : ` to ${formatPhone(currentValues.peopleRec.contact_info.cell.number)}`),\n show: !isEmpty(currentValues.peopleRec.contact_info?.cell?.number),\n exclusive: false\n },\n {\n option: 'email',\n label: `e-Mail`,\n enabled: (isEmpty(currentValues.peopleRec.contact_info?.email?.address) ? false : ` to ${currentValues.peopleRec.contact_info.email.address}`),\n show: !isEmpty(currentValues.peopleRec.contact_info?.email?.address),\n exclusive: false\n },\n {\n option: 'alt_email',\n label: `e-Mail`,\n enabled: (isEmpty(currentValues.peopleRec.contact_info?.alt_email?.address) ? false : ` to ${currentValues.peopleRec.contact_info.alt_email.address}`),\n show: !isEmpty(currentValues.peopleRec.contact_info?.alt_email?.address),\n exclusive: false\n },\n {\n option: 'voice',\n label: `Phone call`,\n enabled: (isEmpty(currentValues.peopleRec.contact_info?.landline?.number) ? false : ` to ${formatPhone(currentValues.peopleRec.contact_info.landline.number)}`),\n show: !isEmpty(currentValues.peopleRec.contact_info?.landline?.number),\n exclusive: false\n },\n {\n option: 'voice_cell',\n label: `Phone call`,\n enabled: ` to ${formatPhone(currentValues.peopleRec.contact_info?.cell?.number)}`,\n show: !isEmpty(currentValues.peopleRec.contact_info?.cell?.number) && (currentValues.peopleRec.contact_info?.cell.number !== currentValues.peopleRec.contact_info?.landline?.number),\n exclusive: false\n },\n {\n option: 'voice_work',\n label: `Phone call`,\n enabled: ` to Work at ${formatPhone(currentValues.peopleRec.contact_info?.work?.number)}`,\n show: !isEmpty(currentValues.peopleRec.contact_info?.work?.number),\n exclusive: false\n },\n {\n option: 'text_alternate',\n label: `Text message`,\n enabled: ` to ${formatPhone(currentValues.peopleRec.contact_info?.alternate?.number)}`,\n show: !isEmpty(currentValues.peopleRec.contact_info?.alternate?.number),\n exclusive: false\n },\n {\n option: 'voice_alternate',\n label: `Phone call`,\n enabled: ` to ${formatPhone(currentValues.peopleRec.contact_info?.alternate?.number)}`,\n show: !isEmpty(currentValues.peopleRec.contact_info?.alternate?.number),\n exclusive: false\n }\n ];\n\n const proxyOptions = () => {\n let response = [{\n option: 'hold',\n label: `Hold`,\n enabled: ` all messages`,\n show: true,\n exclusive: true\n }];\n if (currentValues.peopleRec.proxy_allowed_from) {\n for (let proxy_id in currentValues.peopleRec.proxy_allowed_from) {\n response.unshift({\n option: `person_id:${proxy_id}`,\n label: `Send to `,\n enabled: currentValues.peopleRec.proxy_allowed_from[proxy_id],\n show: true,\n exclusive: false\n });\n }\n }\n return response;\n };\n\n return (\n \n \n {`Typically, I prefer to receive communications via...`}\n \n \n {messageOptions.map((this_option, tIndex) => (\n this_option.show &&\n \n {\n if (!currentValues.peopleRec.preferred_methods) {\n currentValues.peopleRec.preferred_methods = [];\n }\n let optionAt = currentValues.peopleRec.preferred_methods.findIndex(this_method => {\n return (this_method === this_option.option);\n });\n if (optionAt === -1) {\n currentValues.peopleRec.preferred_methods.push(this_option.option);\n }\n else {\n currentValues.peopleRec.preferred_methods.splice(optionAt, 1);\n }\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'preferred_method',\n newData: this_option.option\n },\n {\n tableName: 'peopleRec',\n fieldName: 'preferred_methods',\n newData: currentValues.peopleRec.preferred_methods\n }]\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n \n {`${this_option.label}${this_option.enabled || ''}`}\n \n \n ))}\n \n\n \n {`You may add keywords here that automatically flag an incoming message as urgent.`}\n \n {\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'urgent_keyWords',\n newData: event.target.value\n }]\n });\n }}\n helperText='Treat a message as urgent if it contains any of these keywords'\n />\n\n \n \n {`Use Rules to set alternate delivery options based on content, urgency, time of day, and day of week`}\n \n {currentValues.peopleRec.time_based_rules && (currentValues.peopleRec.time_based_rules.length > 1) &&\n \n {`These rules will be evaluated in the order they appear below (the first one that matches \"wins\")`}\n \n }\n {\n if (!currentValues.peopleRec.time_based_rules) {\n currentValues.peopleRec.time_based_rules = [];\n }\n currentValues.peopleRec.time_based_rules.unshift({\n name: `${(currentValues.peopleRec.name?.first ? (currentValues.peopleRec.name?.first + \"'s\").replace(\"s's\", \"s'\") : 'My')} New Rule`,\n methods: ['ava'],\n method: 'ava'\n });\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'time_based_rules',\n newData: currentValues.peopleRec.time_based_rules\n }]\n });\n }}\n className={AVAClass.AVAButton}\n style={{ marginLeft: 0, backgroundColor: 'white', color: 'black' }}\n size='small'\n >\n {'Add a Rule'}\n \n \n\n \n {currentValues.peopleRec.time_based_rules\n && currentValues.peopleRec.time_based_rules.map((this_rule, i) => (\n !this_rule.global_rule &&\n \n \n \n {!this_rule.rule_id &&\n \n {this_rule.rule_id = `${new Date().getTime()}_${i}`}\n \n }\n {!this_rule.name &&\n \n {this_rule.name = `${(currentValues.peopleRec.name?.first ? (currentValues.peopleRec.name?.first + \"'s\").replace(\"s's\", \"s'\") : 'My')} Rule #${i + 1}`}\n \n }\n \n \n {\n if (!currentValues.peopleRec.time_based_rules[i]) {\n currentValues.peopleRec.time_based_rules[i] = this_rule;\n }\n currentValues.peopleRec.time_based_rules[i].name = event.target.value;\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'time_based_rules',\n newData: currentValues.peopleRec.time_based_rules\n }]\n });\n }}\n helperText='Rule Name'\n />\n \n {(!this_rule.global_rule) &&\n \n {(i < (currentValues.peopleRec.time_based_rules.length - 1)) && (!currentValues.peopleRec.time_based_rules[i + 1].global_rule) &&\n {\n currentValues.peopleRec.time_based_rules.splice(i, 1);\n currentValues.peopleRec.time_based_rules.splice(i + 1, 0, this_rule);\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'time_based_rules',\n newData: currentValues.peopleRec.time_based_rules\n }]\n };\n await updateField(updateObj);\n }}\n >\n \n \n }\n {(i > 0) &&\n {\n currentValues.peopleRec.time_based_rules.splice(i, 1);\n currentValues.peopleRec.time_based_rules.splice(i - 1, 0, this_rule);\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'time_based_rules',\n newData: currentValues.peopleRec.time_based_rules\n }]\n };\n await updateField(updateObj);\n }}\n >\n \n \n }\n {\n currentValues.peopleRec.time_based_rules.splice(i, 1);\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'time_based_rules',\n newData: currentValues.peopleRec.time_based_rules\n }]\n };\n let instructions = [];\n for (let errorField in errorList) {\n if (errorField.startsWith('time_based_rules__')) {\n const errorIndex = Number(errorField.split(/.*(?:_|^)(.*)/gm)[1]);\n if (errorIndex >= i) {\n instructions.unshift({\n errorField,\n isError: false\n });\n }\n if (errorIndex > i) {\n instructions.push(Object.assign({},\n errorList[errorField],\n { errorField: errorField.replace(`_${errorIndex}`, `_${errorIndex - 1}`) }\n ));\n }\n }\n }\n if (instructions.length > 0) {\n updateObj.errorObj = instructions;\n }\n await updateField(updateObj);\n }}\n >\n \n \n \n }\n \n\n \n \n {\n let from_time = makeTime(event.target.value);\n if (from_time.error || from_time.empty) {\n // This is an error.\n setError({\n errorField: `time_based_rules__time_from_${i}`,\n errorValue: event.target.value,\n isError: true,\n errorMessage: `${event.target.value} is not valid`\n });\n return;\n }\n if (!currentValues.peopleRec.time_based_rules[i]) {\n currentValues.peopleRec.time_based_rules[i] = this_rule;\n }\n currentValues.peopleRec.time_based_rules[i].time_from = from_time.time;\n currentValues.peopleRec.time_based_rules[i].time_range = {\n start: from_time.numeric24,\n end: (this_rule.time_range?.end\n ? this_rule.time_range.end\n : (this_rule.time_to\n ? makeTime(this_rule.time_to).numeric24\n : 2359)\n )\n };\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'time_based_rules',\n newData: currentValues.peopleRec.time_based_rules\n }]\n };\n if (errorList.hasOwnProperty(`time_based_rules__time_from_${i}`)) {\n updateObj.errorObj = {\n errorField: `time_based_rules__time_from_${i}`,\n isError: false\n };\n }\n await updateField(updateObj);\n }}\n />\n {\n let to_time = makeTime(event.target.value);\n if (to_time.error || to_time.empty) {\n // This is an error.\n setError({\n errorField: `time_based_rules__time_to_${i}`,\n errorValue: event.target.value,\n isError: true,\n errorMessage: `${event.target.value} is not valid`\n });\n return;\n }\n if (!currentValues.peopleRec.time_based_rules[i]) {\n currentValues.peopleRec.time_based_rules[i] = this_rule;\n }\n currentValues.peopleRec.time_based_rules[i].time_to = to_time.time;\n currentValues.peopleRec.time_based_rules[i].time_range = {\n end: to_time.numeric24,\n start: (this_rule.time_range?.start\n ? this_rule.time_range.start\n : (this_rule.time_from\n ? makeTime(this_rule.time_from).numeric24\n : 0)\n )\n };\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'time_based_rules',\n newData: currentValues.peopleRec.time_based_rules\n }]\n };\n if (errorList.hasOwnProperty(`time_based_rules__time_to_${i}`)) {\n updateObj.errorObj = {\n errorField: `time_based_rules__time_to_${i}`,\n isError: false\n };\n }\n await updateField(updateObj);\n }}\n />\n \n \n {['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'].map((this_day, day_num) => (\n {\n if (!this_rule.day) {\n this_rule.day = '';\n }\n if (this_rule.day?.includes(day_num.toString())) {\n let s = currentValues.peopleRec.time_based_rules[i].day;\n let c = day_num.toString();\n let l = s.replace(c, \"\");\n console.log(l);\n this_rule.day = l;\n console.log(currentValues.peopleRec.time_based_rules[i].day);\n }\n else {\n currentValues.peopleRec.time_based_rules[i].day += day_num.toString();\n }\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'time_based_rules',\n newData: currentValues.peopleRec.time_based_rules\n }]\n });\n }}\n inputProps={{ 'aria-labelledby': `message_routing_${i}_${day_num}` }}\n />\n }\n label={\n \n {this_day}\n }\n labelPlacement='bottom'\n />\n ))}\n \n \n {\n if (!currentValues.peopleRec.time_based_rules[i]) {\n currentValues.peopleRec.time_based_rules[i] = this_rule;\n }\n currentValues.peopleRec.time_based_rules[i].keyWords = event.target.value;\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'time_based_rules',\n newData: currentValues.peopleRec.time_based_rules\n }]\n });\n }}\n helperText='During these times, only use this rule if a message contains any of these keywords'\n />\n\n\n\n \n {\n if (!currentValues.peopleRec.time_based_rules[i]) {\n currentValues.peopleRec.time_based_rules[i] = this_rule;\n }\n currentValues.peopleRec.time_based_rules[i].when_urgent = !currentValues.peopleRec.time_based_rules[i].when_urgent;\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'time_based_rules',\n newData: currentValues.peopleRec.time_based_rules\n }]\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n \n {`During these times, only use this rule if a message is marked Urgent`}\n \n \n \n \n {this_rule.global_rule\n ? `When this rule applies, adminstrators force communications via...`\n : `When this rule applies, I prefer communications via...`\n }\n \n \n {(messageOptions.concat(proxyOptions())).map((this_option, tIndex) => (\n this_option.show &&\n \n {\n if (!this_rule.methods) {\n this_rule.methods = (this_rule.method\n ? [this_rule.method]\n : currentValues.peopleRec.preferred_methods);\n }\n let optionAt = this_rule.methods.findIndex(this_method => {\n return (this_method === this_option.option);\n });\n if (optionAt === -1) {\n // wasn't there before; you must have clicked it ON\n if (this_option.exclusive) {\n currentValues.peopleRec.time_based_rules[i].methods = [this_option.option];\n }\n else {\n // have to turn off any exclusive option that was previously on\n let previous_option = messageOptions.find(check_option => {\n return (check_option.option === this_rule.method);\n });\n if (this_rule.method === 'hold' || previous_option?.exclusive) {\n currentValues.peopleRec.time_based_rules[i].methods = [this_option.option];\n }\n else {\n currentValues.peopleRec.time_based_rules[i].methods.push(this_option.option);\n }\n }\n currentValues.peopleRec.time_based_rules[i].method = this_option.option; // older style, single method only\n }\n else {\n // was there before; you must have clicked it OFF\n if (this_rule.methods.length === 1) {\n // nothing is left?\n currentValues.peopleRec.time_based_rules[i].methods = currentValues.peopleRec.preferred_methods;\n currentValues.peopleRec.time_based_rules[i].method = currentValues.peopleRec.preferred_methods[0];\n }\n else {\n currentValues.peopleRec.time_based_rules[i].methods.splice(optionAt, 1);\n currentValues.peopleRec.time_based_rules[i].method = this_rule.methods[this_rule.methods.length - 1];\n }\n }\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'time_based_rules',\n newData: currentValues.peopleRec.time_based_rules\n }]\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n \n {`${this_option.label}${this_option.enabled || ''}`}\n \n \n ))}\n \n \n\n \n \n {`Rule ID: ${this_rule.rule_id}`}\n \n \n \n ))}\n \n \n );\n};\n","import React from 'react';\n\nimport Typography from '@material-ui/core/Typography';\nimport { Box, Checkbox, IconButton, TextField, Button } from '@material-ui/core';\nimport { makeName } from '../../util/AVAPeople';\nimport { makeDate } from '../../util/AVADateTime';\n\nimport { AVATextStyle, AVAclasses } from '../../util/AVAStyles';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport ArrowDownwardIcon from '@material-ui/icons/ArrowDownward';\nimport ArrowUpwardIcon from '@material-ui/icons/ArrowUpward';\n\nexport default ({ currentValues, errorList, setError, updateField, reactData }) => {\n\n const AVAClass = AVAclasses();\n\n return (\n \n {currentValues.peopleRec.person_notes\n && currentValues.peopleRec.person_notes.map((this_note, i) => (\n \n \n \n {!this_note.note_id &&\n \n {this_note.note_id = `${new Date().getTime()}_${i}`}\n \n }\n {!this_note.name &&\n \n {this_note.name = `${(currentValues.peopleRec.name?.first\n ? (currentValues.peopleRec.name?.first + \"'s\").replace(\"s's\", \"s'\")\n : currentValues.peopleRec.person_id)} note #${i + 1}`}\n \n }\n \n \n {\n if (!currentValues.peopleRec.person_notes[i]) {\n currentValues.peopleRec.person_notes[i] = this_note;\n }\n currentValues.peopleRec.person_notes[i].name = event.target.value;\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'person_notes',\n newData: currentValues.peopleRec.person_notes\n }]\n });\n }}\n helperText='Quick Name/Description'\n />\n \n \n {(i < (currentValues.peopleRec.person_notes.length - 1)) &&\n {\n currentValues.peopleRec.person_notes.splice(i, 1);\n currentValues.peopleRec.person_notes.splice(i + 1, 0, this_note);\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'person_notes',\n newData: currentValues.peopleRec.person_notes\n }]\n };\n await updateField(updateObj);\n }}\n >\n \n \n }\n {(i > 0) &&\n {\n currentValues.peopleRec.person_notes.splice(i, 1);\n currentValues.peopleRec.person_notes.splice(i - 1, 0, this_note);\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'person_notes',\n newData: currentValues.peopleRec.person_notes\n }]\n };\n await updateField(updateObj);\n }}\n >\n \n \n }\n {\n currentValues.peopleRec.person_notes.splice(i, 1);\n let updateObj = {\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'person_notes',\n newData: currentValues.peopleRec.person_notes\n }]\n };\n let instructions = [];\n for (let errorField in errorList) {\n if (errorField.startsWith('person_notes__')) {\n const errorIndex = Number(errorField.split(/.*(?:_|^)(.*)/gm)[1]);\n if (errorIndex >= i) {\n instructions.unshift({\n errorField,\n isError: false\n });\n }\n if (errorIndex > i) {\n instructions.push(Object.assign({},\n errorList[errorField],\n { errorField: errorField.replace(`_${errorIndex}`, `_${errorIndex - 1}`) }\n ));\n }\n }\n }\n if (instructions.length > 0) {\n updateObj.errorObj = instructions;\n }\n await updateField(updateObj);\n }}\n >\n \n \n \n \n\n\n \n \n {\n if (!currentValues.peopleRec.person_notes[i]) {\n currentValues.peopleRec.person_notes[i] = this_note;\n }\n currentValues.peopleRec.person_notes[i].noteText = event.target.value;\n currentValues.peopleRec.person_notes[i].user_id = reactData.user_id;\n currentValues.peopleRec.person_notes[i].user_name = await makeName(reactData.user_id);\n currentValues.peopleRec.person_notes[i].last_update = makeDate(new Date().getTime()).absolute;\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'person_notes',\n newData: currentValues.peopleRec.person_notes\n }]\n });\n }}\n helperText='Note'\n />\n \n \n\n \n {\n if (!currentValues.peopleRec.person_notes[i]) {\n currentValues.peopleRec.person_notes[i] = this_note;\n }\n currentValues.peopleRec.person_notes[i].urgent = !currentValues.peopleRec.person_notes[i].urgent;\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'person_notes',\n newData: currentValues.peopleRec.person_notes\n }]\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n \n {`Highlight/Important?`}\n \n \n\n \n \n {`by: ${this_note.user_name || reactData.user_id}`}\n \n \n {`on: ${makeDate(this_note.last_update || new Date()).absolute}`}\n \n \n {`note ID: ${this_note.note_id}`}\n \n \n \n ))}\n \n {\n if (!currentValues.peopleRec.person_notes) {\n currentValues.peopleRec.person_notes = [];\n }\n currentValues.peopleRec.person_notes.push({\n name: `${(currentValues.peopleRec.name?.first ? (currentValues.peopleRec.name?.first + \"'s\").replace(\"s's\", \"s'\") : 'My')} note #${currentValues.peopleRec.person_notes.length + 1}`\n });\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'person_notes',\n newData: currentValues.peopleRec.person_notes\n }]\n });\n }}\n className={AVAClass.AVAButton}\n style={{ marginLeft: 0, backgroundColor: 'white', color: 'black' }}\n size='small'\n >\n {'Add a Note'}\n \n \n \n );\n};\n","import React from 'react';\n\nimport useSession from '../../hooks/useSession';\n\nimport { deepCopy, isMobile, dbClient, recordExists } from '../../util/AVAUtilities';\nimport { AVATextStyle, AVAclasses } from '../../util/AVAStyles';\nimport PeopleMaintenance from '../dialogs/PeopleMaintenance';\n\nimport { Box, Button, TextField, Typography, Checkbox } from '@material-ui/core/';\n\nexport default ({ currentValues, updateField, reactData, updateReactData }) => {\n\n const AVAClass = AVAclasses();\n\n const { state } = useSession();\n const isMounted = React.useRef(false);\n\n let rowsWritten = 0;\n\n React.useEffect(() => {\n async function initialize() {\n let reactUpdObj = {};\n \n if (reactData.administrative_account && !reactData.accessList) {\n if (!state.accessList) {\n if (isMounted.current) {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Still loading Account information',\n message: `AVA is still loading. Wait just a moment and try again, please.`\n }\n }, true);\n }\n }\n else {\n reactUpdObj.accessList = deepCopy(state.accessList[state.session.client_id].list);\n if (!currentValues.peopleRec.hasOwnProperty('proxy_allowed_from')) {\n currentValues.peopleRec.proxy_allowed_from = {};\n reactUpdObj.currentValues = currentValues;\n }\n }\n }\n if (Object.keys(reactUpdObj).length > 0) {\n updateReactData(reactUpdObj, true);\n }\n }\n isMounted.current = true;\n initialize();\n return () => { isMounted.current = false; };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const OKtoShow = (this_person) => {\n if (this_person.person_id === currentValues.peopleRec.person_id) { return false; }\n return (\n (currentValues.peopleRec.proxy_allowed_from.hasOwnProperty(this_person.person_id))\n || ((reactData.linkedPersonFilter?.raw?.length > 1)\n && (`${this_person.last} ${this_person.first}`).toLowerCase().includes(reactData.linkedPersonFilter.lower))\n );\n };\n\n const number_of_proxy_accounts = () => {\n if (!currentValues.peopleRec.proxy_allowed_from) { return 0; }\n else {\n return (Object.keys(currentValues.peopleRec.proxy_allowed_from).length);\n }\n };\n\n return (\n \n \n {currentValues.peopleRec.myFamilyMembers &&\n (Object.keys(currentValues.peopleRec.myFamilyMembers).length > 0) &&\n \n {`You already have ${Object.keys(currentValues.peopleRec.myFamilyMembers).length} Account${(Object.keys(currentValues.peopleRec.myFamilyMembers).length > 1) ? 's' : ''} listed`}\n \n }\n {(!currentValues.peopleRec.myFamilyMembers ||\n (Object.keys(currentValues.peopleRec.myFamilyMembers).length === 0)) &&\n \n {`You don't have anyone listed yet`}\n \n }\n {(reactData.addAccountList.length > 0) &&\n \n {`You may create a new Account by tapping a button below.`}\n \n }\n \n {`If you wish to add someone that already has an account, ask them to add you to their list`}\n \n {currentValues.peopleRec.myFamilyMembers &&\n \n \n {rowsWritten = 0}\n \n \n {`You are currently managing:`}\n \n {Object.keys(currentValues.peopleRec.myFamilyMembers).sort((p1, p2) => {\n if (currentValues.peopleRec.myFamilyMembers[p1].type !== currentValues.peopleRec.myFamilyMembers[p2].type) {\n return ((currentValues.peopleRec.myFamilyMembers[p1].type > currentValues.peopleRec.myFamilyMembers[p2].type) ? 1 : -1);\n }\n else {\n return ((currentValues.peopleRec.myFamilyMembers[p1].name > currentValues.peopleRec.myFamilyMembers[p2].name) ? 1 : -1);\n }\n }).map((this_member, memberNdx) => (\n \n {(currentValues.peopleRec.myFamilyMembers[this_member].type === 'Camper') &&\n {\n updateReactData({\n viewFamilyMember: this_member\n }, true);\n }}\n >\n {`Camper ${++rowsWritten} -`}\n \n }\n {\n updateReactData({\n viewFamilyMember: this_member\n }, true);\n }}\n >\n {`${currentValues.peopleRec.myFamilyMembers[this_member].name}`}\n \n \n ))}\n \n }\n \n {reactData.addAccountList.map((this_class, selected_classIndex) => (\n {\n updateReactData({\n addPerson: selected_classIndex\n }, true);\n }}\n className={AVAClass.AVAButton}\n style={{ marginLeft: '8px', marginTop: '16px', backgroundColor: 'white', color: 'black' }}\n size='small'\n >\n {this_class.buttonText}\n \n ))} \n \n {(reactData.addPerson > -1) &&\n {\n let updateObj = {};\n if (newID) {\n if (!currentValues.peopleRec.myFamilyMembers) {\n currentValues.peopleRec.myFamilyMembers = {};\n }\n currentValues.peopleRec.myFamilyMembers[newID] =\n {\n name: newName,\n type: reactData.addAccountList[reactData.addPerson].description || reactData.addAccountList[reactData.addPerson].account_class\n };\n updateObj.updateList =\n [{\n tableName: 'peopleRec',\n fieldName: 'myFamilyMembers',\n newData: currentValues.peopleRec.myFamilyMembers\n }];\n };\n updateObj.reactUpd = {\n addPerson: -1\n };\n await updateField(updateObj);\n }}\n />\n }\n {reactData.addFamilyMember &&\n {\n let updateObj = {};\n if (newID) {\n if (!currentValues.peopleRec.myFamilyMembers) {\n currentValues.peopleRec.myFamilyMembers = {};\n }\n currentValues.peopleRec.myFamilyMembers[newID] = {\n name: newName,\n type: 'Non-Camper'\n };\n updateObj.updateList =\n [{\n tableName: 'peopleRec',\n fieldName: 'myFamilyMembers',\n newData: currentValues.peopleRec.myFamilyMembers\n }];\n };\n updateObj.reactUpd = {\n addFamilyMember: false\n };\n await updateField(updateObj);\n }}\n />\n }\n {reactData.viewFamilyMember &&\n {\n updateReactData({\n viewFamilyMember: false\n }, true);\n }}\n />\n }\n\n {(reactData.administrative_account &&\n reactData.accessList &&\n (reactData.accessList.length > number_of_proxy_accounts())) &&\n \n \n {`You may give existing accounts permission to act on your behalf`}\n \n \n {`Accounts added here will be granted authority to access your account`}\n \n {(number_of_proxy_accounts() > 0) &&\n \n {`You have already granted permission for ${number_of_proxy_accounts()} other account${(number_of_proxy_accounts() > 1) ? 's' : ''} to act your behalf`}\n \n }\n \n {`Use the Search line to find ${(number_of_proxy_accounts() > 0) ? 'more ' : ''}people you wish to authorize.`}\n \n \n {\n if (event.target.value.length === 0) {\n updateReactData({\n linkedPersonFilter: {\n raw: '',\n lower: ''\n }\n }, true);\n }\n else {\n updateReactData({\n linkedPersonFilter: {\n raw: event.target.value.trim(),\n lower: event.target.value.trim().toLowerCase()\n }\n }, true);\n }\n }}\n autoComplete='off'\n helperText='Name Search'\n />\n \n \n }\n {reactData.administrative_account &&\n reactData.accessList &&\n \n {reactData.accessList.map((this_item, tIndex) => (\n OKtoShow(this_item) &&\n \n {\n if (currentValues.peopleRec.proxy_allowed_from.hasOwnProperty(this_item.person_id)) {\n delete currentValues.peopleRec.proxy_allowed_from[this_item.person_id];\n }\n else {\n currentValues.peopleRec.proxy_allowed_from[this_item.person_id] = `${this_item.first} ${this_item.last}`;\n }\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'proxy_allowed_from',\n newData: currentValues.peopleRec.proxy_allowed_from\n }]\n });\n let proxyRec = await dbClient\n .get({\n Key: { person_id: this_item.person_id },\n TableName: \"People\"\n })\n .promise()\n .catch(error => {\n console.log({ [`in Linked Accounts, Error reading ${this_item.person_id}`]: error });\n });\n if (recordExists(proxyRec)) {\n let newFamilyMembers = proxyRec.Item.myFamilyMembers || {};\n newFamilyMembers[currentValues.peopleRec.person_id] = {\n name: `${currentValues.peopleRec.name.first} ${currentValues.peopleRec.name.last}`,\n type: state.groups.person_admin_class || 'other'\n };\n await dbClient\n .update({\n Key: { person_id: this_item.person_id },\n TableName: \"People\",\n UpdateExpression: 'set myFamilyMembers = :n',\n ExpressionAttributeValues: { ':n': newFamilyMembers },\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating People; error is: `, error);\n });\n }\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n \n {`${this_item.first} ${this_item.last}`}\n \n \n )\n )}\n \n }\n \n \n );\n};;","import React from 'react';\nimport Box from '@material-ui/core/Box';\nimport { Slider, Typography, Button, Switch } from '@material-ui/core';\nimport { AVATextStyle, AVAclasses, AVADefaults } from '../../util/AVAStyles';\nimport { s3, cloudfront } from '../../util/AVAUtilities';\nimport Select from 'react-dropdown-select';\nimport Cropper from \"react-cropper\";\nimport \"cropperjs/dist/cropper.css\";\n\nexport default ({ currentValues, reactData, updateReactData, updateField }) => {\n\n const AVAClass = AVAclasses();\n const hiddenFileInput = React.useRef(null);\n\n const languageTable = [\n { label: \"English\", value: \"en\" },\n { label: \"Afrikaans\", value: \"af\" },\n { label: \"Albanian\", value: \"sq\" },\n { label: \"Amharic\", value: \"am\" },\n { label: \"Arabic\", value: \"ar\" },\n { label: \"Armenian\", value: \"hy\" },\n { label: \"Azerbaijani\", value: \"az\" },\n { label: \"Bengali\", value: \"bn\" },\n { label: \"Bosnian\", value: \"bs\" },\n { label: \"Bulgarian\", value: \"bg\" },\n { label: \"Catalan\", value: \"ca\" },\n { label: \"Chinese (Simplified)\", value: \"zh\" },\n { label: \"Chinese (Traditional)\", value: \"zh-TW\" },\n { label: \"Croatian\", value: \"hr\" },\n { label: \"Czech\", value: \"cs\" },\n { label: \"Danish\", value: \"da\" },\n { label: \"Dari\", value: \"fa-AF\" },\n { label: \"Dutch\", value: \"nl\" },\n // { label: \"English\", value: \"en-US\" },\n { label: \"Estonian\", value: \"et\" },\n { label: \"Farsi (Persian)\", value: \"fa\" },\n { label: \"Filipino, Tagalog\", value: \"tl\" },\n { label: \"Finnish\", value: \"fi\" },\n { label: \"French\", value: \"fr\" },\n { label: \"French (Canada)\", value: \"fr-CA\" },\n { label: \"Georgian\", value: \"ka\" },\n { label: \"German\", value: \"de\" },\n { label: \"Greek\", value: \"el\" },\n { label: \"Gujarati\", value: \"gu\" },\n { label: \"Haitian Creole\", value: \"ht\" },\n { label: \"Hausa\", value: \"ha\" },\n { label: \"Hebrew\", value: \"he\" },\n { label: \"Hindi\", value: \"hi\" },\n { label: \"Hungarian\", value: \"hu\" },\n { label: \"Icelandic\", value: \"is\" },\n { label: \"Indonesian\", value: \"id\" },\n { label: \"Irish\", value: \"ga\" },\n { label: \"Italian\", value: \"it\" },\n { label: \"Japanese\", value: \"ja\" },\n { label: \"Kannada\", value: \"kn\" },\n { label: \"Kazakh\", value: \"kk\" },\n { label: \"Korean\", value: \"ko\" },\n { label: \"Latvian\", value: \"lv\" },\n { label: \"Lithuanian\", value: \"lt\" },\n { label: \"Macedonian\", value: \"mk\" },\n { label: \"Malay\", value: \"ms\" },\n { label: \"Malayalam\", value: \"ml\" },\n { label: \"Maltese\", value: \"mt\" },\n { label: \"Marathi\", value: \"mr\" },\n { label: \"Mongolian\", value: \"mn\" },\n { label: \"Norwegian (Bokmål)\", value: \"no\" },\n { label: \"Pashto\", value: \"ps\" },\n { label: \"Polish\", value: \"pl\" },\n { label: \"Portuguese (Brazil)\", value: \"pt\" },\n { label: \"Portuguese (Portugal)\", value: \"pt-PT\" },\n { label: \"Punjabi\", value: \"pa\" },\n { label: \"Romanian\", value: \"ro\" },\n { label: \"Russian\", value: \"ru\" },\n { label: \"Serbian\", value: \"sr\" },\n { label: \"Sinhala\", value: \"si\" },\n { label: \"Slovak\", value: \"sk\" },\n { label: \"Slovenian\", value: \"sl\" },\n { label: \"Somali\", value: \"so\" },\n { label: \"Spanish\", value: \"es\" },\n { label: \"Spanish (Mexico)\", value: \"es-MX\" },\n { label: \"Swahili\", value: \"sw\" },\n { label: \"Swedish\", value: \"sv\" },\n { label: \"Tamil\", value: \"ta\" },\n { label: \"Telugu\", value: \"te\" },\n { label: \"Thai\", value: \"th\" },\n { label: \"Turkish\", value: \"tr\" },\n { label: \"Ukrainian\", value: \"uk\" },\n { label: \"Urdu\", value: \"ur\" },\n { label: \"Uzbek\", value: \"uz\" },\n { label: \"Vietnamese\", value: \"vi\" },\n { label: \"Welsh\", value: \"cy\" }\n ];\n\n if (!currentValues.peopleRec.preferred_language) {\n currentValues.peopleRec.preferred_language = 'en';\n }\n let myAnswer = {\n label: languageTable.find(l => {\n return l.value === currentValues.peopleRec.preferred_language;\n }).label,\n value: currentValues.peopleRec.preferred_language\n };\n console.log(myAnswer);\n\n\n let upload;\n async function handleSaveFile({\n photo: pTarget,\n temp\n }) {\n let pType = pTarget.type;\n upload = s3.upload({\n partSize: 10 * 1024 * 1024,\n queueSize: 4,\n Bucket: 'theseus-medical-storage',\n Key: `${temp ? 'TEMP__' : 'public/patients/'}${pTarget.name}`,\n Body: pTarget,\n ACL: 'public-read-write',\n ContentType: pType\n });\n let s3Resp = await performUpload();\n if (!temp) {\n s3.deleteObject({\n Bucket: 'theseus-medical-storage',\n Key: `TEMP__${reactData.imageEditing}`,\n }).promise();\n await cloudfront\n .createInvalidation({\n DistributionId: 'E3DXPQ4WCODC8A',\n InvalidationBatch: {\n CallerReference: new Date().getTime().toString(),\n Paths: {\n Quantity: 1,\n Items: [`/${currentValues.peopleRec.person_id}.jpg`]\n }\n }\n })\n .promise()\n .catch(err => { console.log(`clearing cache - cloudfront invalidation error`); });\n }\n return s3Resp;\n\n function performUpload() {\n return new Promise(function (resolve, reject) {\n upload\n .send((err, good) => {\n if (err) {\n reject({});\n }\n else {\n resolve(good);\n }\n });\n });\n };\n };\n\n return (\n \n \n \n {\n AVADefaults({ fontSize: newValue });\n await updateField({\n updateList:\n [{\n tableName: 'sessionRec',\n fieldName: 'customizations.font_size',\n newData: newValue\n }]\n });\n }}\n aria-labelledby=\"continuous-slider\"\n step={.1}\n min={1}\n max={5}\n />\n \n \n {`This is the default font size for ${currentValues.peopleRec.name?.first} ${currentValues.peopleRec.name?.last}`}\n \n \n \n {`Load and customize your photo here`}\n \n {reactData.imageEditing\n ?\n \n {\n updateReactData({\n cropperInstance: instance\n }, true);\n }}\n />\n \n {\n reactData.cropperInstance.rotate(90);\n }}\n className={AVAClass.AVAButton}\n style={{ marginLeft: 0, backgroundColor: 'white', color: 'black' }}\n size='small'\n >\n {'Rotate'}\n \n {\n reactData.cropperInstance.destroy();\n updateReactData({\n imageEditing: false\n }, true);\n }}\n className={AVAClass.AVAButton}\n style={{ marginLeft: 3, backgroundColor: 'white', color: 'red' }}\n size='small'\n >\n {'Cancel edits'}\n \n {\n let newPhoto;\n reactData.cropperInstance\n .getCroppedCanvas()\n .toBlob((async (pBlob) => {\n let editedPhoto = new File([pBlob], `${currentValues.peopleRec.person_id}.jpg`, { type: 'image/jpeg' });\n newPhoto = await handleSaveFile({ photo: editedPhoto, temp: false });\n updateReactData({\n imageEditing: false,\n myImage: newPhoto.Location\n }, true);\n }), 'image/jpeg');\n }}\n >\n {'Save this photo'}\n \n \n\n \n :\n \n \n \n {\n hiddenFileInput.current.click();\n }}\n className={AVAClass.AVAButton}\n style={{ marginLeft: 0, backgroundColor: 'white', color: 'black' }}\n size='small'\n >\n {'Upload a new Photo'}\n \n {reactData.myImage &&\n {\n updateReactData({\n imageEditing: reactData.myImage\n }, true);\n }}\n >\n {'Edit this photo'}\n \n }\n \n \n }\n {\n let s3Data = await handleSaveFile({ photo: target.target.files[0], temp: true });\n updateReactData({\n imageEditing: s3Data.Location,\n }, true);\n }}\n />\n\n\n \n \n \n {\n if (values.length > 0) {\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'preferred_language',\n newData: values[0].value\n }]\n });\n }\n }}\n onChange={async (values) => {\n if (values.length > 0) {\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'preferred_language',\n newData: values[0].value\n }]\n });\n }\n }}\n />\n \n \n {`My preferred language`}\n \n \n \n \n \n\n\n {!reactData.new_messaging_required &&\n \n \n {'Messaging Version'}\n \n \n \n {'Legacy'}\n \n {\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'useNewMessaging',\n newData: !currentValues.peopleRec.useNewMessaging\n }]\n });\n }}\n name=\"MessagingStyle\"\n color=\"primary\"\n />\n \n {'New'}\n \n \n \n }\n\n\n\n\n \n );\n};\n","import React from 'react';\nimport useSession from '../../hooks/useSession';\n\nimport { deepCopy, isMobile } from '../../util/AVAUtilities';\n\nimport { Typography, Checkbox, Box } from '@material-ui/core';\nimport { AVATextStyle } from '../../util/AVAStyles';\n\nexport default ({ currentValues, updateField, reactData, updateReactData }) => {\n\n const { state } = useSession();\n\n const isMounted = React.useRef(false);\n\n const updateGroupList = async (clicked_group) => {\n if (!currentValues.peopleRec.hasOwnProperty('groups')) {\n currentValues.peopleRec.groups = [];\n }\n let foundIt = currentValues.peopleRec.groups.indexOf(clicked_group.id || clicked_group.group_id);\n if (foundIt < 0) { \n currentValues.peopleRec.groups.push(clicked_group.id || clicked_group.group_id);\n if (clicked_group.belongs_to) {\n let parentGroup = clicked_group.belongs_to;\n do {\n if (!currentValues.peopleRec.groups.includes(parentGroup)) {\n currentValues.peopleRec.groups.push(parentGroup);\n }\n // eslint-disable-next-line\n let foundParent = reactData.groupObj.adminHierarchy.find(this_group => {\n return (this_group.id === parentGroup);\n });\n if (foundParent) {\n parentGroup = foundParent.belongs_to || false;\n }\n else {\n parentGroup = false;\n }\n } while (parentGroup);\n }\n }\n else {\n // remove AND remove from parent if no other children of that parent\n currentValues.peopleRec.groups.splice(foundIt, 1);\n if (clicked_group.belongs_to) {\n let checkGroup = clicked_group.belongs_to;\n do {\n const g = checkGroup;\n let parentAt = currentValues.peopleRec.groups.indexOf(checkGroup);\n if (parentAt > -1) {\n // get a list of other groups that belong to the checkgroup (parent)\n let sibling_exists = reactData.groupObj.adminHierarchy.some(test_group => {\n return ((test_group.belongs_to === g)\n && (currentValues.peopleRec.groups.includes(test_group.id)));\n });\n if (!sibling_exists) {\n currentValues.peopleRec.groups.splice(parentAt, 1);\n }\n }\n let foundParent = reactData.groupObj.adminHierarchy.find(this_group => {\n return (this_group === g);\n });\n if (foundParent) {\n checkGroup = foundParent.id;\n }\n else {\n checkGroup = false;\n }\n } while (checkGroup);\n }\n }\n await updateField({\n updateList:\n [{\n tableName: 'peopleRec',\n fieldName: 'groups',\n newData: currentValues.peopleRec.groups\n },\n {\n tableName: 'peopleRec',\n fieldName: 'clients.groups',\n newData: currentValues.peopleRec.groups\n },\n {\n tableName: 'peopleRec',\n fieldName: 'clients.id',\n newData: currentValues.peopleRec.client_id\n }]\n });\n };\n\n React.useEffect(() => {\n async function initialize() {\n if (!reactData.groupObj) {\n if (!state.groups) {\n if (isMounted.current) {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Still loading Group information',\n message: `AVA is still loading. Wait just a moment and try again, please.`\n }\n }, true);\n }\n }\n else {\n updateReactData({\n groupObj: deepCopy(state.groups)\n }, true);\n }\n }\n }\n isMounted.current = true;\n initialize();\n return () => { isMounted.current = false; };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {reactData.groupObj && \n \n {`Administrative Groups`}\n \n \n {reactData.groupObj.adminHierarchy.map((gObj, ndx) => (\n \n {gObj.selectable &&\n { await updateGroupList(gObj); }}\n checked={currentValues.peopleRec.groups && currentValues.peopleRec.groups.includes(gObj.id)}\n />\n }\n \n {gObj.name}\n \n \n ))}\n \n \n {`Public (optional) Groups`}\n \n \n {(Object.keys(reactData.groupObj.publicGroups).length > 0)\n ? `Choose any from this list you're interested in`\n : `No Public Groups are available at this time`\n }\n \n \n {Object.keys(reactData.groupObj.publicGroups).map((gID, ndx) => (\n \n { await updateGroupList(reactData.groupObj.publicGroups[gID]); }}\n checked={currentValues.peopleRec.groups.includes(gID)}\n />\n \n {reactData.groupObj.publicGroups[gID].group_name}\n \n \n ))}\n \n }\n \n );\n};","import React from 'react';\n\nimport { getPerson, getImage } from '../../util/AVAPeople';\nimport { deepCopy, isEmpty, dbClient, cl, recordExists, switchActiveAccount } from '../../util/AVAUtilities';\nimport { AVAclasses, AVADefaults, AVATextStyle, isDark } from '../../util/AVAStyles';\n\nimport useSession from '../../hooks/useSession';\n\nimport ProfileSection from '../sections/ProfileSection';\nimport AdministrativeSection from '../sections/AdministrativeSection';\nimport Snapshot from '../sections/Snapshot';\nimport FormSection from '../sections/FormSection';\nimport TechInfoSection from '../sections/TechInfoSection';\nimport MessagePreferencesSection from '../sections/MessagePreferencesSection';\nimport PersonNotes from './PersonNotes';\nimport LinkedAccounts from '../sections/LinkedAccounts';\nimport PersonalizationSection from '../sections/PersonalizationSection';\nimport GroupAssignments from '../sections/GroupAssignments';\n\nimport { Snackbar, Button, Avatar, Box, Dialog, Typography, Menu, MenuList, MenuItem, Paper } from '@material-ui/core';\nimport { Alert, AlertTitle } from '@material-ui/lab/';\n\nimport HomeIcon from '@material-ui/icons/Home';\nimport SwapHorizIcon from '@material-ui/icons/SwapHoriz';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nconst useStyles = makeStyles(theme => ({\n clientPopUp: {\n borderRadius: '30px 30px 30px 30px',\n },\n popUpMenu: {\n marginRight: theme.spacing(3),\n paddingRight: 2,\n },\n paperPallette: {\n borderRadius: '30px 30px 30px 30px',\n width: '95%',\n maxWidth: '800px'\n },\n padRight: {\n marginRight: theme.spacing(2),\n },\n}));\n\nexport default ({ patient, person_id, personRec, initialValues, options = {}, onClose }) => {\n\n const isMounted = React.useRef(false);\n const { state } = useSession();\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n const [reactData, setReactData] = React.useState({\n initialized: false,\n popupMenuOpen: false,\n person_id: person_id || state.session.patient_id,\n accessList: null,\n isMobile: (window.window.innerWidth < 800),\n client_name: state.session.client_name,\n linkedPersonFilter: {},\n mode: options.mode || 'edit',\n addFamilyMember: false,\n viewFamilyMember: false,\n user_id: state.user.person_id,\n focusAt: null,\n formHistoryMode: false,\n recentlyCompletedDocs: [],\n addAccountList: [],\n familyFormsObj: {},\n new_messaging_required: !state.session.client_style.allow_old_messaging,\n mandatory_passwords: state.session.client_style.mandatory_passwords,\n local_customFields: ((state.session.local_data && (Object.keys(state.session.local_data).length > 0)) ? state.session.local_data : {}),\n user_class: state.user.account_class,\n administrative_account: (['admin', 'support', 'master'].includes(state.user.account_class)),\n master_account: (state.user.account_class === 'master'),\n OKtoSave: false,\n saveCompleted: false,\n alert: false,\n myFormListObj: {},\n formsInitialized: false,\n myImage: (options.mode === 'add') ? '' : getImage(person_id || state.session.patient_id),\n image_editing: false,\n components: {\n Snapshot: {\n component_id: Snapshot,\n },\n ProfileSection: {\n component_id: ProfileSection,\n },\n AdministrativeSection: {\n component_id: AdministrativeSection,\n },\n MessagePreferencesSection: {\n component_id: MessagePreferencesSection,\n },\n LinkedAccounts: {\n component_id: LinkedAccounts,\n },\n PersonalizationSection: {\n component_id: PersonalizationSection\n },\n GroupAssignments: {\n component_id: GroupAssignments,\n },\n PersonNotes: {\n component_id: PersonNotes,\n },\n TechInfoSection: {\n component_id: TechInfoSection\n },\n FormSection: {\n component_id: FormSection,\n },\n\n },\n og: {\n peopleRec: false,\n sessionRec: false,\n peopleAccountRecs: false, // array of objects\n peopleGroups: false,\n },\n current: {\n peopleRec: {},\n sessionRec: {},\n peopleAccountRecs: [{}],\n peopleGroups: [{}],\n },\n errorList: {},\n options\n });\n\n const [refreshTrigger, setRefreshTrigger] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n if (isMounted.current) {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setRefreshTrigger(refreshTrigger => !refreshTrigger); }\n }\n };\n\n React.useEffect(() => {\n async function initialize() {\n let reactUpdObj = {\n initialized: true,\n sections: [{\n section_name: 'Snapshot',\n color: initialValues?.color || 'orange',\n isOpen: (options?.sectionToShow ? ([options.sectionToShow].flat().includes('Snapshot')) : false),\n isAuthorized: true,\n version_id: 0,\n component_name: 'Snapshot'\n },\n {\n section_name: 'Administrative Data',\n color: initialValues?.color || 'orange',\n isOpen: (options?.sectionToShow ? ([options.sectionToShow].flat().includes('AdministrativeSection')) : false),\n isAuthorized: reactData.administrative_account,\n version_id: 0,\n component_name: 'AdministrativeSection'\n },\n {\n section_name: 'Name & Contact info',\n color: initialValues?.color || 'orange',\n isOpen: (options?.sectionToShow ? ([options.sectionToShow].flat().includes('ProfileSection')) : false),\n isAuthorized: true,\n version_id: 0,\n component_name: 'ProfileSection'\n },\n {\n section_name: 'Messaging',\n color: initialValues?.color || 'orange',\n isOpen: (options?.sectionToShow ? ([options.sectionToShow].flat().includes('MessagePreferencesSection')) : false),\n isAuthorized: true,\n version_id: 0,\n component_name: 'MessagePreferencesSection'\n },\n {\n section_name: 'My Family',\n color: initialValues?.color || 'orange',\n isOpen: (options?.sectionToShow ? ([options.sectionToShow].flat().includes('LinkedAccounts')) : false),\n isAuthorized: true,\n version_id: 0,\n component_name: 'LinkedAccounts'\n },\n {\n section_name: 'Photo & Personalization',\n color: initialValues?.color || 'orange',\n isOpen: (options?.sectionToShow ? ([options.sectionToShow].flat().includes('PersonalizationSection')) : false),\n isAuthorized: true,\n version_id: 0,\n component_name: 'PersonalizationSection'\n },\n {\n section_name: 'Groups',\n color: initialValues?.color || 'orange',\n isOpen: (options?.sectionToShow ? ([options.sectionToShow].flat().includes('GroupAssignments')) : false),\n isAuthorized: reactData.administrative_account,\n version_id: 0,\n component_name: 'GroupAssignments'\n },\n {\n section_name: 'Forms',\n color: initialValues?.color || 'orange',\n isOpen: (options?.sectionToShow ? ([options.sectionToShow].flat().includes('FormSection')) : false),\n isAuthorized: true,\n version_id: 0,\n component_name: 'FormSection'\n },\n {\n section_name: 'Notes',\n color: initialValues?.color || 'orange',\n isOpen: (options?.sectionToShow ? ([options.sectionToShow].flat().includes('PersonNotes')) : false),\n isAuthorized: reactData.administrative_account,\n version_id: 0,\n component_name: 'PersonNotes'\n },\n {\n section_name: 'Password & Tech Stuff',\n color: initialValues?.color || 'orange',\n isOpen: (options?.sectionToShow ? ([options.sectionToShow].flat().includes('TechInfoSection')) : false),\n isAuthorized: reactData.administrative_account || (state.session.user_id === reactData.person_id),\n version_id: 0,\n component_name: 'TechInfoSection'\n }\n ]\n };\n // incoming personRec should tell us who we are editing here\n let parm_personRec = Object.assign({}, { person_id: person_id }, (patient || {}), (personRec || {}));\n reactUpdObj.og = {};\n if (!parm_personRec.person_id || parm_personRec.person_id.startsWith('*NEW~') || options.newPerson) {\n reactUpdObj.mode = 'add';\n reactUpdObj.og.peopleRec = Object.assign({}, initialValues?.peopleRec);\n reactUpdObj.og.sessionRec = Object.assign({}, initialValues?.sessionRec);\n }\n else {\n reactUpdObj.person_id = parm_personRec.person_id;\n let peopleRec = await dbClient\n .get({\n Key: { person_id: parm_personRec.person_id },\n TableName: \"People\"\n })\n .promise()\n .catch(error => {\n cl({ [`in People Maintenance, Error reading ${parm_personRec.person_id}`]: error });\n });\n if (recordExists(peopleRec)) {\n // convert from earlier versions if necessary\n if (!peopleRec.Item.contact_info) {\n peopleRec.Item.contact_info = {\n cell: { number: peopleRec.Item.messaging?.sms },\n landline: { number: peopleRec.Item.messaging?.voice },\n work: { number: peopleRec.Item.messaging?.office },\n email: { address: peopleRec.Item.messaging?.email },\n };\n }\n else if (!peopleRec.Item.contact_info.landline) {\n peopleRec.Item.contact_info.landline = { number: peopleRec.Item.messaging?.voice };\n }\n if (!peopleRec.Item.address) {\n peopleRec.Item.address = {};\n if (peopleRec.Item.location) {\n peopleRec.Item.address = { address: peopleRec.Item.location };\n }\n }\n if (!peopleRec.Item.preferred_methods) {\n peopleRec.Item.preferred_methods = [(peopleRec.Item.preferred_method ? peopleRec.Item.preferred_method.toLowerCase() : 'ava')];\n }\n if (peopleRec.Item.time_based_rules) {\n peopleRec.Item.time_based_rules = peopleRec.Item.time_based_rules.filter(this_rule => {\n return !this_rule.global_rule;\n });\n }\n if (state.session?.global_mail_rules?.time_based_rules) {\n let start_index = peopleRec.Item.time_based_rules?.length || 0;\n peopleRec.Item.time_based_rules = (peopleRec.Item.time_based_rules || []).concat(state.session?.global_mail_rules?.time_based_rules);\n for (let i = start_index; i < peopleRec.Item.time_based_rules.length; i++) {\n if (peopleRec.Item.time_based_rules[i].name) {\n peopleRec.Item.time_based_rules[i].name += ` (Administrative Rule)`;\n }\n else {\n peopleRec.Item.time_based_rules[i].name = `${reactData.client_name} Administrative Rule`;\n }\n peopleRec.Item.time_based_rules[i].global_rule = true;\n }\n }\n if (!peopleRec.Item.proxy_allowed_from) {\n peopleRec.Item.proxy_allowed_from = {};\n }\n reactUpdObj.og.peopleRec = Object.assign({}, peopleRec.Item, initialValues?.peopleRec);\n }\n else {\n return {\n response_code: 400,\n errorMessage: `AVA doesn't recognize ID ${parm_personRec.person_id} - PeopleRec not found.`\n };\n }\n let sessionRec = await dbClient\n .get({\n Key: { session_id: parm_personRec.person_id },\n TableName: \"SessionsV2\"\n })\n .promise()\n .catch(error => { cl({ 'Error reading SessionsV2': error }); });\n if (recordExists(sessionRec)) {\n if (!sessionRec.Item.customizations) {\n sessionRec.Item.customizations = {};\n }\n if (!sessionRec.Item.customizations.font_size) {\n sessionRec.Item.customizations.font_size = 1;\n }\n if (!sessionRec.Item.forceSetPassword) {\n sessionRec.Item.forceSetPassword = false;\n }\n AVADefaults({ fontSize: sessionRec.Item.customizations.font_size });\n reactUpdObj.og.sessionRec = sessionRec.Item;\n }\n else {\n return {\n response_code: 400,\n errorMessage: `AVA doesn't recognize ID ${parm_personRec.person_id} - SessionsV2 not found.`\n };\n }\n let formFieldsRec = await dbClient\n .query({\n KeyConditionExpression: 'client_id = :c',\n TableName: 'Form_Fields',\n ExpressionAttributeValues: {\n ':c': reactUpdObj.og.peopleRec.client_id\n }\n })\n .promise()\n .catch(error => { cl({ 'Error reading SessionsV2': error }); });\n reactUpdObj.form_fields = {};\n if (recordExists(formFieldsRec)) {\n for (const this_fieldRec of formFieldsRec.Items) {\n if (this_fieldRec.showOnProfile && this_fieldRec.value.saveAs) {\n reactUpdObj.form_fields[this_fieldRec.field_name] = {\n prompt: this_fieldRec.prompt.value,\n value: unresolve({ object: reactUpdObj.og, key: this_fieldRec.value.saveAs.split('.') })\n };\n }\n }\n }\n }\n if (!reactData.groupObj && state.groups && reactUpdObj.og.peopleRec.groups) {\n // check all groups you belong to - there are three states:\n // show_linkedAccounts is ASSUMED to be on\n // a group can explcitly disable this by including the linked_accounts key with isEnabled = false\n // ANY group with isEnabled = true will override ALL other isEnabled = false\n let isEnabled = false;\n let isDisabled = false;\n let addAccountList = [];\n let set_sectionName = false;\n for (let this_group of reactUpdObj.og.peopleRec.groups) {\n let groupRec = await dbClient\n .get({\n Key: {\n client_id: state.session.client_id,\n group_id: this_group\n },\n TableName: \"Groups\"\n })\n .promise()\n .catch(error => {\n console.log({ 'Error reading Groups': error });\n });\n if (recordExists(groupRec)) {\n if (groupRec.Item.linked_accounts) {\n if (groupRec.Item.linked_accounts.hasOwnProperty('isEnabled')) {\n if (groupRec.Item.linked_accounts.isEnabled) {\n isEnabled = true;\n }\n else {\n isDisabled = true;\n break;\n }\n }\n if (groupRec.Item.linked_accounts.hasOwnProperty('add_account')) {\n for (let this_type of groupRec.Item.linked_accounts.add_account) {\n if (!addAccountList.some(existing_type => {\n return existing_type.account_class === this_type.account_class;\n })) {\n addAccountList.push(this_type);\n }\n }\n }\n if (groupRec.Item.linked_accounts.hasOwnProperty('section_name')) {\n set_sectionName = groupRec.Item.linked_accounts.section_name;\n }\n }\n }\n }\n let foundAt = reactUpdObj.sections.findIndex(this_section => {\n return (this_section.component_name === 'LinkedAccounts');\n });\n if (foundAt > -1) {\n if (isDisabled && !isEnabled) {\n reactUpdObj.sections[foundAt].isAuthorized = false;\n }\n if (set_sectionName) {\n reactUpdObj.sections[foundAt].section_name = set_sectionName;\n }\n }\n if (addAccountList.length > 0) {\n reactUpdObj.addAccountList = addAccountList;\n }\n }\n reactUpdObj.current = {\n peopleRec: deepCopy(reactUpdObj.og.peopleRec),\n sessionRec: deepCopy(reactUpdObj.og.sessionRec)\n };\n updateReactData(reactUpdObj, true);\n window.addEventListener('resize', handleResize);\n }\n function handleResize() {\n updateReactData({\n isMobile: (window.window.innerWidth < 800),\n }, true);\n }\n isMounted.current = true;\n initialize();\n return () => {\n isMounted.current = false;\n window.removeEventListener('resize', handleResize);\n };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n function renderSection(componentName) {\n const SectionToRender = reactData.components[componentName].component_id;\n return (\n {\n for (let errorObj of [errorList].flat()) {\n const { errorField, isError } = errorObj;\n if (!isError) {\n delete reactData.errorList[errorField];\n }\n else {\n reactData.errorList[errorField] = errorObj;\n }\n }\n updateReactData({\n errorList: reactData.errorList,\n }, true);\n }}\n updateField={async ({ updateList, errorObj, reactUpd }) => {\n if (reactData.mode !== 'view') {\n let reactUpdObj = {\n OKtoSave: true,\n current: reactData.current,\n };\n if (reactUpd) {\n Object.assign(reactUpdObj, reactUpd);\n };\n if (errorObj) {\n reactUpdObj.errorList = reactData.errorList;\n for (let errorItem of [errorObj].flat()) {\n const { errorField, isError } = errorItem;\n if (!isError) {\n delete reactUpdObj.errorList[errorField];\n }\n else {\n reactUpdObj.errorList[errorField] = errorItem;\n }\n }\n }\n for (let this_update of [updateList].flat()) {\n if (this_update) {\n const { tableName, fieldName, newData } = this_update;\n let result = resolve(reactData.current[tableName] || reactData.current[tableName], fieldName.split('.'), newData);\n reactUpdObj.current[tableName] = result;\n }\n }\n updateReactData(reactUpdObj, true);\n }\n }}\n reactData={reactData}\n updateReactData={(newData, force) => {\n updateReactData(newData, force);\n }}\n />);\n }\n\n const unresolve = ({ object, key }) => {\n const this_key = key.shift();\n if (!object || !object.hasOwnProperty(this_key)) {\n return null;\n }\n if (key.length === 0) {\n return object[this_key];\n }\n else {\n return unresolve({ object: object[this_key], key });\n }\n };\n\n const resolve = (object, key, value) => {\n const this_key = key.shift();\n if (key.length === 0) {\n object[this_key] = value;\n return object;\n }\n else if (!object.hasOwnProperty(this_key)) {\n let resolvedObj = resolve({}, key, value);\n object[this_key] = resolvedObj;\n return object;\n }\n else if (isEmpty(object)) {\n let resolvedObj = resolve({}, key, value);\n object = resolvedObj;\n return object;\n }\n else {\n let resolvedObj = resolve(object[this_key], key, value);\n object[this_key] = resolvedObj;\n return object;\n }\n };\n\n const handleAbort = () => {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Changes are Pending',\n message: `There are unsaved changes. Exit anyway?`,\n action: [\n {\n text: `Keep editing`,\n function: () => {\n updateReactData({\n alert: false\n }, true);\n }\n },\n {\n text: `Exit`,\n function: () => {\n onClose(false);\n }\n }\n ]\n }\n }, true);\n };\n\n const saveChanges = async () => {\n const person_id_blank = !reactData.current.peopleRec.person_id;\n if (person_id_blank || (reactData.current.peopleRec.person_id !== reactData.person_id)) {\n // check person_id just before saving to assure that it hasn't been claimed between setting and saving\n const person_id_exists = await getPerson(reactData.current.peopleRec.person_id, 'validate');\n if (person_id_exists || person_id_blank) {\n // it's a duplicate OR blank; fix it and abort the save with an alert message\n const { proposedID, newID } = await newUserID(reactData.current.peopleRec.person_id);\n reactData.current.peopleRec.person_id = newID;\n reactData.current.sessionRec.session_id = newID;\n reactData.current.sessionRec.user_id = newID;\n updateReactData({\n person_id: newID,\n current: reactData.current,\n alert: {\n severity: 'warning',\n title: 'Your Account ID',\n message: (person_id_blank\n ? `We set your Account ID to ${newID}. Tap OK, then tap Save again.`\n : `We tried Account ID of ${proposedID}, but that was already taken. We've assigned ${newID} instead. Tap OK, then try your Save again (you can update this proposed ID, too, if you'd prefer).`\n ),\n action: [\n {\n text: `OK`,\n function: () => {\n updateReactData({\n alert: false\n }, true);\n }\n }\n ]\n }\n }, true);\n return false;\n };\n }\n let groupOK = reactData.current.peopleRec.groups.some(g => { return ((g !== 'ALL') && (g !== '__top__')); });\n if (!groupOK) {\n reactData.errorList['groups'] = {\n errorField: 'groups',\n errorValue: '',\n isError: true,\n errorMessage: `You must select at least one Group`\n };\n updateReactData({\n errorList: reactData.errorList,\n }, true);\n return false;\n }\n\n reactData.person_id = reactData.current.peopleRec.person_id;\n\n // if the peopleRec does not have ANY preferred option for messaging, we will default it here.\n if (!reactData.current.peopleRec.preferred_methods) {\n if (reactData.current.peopleRec.preferred_method) {\n reactData.current.peopleRec.preferred_methods = [reactData.current.peopleRec.preferred_method];\n }\n else {\n if (!isEmpty(reactData.current.peopleRec.contact_info?.cell?.number)) {\n reactData.current.peopleRec.preferred_methods = ['sms'];\n reactData.current.peopleRec.preferred_method = 'sms';\n }\n else if (!isEmpty(reactData.current.peopleRec.contact_info?.email?.address)) {\n reactData.current.peopleRec.preferred_methods = ['email'];\n reactData.current.peopleRec.preferred_method = 'email';\n }\n else if (!isEmpty(reactData.current.peopleRec.contact_info?.alt_email?.address)) {\n reactData.current.peopleRec.preferred_methods = ['alt_email'];\n reactData.current.peopleRec.preferred_method = 'alt_email';\n }\n else if (!isEmpty(reactData.current.peopleRec.contact_info?.landline?.number)) {\n reactData.current.peopleRec.preferred_methods = ['voice'];\n reactData.current.peopleRec.preferred_method = 'voice';\n }\n }\n }\n\n if (JSON.stringify(reactData.og.peopleRec) !== JSON.stringify(reactData.current.peopleRec)) {\n // **** NEED TO ADD SPECIAL HANDLING FOR CHANGE OF PRIMARY KEY *** (likely change to inactive account?)\n await dbClient\n .put({\n TableName: 'People',\n Item: reactData.current.peopleRec\n })\n .promise()\n .catch(error => {\n console.log(`caught error putting to People; error is:`, error);\n });\n }\n if (JSON.stringify(reactData.og.sessionRec) !== JSON.stringify(reactData.current.sessionRec)) {\n // **** NEED TO ADD SPECIAL HANDLING FOR CHANGE OF PRIMARY KEY *** (likely change to inactive account?)\n await dbClient\n .put({\n TableName: 'SessionsV2',\n Item: reactData.current.sessionRec\n })\n .promise()\n .catch(error => {\n console.log(`caught error putting to People; error is:`, error);\n });\n }\n return reactData.current.peopleRec.person_id;\n };\n\n async function newUserID(proposedID) {\n let tryAgain;\n let newID, namePart;\n let clientPart = `-${state.session.client_id.toLowerCase()}`;\n let numberPart = 1;\n if (proposedID) {\n namePart = (proposedID.match(/([\\w-]*[^\\d]+)(\\d*)$/))[1];\n newID = proposedID.toLowerCase().replace(/\\W/g, '');\n }\n else {\n if (!reactData.current.peopleRec?.name?.last) {\n if (!reactData.current.peopleRec?.name?.first) {\n return reactData.current.peopleRec.person_id; // neither first nor last exits\n }\n else {\n namePart = reactData.current.peopleRec?.name?.first; // first but not last\n }\n }\n else if (!reactData.current.peopleRec?.name?.first) {\n namePart = reactData.current.peopleRec?.name?.last; // last but not first\n }\n else {\n namePart = `${reactData.current.peopleRec.name.first.trim().charAt(0)}${reactData.current.peopleRec.name.last.trim()}`;\n }\n newID = `${namePart.toLowerCase().replace(/\\W/g, '')}${clientPart}`;\n }\n do {\n tryAgain = false;\n const person_id_exists = await getPerson(newID, 'validate');\n if (person_id_exists) {\n numberPart++;\n if (newID.includes(clientPart)) {\n newID = `${namePart.replace(clientPart, '')}${numberPart}${clientPart}`;\n }\n else {\n newID = `${namePart}${numberPart}`;\n }\n tryAgain = true;\n }\n } while (tryAgain);\n return { proposedID, newID };\n }\n\n return (\n reactData.initialized &&\n {\n if (reactData.OKtoSave) {\n handleAbort();\n }\n else {\n if (!reactData.current.peopleRec.person_id) {\n onClose({\n saveCompleted: false,\n newID: false\n });\n }\n else {\n onClose({\n saveCompleted: reactData.saveCompleted,\n newID: reactData.current.peopleRec.person_id,\n newName: (`${reactData.current.peopleRec.name.first} ${reactData.current.peopleRec.name.last}`).trim()\n });\n }\n }\n }}\n >\n \n \n \n \n {reactData.current.peopleRec.name ? (`${reactData.current.peopleRec.name.first} ${reactData.current.peopleRec.name.last}`).trim() : 'Welcome!'}\n \n \n {/* Logo and Pop-up Menu */}\n \n {\n updateReactData({\n anchorEl: event.currentTarget,\n popupMenuOpen: true\n }, true);\n }}\n />\n\n \n {\n updateReactData({\n popupMenuOpen: false\n }, true);\n }}\n keepMounted\n >\n \n {reactData.administrative_account && (reactData.person_id !== state.session?.patient_id) && (\n {\n updateReactData({\n popupMenuOpen: false\n }, true);\n await switchActiveAccount(\n state.session,\n (state.session.client_id || state.session.user_homeClient),\n {\n id: reactData.person_id,\n name: `${reactData.current.peopleRec.name.first} ${reactData.current.peopleRec.name.last}`\n }\n );\n }}>\n \n \n \n {`Switch to ${reactData.current.peopleRec.name.first}`}\n \n \n \n )}\n {reactData.administrative_account\n && reactData.current.peopleRec.person_id\n && (reactData.person_id !== state.session?.user_id)\n && (\n {\n updateReactData({\n popupMenuOpen: false\n }, true);\n await switchActiveAccount(\n state.session,\n (state.session.client_id || state.session.user_homeClient),\n {\n id: reactData.person_id,\n name: `${reactData.current.peopleRec.name.first} ${reactData.current.peopleRec.name.last}`\n },\n { resetUser: true }\n );\n }}>\n \n \n \n {`Sign-in as ${reactData.current.peopleRec.name.first || reactData.current.peopleRec.name.last}`}\n \n \n \n )}\n \n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n \n \n {`User ${state.session.user_id}${state.session.patient_id !== state.session.user_id ? (' (' + state.session.patient_id + ')') : ''}`}\n \n \n \n \n \n \n\n \n {reactData.sections.map((this_section, sectionNdx) => (\n (this_section.isAuthorized &&\n (!reactData.options?.sectionToShow || ([reactData.options?.sectionToShow].flat().includes(this_section.component_name))) &&\n (reactData.person_id || (this_section.component_name === 'ProfileSection')) &&\n \n {\n reactData.sections[sectionNdx].isOpen = !reactData.sections[sectionNdx].isOpen;\n updateReactData({\n focusAt: (reactData.sections[sectionNdx].isOpen ? this_section.component_name : null),\n sections: reactData.sections\n }, true);\n }}\n >\n \n {this_section.section_name.trim()}\n \n \n {this_section.isOpen &&\n \n \n {renderSection(this_section.component_name)}\n \n {\n reactData.sections[sectionNdx].isOpen = !reactData.sections[sectionNdx].isOpen;\n updateReactData({\n sections: reactData.sections\n }, true);\n }}\n justifyContent='center'\n flexDirection='column'\n minHeight={30}\n height={30}\n />\n \n }\n \n )\n ))}\n \n\n \n {\n if (reactData.OKtoSave) {\n handleAbort();\n }\n else {\n if (!reactData.current.peopleRec.person_id) {\n onClose({\n saveCompleted: false,\n newID: false\n });\n }\n else {\n onClose({\n saveCompleted: reactData.saveCompleted,\n newID: reactData.current.peopleRec.person_id,\n newName: (`${reactData.current.peopleRec.name.first} ${reactData.current.peopleRec.name.last}`).trim()\n });\n }\n }\n }}\n >\n {'Exit'}\n \n {reactData.OKtoSave ?\n (isEmpty(reactData.errorList) ?\n \n {\n const result = await saveChanges();\n if (!!result) {\n reactData.saveCompleted = true;\n }\n updateReactData({\n saveCompleted: reactData.saveCompleted,\n OKtoSave: !result\n }, true);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'lightcyan', color: 'black' }}\n size='small'\n >\n {reactData.isMobile ? 'Save' : 'Save/Continue'}\n \n {\n let result = await saveChanges();\n if (result) {\n onClose({\n newID: reactData.current.peopleRec.person_id,\n newName: (`${reactData.current.peopleRec.name.first} ${reactData.current.peopleRec.name.last}`).trim()\n });\n }\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n >\n {'Save/Finish'}\n \n \n :\n \n \n {(Object.keys(reactData.errorList).length === 1)\n ? `${reactData.errorList[Object.keys(reactData.errorList)[0]].errorMessage}`\n : `${Object.keys(reactData.errorList).length} issues`\n }\n \n \n )\n :\n (reactData.current.peopleRec?.name?.first &&\n \n \n {`${(reactData.current.peopleRec?.name?.first + \"'s\").replace(\"s's\", \"s'\")} Profile`}\n \n {(reactData.mode === 'view') &&\n \n {`** View only **`}\n \n }\n {(reactData.mode === 'view') &&\n \n {`No Changes allowed`}\n \n }\n \n )\n }\n \n\n {reactData.alert &&\n {\n updateReactData({\n alert: false\n }, true);\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center'\n }}\n >\n \n {([reactData.alert.action].flat()).map((this_action, actionNdx) => (\n this_action.function()}\n >\n {this_action.text}\n \n ))}\n \n : null\n )}\n variant='filled'\n onClose={() => {\n updateReactData({\n alert: false\n }, true);\n }}\n >\n {reactData.alert.title && {reactData.alert.title}}\n {reactData.alert.message}\n \n \n }\n \n );\n};\n","import React from 'react';\n\nimport Dialog from '@material-ui/core/Dialog';\n\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\n\n\nimport MoveUpIcon from '@material-ui/icons/Publish';\nimport MoveDownIcon from '@material-ui/icons/GetApp';\nimport Tooltip from '@material-ui/core/Tooltip';\n\nimport Box from '@material-ui/core/Box';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport { AVATextStyle } from '../../util/AVAStyles';\n\nimport Button from '@material-ui/core/Button';\n\nconst useStyles = makeStyles(theme => ({\n containerBox: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 10,\n marginBottom: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 0,\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n}));\n\nexport default ({ listToUpdate, options = {}, onClose }) => {\n\n const classes = useStyles();\n\n const preparedOGList = prepare(listToUpdate);\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const [reactData, setReactData] = React.useState({\n allDone: false,\n OGList: preparedOGList,\n currentList: preparedOGList\n });\n\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) {\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n }\n };\n\n function prepare(passedIn) {\n let response = [];\n if (!passedIn) {\n return [];\n }\n if (Array.isArray(passedIn)) {\n passedIn.forEach((p, x) => {\n if (typeof (p) === 'string') { // this was an array of strings\n response.push({\n value: p,\n key: x,\n sort: x\n });\n }\n else { // this was an array of objects\n response.push({\n value: p.value || Object.values(p)[0],\n key: p.key || x,\n sort: p.sort || x,\n });\n }\n });\n }\n else { // this was an object\n Object.keys(passedIn).forEach((p, x) => {\n response.push({\n value: passedIn[p].value || Object.values(passedIn[p])[0],\n key: passedIn[p].key || x,\n sort: passedIn[p].sort || x,\n });\n });\n };\n return response.sort((a, b) => {\n return ((a.sort > b.sort) ? 1 : -1);\n });\n }\n\n return (\n \n {/* Screen header - Description, Date, Location... */}\n \n \n \n Customize your Event\n \n \n \n {reactData.currentList && (reactData.currentList.length > 0) &&\n reactData.currentList.map((this_entry, x) => (\n \n {\n reactData.currentList[x].value = event.target.value;\n updateReactData({\n currentList: reactData.currentList\n }, true);\n }}\n onBlur={(event) => {\n reactData.currentList[x].value = event.target.value;\n updateReactData({\n currentList: reactData.currentList\n }, true);\n }}\n />\n \n {(x > 0) &&\n \n {\n reactData.currentList.splice(x - 1, 0, reactData.currentList.splice(x, 1)[0]);\n updateReactData({\n currentList: reactData.currentList\n }, true);\n }}\n />\n \n }\n {(x < (reactData.currentList.length - 1)) &&\n \n {\n reactData.currentList.splice(x + 1, 0, reactData.currentList.splice(x, 1)[0]);\n updateReactData({\n currentList: reactData.currentList\n }, true);\n }}\n />\n \n }\n \n \n ))\n }\n \n \n {\n onClose(reactData.OGList);\n updateReactData({\n allDone: true\n }, true);\n }}\n >\n Cancel\n \n \n \n {\n onClose(reactData.currentList.map((c, x) => {\n return {\n key: c.key,\n value: c.value,\n sort: x\n };\n }));\n updateReactData({\n allDone: true\n }, true);\n }}\n >\n Save\n \n \n \n \n );\n};","import React from 'react';\n\nimport { prepareTargets } from '../../util/AVAGroups';\nimport { makeArray, titleCase, listFromArray } from '../../util/AVAUtilities';\nimport { addEvent, writeSlot } from '../../util/AVACalendars';\nimport { AVAclasses } from '../../util/AVAStyles';\n\nimport ClientsSection from '../sections/ClientsSection';\nimport EditList from '../forms/EditList';\nimport Select from \"react-dropdown-select\";\n\nimport { makeDate, makeTime, addMonths } from '../../util/AVADateTime';\n\nimport { useSnackbar } from 'notistack';\n\nimport PersonFilter from '../forms/PersonFilter';\n\nimport { AVATextStyle } from '../../util/AVAStyles';\n\nimport AppBar from '@material-ui/core/AppBar';\nimport Box from '@material-ui/core/Box';\nimport CloseIcon from '@material-ui/icons/Close';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport IconButton from '@material-ui/core/IconButton';\nimport Toolbar from '@material-ui/core/Toolbar';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormGroup from '@material-ui/core/FormGroup';\n\nimport TextField from '@material-ui/core/TextField';\nimport Button from '@material-ui/core/Button';\nimport RadioGroup from '@material-ui/core/RadioGroup';\nimport Radio from '@material-ui/core/Radio';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport FormControl from '@material-ui/core/FormControl';\n\nimport ListItem from '@material-ui/core/ListItem';\n\nimport useSession from '../../hooks/useSession';\nimport { getPerson } from '../../util/AVAPeople';\n\nconst useStyles = makeStyles(theme => ({\n title: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n flexGrow: 1\n },\n radius_rounded: {\n borderRadius: '30px'\n },\n formControlDays: {\n margin: 0,\n marginLeft: '-8px',\n marginRight: '2px',\n paddingTop: 0,\n height: 1,\n fontSize: theme.typography.fontSize * 0.8,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: '10px',\n marginBottom: '25px',\n },\n centerCenter: {\n alignItems: 'center',\n justifyContent: 'center',\n marginBottom: -12\n },\n dialogBox: {\n paddingTop: 0,\n paddingLeft: 0,\n paddingBottom: theme.spacing(1),\n overflowX: 'hidden',\n marginLeft: theme.spacing(2),\n },\n radioDays: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 2,\n marginLeft: 0,\n },\n titlePersonSelect: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n formControl: {\n margin: 0,\n paddingTop: 0,\n },\n rowButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small'\n },\n formControlLbl: {\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n },\n picture: {\n width: theme.spacing(16),\n height: theme.spacing(16),\n [theme.breakpoints.down('xs')]: {\n width: theme.spacing(8),\n height: theme.spacing(8),\n },\n },\n photoButton: {\n alignSelf: 'center',\n size: 'sm',\n variant: 'outlined',\n verticalAlign: 'middle',\n },\n defaultButton: {\n alignSelf: 'end',\n marginTop: 20,\n textTransform: 'none',\n verticalAlign: 'center',\n color: theme.palette.confirm[theme.palette.type],\n },\n topButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n resetButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n marginRight: 10,\n },\n infoButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.info[theme.palette.type],\n marginRight: 10,\n paddingRight: 10,\n marginLeft: 10,\n paddingLeft: 10,\n },\n freeInput: {\n marginLeft: '25px',\n marginTop: '15px',\n marginRight: 2,\n marginBottom: '10px',\n paddingLeft: 0,\n paddingRight: 0,\n width: '90%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n minHeight: theme.typography.fontSize * 2.8,\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n listItemAVA: {\n fontSize: theme.typography.fontSize * 1.5,\n },\n listItemHighlighted: {\n fontSize: theme.typography.fontSize * 1.5,\n backgroundColor: 'yellow'\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n noRow: {\n marginLeft: 0,\n marginTop: 0,\n marginBottom: 0,\n paddingTop: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n timeInput: {\n marginRight: '16px'\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 5,\n },\n}));\n\nexport default ({ patient, personalEvent, picture, showNewEvent, onClose, isAppointment, options = {} }) => {\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const { state } = useSession();\n const { session } = state;\n const [ownerTargetInfo, setOwnerTargetInfo] = React.useState();\n\n const [last_date, setLastDate] = React.useState(' ');\n const [lastAsADate, setLastAsADate] = React.useState();\n const [specificPeople, setSpecificPeople] = React.useState(' ');\n const [customizeButton, setcustomizeButton] = React.useState(false);\n const [specificOwners, setSpecificOwners] = React.useState(' ');\n const [signup_type, setSignUpType] = React.useState('none');\n const [defaultSlotOwners, setDefaultSlotOwners] = React.useState('none');\n const [slot_max_seats, setSlotMaxSeats] = React.useState(' ');\n const [slot_interval, setSlotInterval] = React.useState(' ');\n const [eventDateAsDisplayString, setEventDateAsDisplayString] = React.useState((options.setDate ? options.setDate.dateObj.absolute : ' '));\n const [displayTimes, setIntervalDisplay] = React.useState([]);\n const [showOwnerSelect, setShowOwnerSelect] = React.useState(false);\n const [ownerList, setOwnerList] = React.useState([patient.person_id || patient.patient_id]);\n\n const [checkedDays, setCheckedDays] = React.useState({});\n\n const { closeSnackbar, enqueueSnackbar } = useSnackbar();\n\n const [reactData, setReactData] = React.useState({\n groupList: [],\n restrictToGroups: [],\n slotObjList: [],\n event_date: (options.setDate ? options.setDate.dateObj : null),\n prefMethod: 'specific_date',\n preReservationList: ((options.setPerson && isAppointment) ? [patient.person_id || patient.patient_id] : []),\n dateObj: { error: true },\n default_forms: options.forms,\n customizations: options.customizations,\n chosen_names: ((options.setPerson && isAppointment) ? patient.display_name : ''),\n event_title: (options.title ? titleCase(options.title.trim())\n : ((options.setPerson && isAppointment) ? (`Appointment for ${patient.display_name}`) : '')),\n title_override: false,\n event_location: (options.location\n ? options.location\n : ((options.setPerson && isAppointment) ? patient.location : '')\n ),\n location_override: false,\n initialized: false,\n allDay: true,\n startObj: { empty: true },\n endObj: { empty: true },\n timeOK: true\n });\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) {\n setForceRedisplay(!forceRedisplay);\n }\n };\n\n const makeChoices = (rawList) => {\n let response = [];\n rawList.forEach(listEntry => {\n if ((listEntry.access !== 'none') && (listEntry.access !== 'view')) {\n response.push({\n value: listEntry.person_id,\n label: listEntry.display_name\n });\n }\n });\n return response;\n };\n\n const dOfw = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\n // const [patientGroups, setPatientGroups] = React.useState();\n\n let intervals24h = [];\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n let ordinal = ['1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th',\n '11th', '12th', '13th', '14th', '15th', '16th', '17th', '18th', '19th', '20th',\n '21st', '22nd', '23rd', '24th', '25th', '26th', '27th', '28th'];\n\n React.useEffect(() => {\n if (patient) {\n }\n }, [patient]);\n\n const handleAbort = () => {\n onClose();\n };\n\n const handleUpdate = async () => {\n enqueueSnackbar(`AVA is creating your new event! Stand by...`, { variant: 'warning' });\n let oDays = [];\n if (reactData.prefMethod && ((reactData.prefMethod === 'weekly_on') || (reactData.prefMethod === 'bi-weekly_on'))) {\n Object.keys(checkedDays).forEach(a => {\n if (checkedDays[a]) { oDays.push(Number(a)); };\n });\n }\n let time_duration;\n if (reactData.allDay) {\n\n }\n if (reactData.startObj.good && reactData.endObj.good) {\n time_duration = reactData.endObj.minutesSinceMidnight - reactData.startObj.minutesSinceMidnight;\n if (time_duration < 0) {\n time_duration += 1440;\n }\n }\n var payload = {\n \"clientId\": patient.client_id,\n \"calendar_info\": {\n \"groups\": null,\n \"description\": reactData.event_title,\n \"image\": null,\n \"event_date\": reactData.event_date.date.getTime(),\n \"last_date\": lastAsADate?.getTime() || null,\n \"schedule_type\": reactData.prefMethod,\n \"time_from\": reactData.startObj.time,\n \"time_to\": reactData.endObj.time,\n time_duration,\n allDay: reactData.allDay,\n \"default_forms\": reactData.default_forms,\n \"customizations\": reactData.customizations,\n \"slots\": reactData.slotObjList.map(s => { return s.key; }),\n \"slot_object_list\": reactData.slotObjList,\n \"defaultSlotOwners\": defaultSlotOwners,\n \"occDays\": oDays,\n \"location\": reactData.event_location,\n \"owner\": ownerList,\n \"personal_event\": !!personalEvent && !isAppointment,\n \"restrictions\": reactData.restrictToGroups,\n \"signup_type\": signup_type,\n \"slot_max_seats\": slot_max_seats,\n \"slot_interval\": slot_interval,\n \"slot_visibility\": \"show_name\",\n \"reminder_minutes_Enrolled\": 0,\n \"reminder_minutes_NotEnrolled\": 0\n }\n };\n let response = await addEvent(payload);\n response.slots = [];\n if (!!personalEvent\n && !isAppointment // this is a personal event, not an appointment; the owner MUST be added to a slot\n && (!reactData.preReservationList.includes(state.session.patient_id))\n ) {\n reactData.preReservationList.push(state.session.patient_id);\n }\n if ((isAppointment || personalEvent) && (reactData.preReservationList.length > 0)) {\n for (let o = 0; o < response.occRecords.occArray.length; o++) {\n let this_occurrence = response.occRecords.occArray[o];\n for (let s = 0; s < reactData.preReservationList.length; s++) {\n let this_person = reactData.preReservationList[s];\n let writeRequest = {\n \"client\": state.session.client_id,\n \"event\": response.event_id,\n occurrence_date: this_occurrence,\n \"owner\": this_person,\n \"slot\": payload.calendar_info.slots[s] || this_person,\n \"status\": 'selected',\n \"show_this_slot\": true,\n \"no_messaging\": true\n };\n let this_slot = await writeSlot(writeRequest);\n response.slots.push(this_slot);\n }\n }\n }\n closeSnackbar();\n if (response) {\n enqueueSnackbar(`${response.eventData.event_data.description} has been saved!`, { variant: 'success' });\n }\n else {\n enqueueSnackbar(`Sorry. AVA could not save this event!`, { variant: 'error' });\n }\n localStorage.setItem(`calendarChanged`, true);\n onClose(response);\n };\n\n // **************************\n\n function setSeatNames(pNum) {\n let inNum = Number(pNum);\n let digits, starter, lastSeat;\n if (isNaN(inNum)) { return []; }\n else if (inNum < 10) { digits = 1; starter = 11; lastSeat = 10 + inNum; }\n else if (inNum < 100) { digits = 2; starter = 101; lastSeat = 100 + inNum; }\n else if (inNum < 1000) { digits = 3; starter = 1001; lastSeat = 1000 + inNum; }\n else return [];\n let returnArr = [];\n for (let i = starter; i <= lastSeat; i++) {\n returnArr.push((i.toString().slice(-digits)));\n }\n return returnArr;\n }\n\n function OK2Save() {\n return ((reactData.event_date && !reactData.event_date.error)\n && (reactData.event_title.trim() !== '')\n && (!isAppointment || (reactData.preReservationList.length > 0))\n && reactData.timeOK\n );\n }\n\n const handleChangeDescription = vCheck => {\n updateReactData({\n event_title: vCheck,\n title_override: true\n }, true);\n };\n\n const handleChangeLocation = vCheck => {\n updateReactData({\n event_location: vCheck,\n location_override: true\n }, true);\n };\n\n const handleChangeEventDate = event => {\n setEventDateAsDisplayString(event.target.value);\n }\n\n const handleChangeLastDate = event => {\n setLastAsADate(null);\n setLastDate(event.target.value);\n };\n\n const handleLastDateExit = event => {\n if (event.key === 'Enter' || event.type === 'blur') {\n let goodDate = new Date(last_date);\n if (isNaN(goodDate.getTime())) { // invalid date input\n if (reactData.event_date) {\n let addYears = 1;\n if (reactData.prefMethod === 'annually_on') { addYears = 10; }\n if (reactData.prefMethod === 'semiannually_on') { addYears = 3; }\n goodDate = reactData.event_date.date;\n goodDate.setFullYear(goodDate.getFullYear() + addYears);\n }\n else {\n setLastDate('');\n setLastAsADate(null);\n }\n }\n let current = new Date(Date.now());\n if (goodDate < current) {\n let yyyy = current.getFullYear();\n goodDate.setFullYear(yyyy);\n if (goodDate < current) { goodDate.setFullYear(yyyy + 1); }\n };\n setLastDate(goodDate.toDateString());\n setLastAsADate(goodDate);\n }\n };\n\n const handleChangeOwnersToggle = event => {\n setSpecificOwners(event.target.value);\n };\n\n const handleChangePeopleToggle = event => {\n setSpecificPeople(event.target.value);\n };\n\n const handleChangeSignUp = event => {\n if (signup_type !== event.target.value) {\n setSignUpType(event.target.value);\n let reactUpdateObj = {\n slotObjList: []\n }\n if (event.target.value === 'time') {\n reactUpdateObj.allDay = (reactData.startObj.empty && reactData.endObj.empty);\n reactUpdateObj.timeOK = (reactData.startObj.good && reactData.endObj.good);\n }\n updateReactData(reactUpdateObj, true);\n }\n };\n\n const handleChangeDefaultSlotOwners = event => {\n setDefaultSlotOwners(event.target.value);\n };\n\n const handleChangeMaxSeats = event => {\n setSlotMaxSeats(event.target.value);\n let seatList = setSeatNames(event.target.value);\n let updatedList = seatList.map((i, x) => {\n let found;\n if (reactData.slotObjList && (reactData.slotObjList.length > 0)) {\n found = reactData.slotObjList.find(s => {\n return (s.key === i);\n });\n }\n if (found) {\n return {\n key: found.key,\n value: found.value,\n sort: i\n };\n }\n else {\n return {\n key: i,\n value: i,\n sort: i\n };\n }\n });\n updateReactData({\n slotObjList: updatedList\n }, false);\n };\n\n const handleChangeInterval = event => {\n setSlotInterval(event.target.value);\n };\n\n const handleSetSlotTimes = () => {\n let intervals = [];\n if (reactData.timeOK && !reactData.allDay && reactData.startObj.numeric24 && reactData.endObj.numeric24) {\n let useFromTime = reactData.startObj.numeric24;\n let useToTime = reactData.endObj.numeric24;\n let s = Number(slot_interval);\n let m = useToTime % 100;\n let h = Math.floor(useToTime / 100);\n m -= s;\n if (m < 0) {\n m += 60;\n h--;\n if (h < 0) { h += 24; }\n }\n let stopLoop = (h * 100) + m;\n for (\n let t = useFromTime;\n t <= stopLoop;\n t\n ) {\n let mm = t % 100;\n let hh_raw = Math.floor(t / 100);\n let hh = hh_raw;\n if (hh_raw > 12) { hh = hh_raw - 12; }\n else if (hh_raw === 0) { hh = 12; };\n intervals.push(`${hh}:${mm < 10 ? '0' + mm : mm}`);\n intervals24h.push((10000 + (hh_raw * 100) + mm).toString().slice(-4));\n mm += s;\n if (mm > 59) {\n mm -= 60;\n hh_raw++;\n }\n t = (hh_raw * 100) + mm;\n }\n setIntervalDisplay(intervals);\n let updatedList = intervals24h.map((i, x) => {\n let found;\n if (reactData.slotObjList && (reactData.slotObjList.length > 0)) {\n found = reactData.slotObjList.find(s => {\n return (s.key === i);\n });\n }\n if (found) {\n return {\n key: found.key,\n value: found.value,\n sort: i\n };\n }\n else {\n return {\n key: i,\n value: intervals[x],\n sort: i\n };\n }\n });\n updateReactData({\n slotObjList: updatedList\n }, false);\n }\n };\n\n React.useEffect(() => {\n async function initialize() {\n let startObj = { empty: true, good: false };\n let endObj = { empty: true, good: false };\n let allDay = false;\n if (options.setEnd) {\n endObj = makeTime(options.setEnd);\n };\n if (options.setStart) {\n startObj = makeTime(options.setStart);\n if (!startObj.error) {\n if (endObj.empty && options.setDuration) {\n const tempTime = startObj.minutesSinceMidnight + options.setDuration;\n endObj = makeTime(`${(Math.floor(tempTime / 60) * 100)}:${(tempTime % 60)}`);\n }\n }\n }\n if ((startObj.empty || (startObj.minutesSinceMidnight < 5))\n && (endObj.empty || (endObj.minutesSinceMidnight > 1435))) {\n allDay = true;\n }\n updateReactData({\n startObj,\n endObj,\n allDay,\n timeOK: true\n }, false)\n if (options.noDisplay) {\n handleUpdate();\n }\n }\n if (!reactData.initialized) {\n initialize();\n updateReactData({ initialized: true }, true);\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n // **************************\n\n return (\n \n {!personalEvent &&\n \n \n \n \n \n \n \n {'Create a New Event'}\n \n \n \n \n \n }\n {showNewEvent && !customizeButton &&\n \n \n \n {`${options.title || (isAppointment ? 'Appointment' : 'Event')} Details`}\n \n \n \n \n {isAppointment &&\n \n \n ({\n ...defaultStyles,\n color: 'black',\n backgroundColor: state.isSelected ? 'red' : 'orange'\n })\n }}\n noDataLabel={`No names match`}\n onChange={async (values) => {\n if (values.length > 0) {\n let reactUpd = [];\n if (values.length === 1) {\n reactUpd = {\n preReservationList: [values[0].value],\n chosen_names: values[0].label\n };\n\n }\n else if (values.length > 1) {\n let peopleNames = [];\n let reservationList = [];\n for (let v = 0; v < values.length; v++) {\n peopleNames.push(values[v].label);\n reservationList.push(values[v].value);\n }\n reactUpd = {\n preReservationList: reservationList,\n chosen_names: listFromArray(peopleNames)\n };\n }\n if (!reactData.title_override) {\n reactUpd.event_title = `${options.title ? titleCase(options.title.trim()) : 'Appointment'} for ${reactUpd.chosen_names}`;\n }\n if (!reactData.location_override_override) {\n let this_person = await getPerson(values[0].value);\n reactUpd.event_location = this_person.location || '';\n }\n updateReactData(reactUpd, true);\n }\n else { // values.length === 0 (no one selected)\n let reactUpd = {\n preReservationList: [],\n chosen_names: ''\n };\n if (!reactData.title_override) {\n reactUpd.event_title = '';\n }\n if (!reactData.location_override_override) {\n reactUpd.event_location = '';\n }\n updateReactData(reactUpd, true);\n }\n }}\n />\n \n \n {(state.accessList && state.accessList[state.session.client_id])\n ? `Who is this ${titleCase(options.title)} for?`\n : 'AVA still loading...'\n }\n \n \n \n \n }\n
    \n (handleChangeDescription(event.target.value))}\n helperText='Event Title'\n />\n
    \n
    \n (handleChangeLocation(event.target.value))}\n helperText='Location'\n />\n
    \n
    \n {\n if (event.target.value) {\n let dObj = makeDate(event.target.value, { noTime: true });\n let reactUpd = { event_date: dObj };\n setEventDateAsDisplayString(dObj.absolute);\n if (!reactData.prefMethod) {\n reactUpd.method = 'specific_date';\n };\n let checkedDays = [];\n checkedDays[dObj.dayOfWeek] = true;\n setCheckedDays(checkedDays);\n updateReactData(reactUpd, true);\n }\n }}\n helperText='Event Date'\n />\n
    \n {reactData.event_date && !reactData.event_date.error &&\n \n \n {\n updateReactData({ prefMethod: event.target.value }, true);\n }}\n >\n }\n label={\n \n This date only\n }\n />\n }\n label={\n \n {`Every week`}\n }\n />\n }\n label={\n \n {`Every other week`}\n }\n />\n }\n label={\n \n {`Every year on ${reactData.event_date.date.toLocaleDateString(undefined, { month: 'short', day: 'numeric' })}`}\n }\n />\n }\n label={\n \n {`Twice a year (${reactData.event_date.date.toLocaleDateString(undefined, { month: 'short', day: 'numeric' })} and ${addMonths(reactData.event_date.date, 6).date.toLocaleDateString(undefined, { month: 'short', day: 'numeric' })})`}\n }\n />\n }\n label={\n \n {`Every month on the ${ordinal[(Math.min(Math.floor(reactData.event_date.date.getDate() / 7.1) + 1, 4)) - 1]} ${reactData.event_date.date.toLocaleDateString(undefined, { weekday: 'long' })}`}\n }\n />\n {reactData.event_date.date.getDate() < 29 &&\n }\n label={\n \n {`Every month on the ${ordinal[(reactData.event_date.date.getDate()) - 1]}`}\n }\n />\n }\n \n \n \n }\n {(reactData.prefMethod && ((reactData.prefMethod === 'weekly_on') || (reactData.prefMethod === 'bi-weekly_on'))) &&\n \n \n {`Which days?`}\n \n \n \n {[0, 1, 2, 3, 4, 5, 6].map(this_dow => (\n {\n if (checkedDays[this_dow]) { checkedDays[this_dow] = false; }\n else { checkedDays[this_dow] = true; }\n setCheckedDays(checkedDays);\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_0` }}\n />\n }\n label={\n {dOfw[this_dow]}\n }\n labelPlacement='bottom'\n />\n ))}\n \n \n \n }\n {(reactData.prefMethod && (reactData.prefMethod !== 'specific_date')) &&\n
    \n \n
    \n }\n {reactData.prefMethod && (reactData.prefMethod !== 'specific_date') && !personalEvent &&\n \n When accessing a new occurrence, copy previous names?\n \n \n }\n label={\n \n Do not copy\n }\n />\n }\n label={\n \n Copy from first occurrence\n }\n />\n }\n label={\n \n Copy from last active occurrence\n }\n />\n \n \n \n }\n \n {\n updateReactData({\n startObj: Object.assign(reactData.startObj, {time: event.target.value})\n }, true)\n }}\n onBlur={(event) => {\n const startObj = makeTime(event.target.value);\n if (startObj.empty) {\n // empty start\n updateReactData({\n startObj,\n allDay: reactData.endObj.empty,\n timeOK: reactData.endObj.empty\n }, true)\n }\n else if ((startObj.error) || (reactData.endObj.error)) {\n // bad start or bad end\n updateReactData({\n startObj,\n allDay: false,\n timeOK: false\n }, true);\n }\n else if (reactData.endObj.empty) {\n // good start, no end\n let tempTime;\n if (options.setDuration && (options.setDuration < 1400)) {\n tempTime = startObj.minutesSinceMidnight + options.setDuration;\n }\n else {\n tempTime = startObj.minutesSinceMidnight + 60;\n }\n const endObj = makeTime(`${(Math.floor(tempTime / 60) * 100)}:${(tempTime % 60)} ${(tempTime > 719) ? 'pm' : 'am'}`);\n updateReactData({\n startObj,\n endObj,\n allDay: false,\n timeOK: !endObj.error\n }, true)\n }\n else {\n // good start, good end\n updateReactData({\n startObj,\n allDay: false,\n timeOK: true\n }, true);\n }\n }}\n helperText='Start time'\n />\n {\n updateReactData({\n endObj: Object.assign(reactData.endObj, { time: event.target.value })\n }, true);\n }}\n onBlur={(event) => {\n const endObj = makeTime(event.target.value);\n if (endObj.empty) {\n // empty end\n updateReactData({\n endObj,\n allDay: reactData.startObj.empty,\n timeOK: reactData.startObj.empty\n }, true);\n }\n else if ((endObj.error) || (reactData.startObj.error)) {\n // bad start or bad end\n updateReactData({\n endObj,\n allDay: false,\n timeOK: false\n }, true);\n }\n else if (reactData.startObj.empty) {\n // good end, no start\n let tempTime;\n if (options.setDuration) {\n tempTime = endObj.minutesSinceMidnight - options.setDuration;\n }\n else {\n tempTime = endObj.minutesSinceMidnight - 60;\n }\n const startObj = makeTime(`${(Math.floor(tempTime / 60) * 100)}:${(tempTime % 60)}`);\n updateReactData({\n startObj,\n endObj,\n allDay: false,\n timeOK: !startObj.error\n }, true);\n }\n else {\n // good start, good end\n updateReactData({\n endObj,\n allDay: false,\n timeOK: true\n }, true);\n }\n }}\n\n helperText='End time'\n />\n {\n if (reactData.allDay) {\n updateReactData({\n allDay: false,\n timeOK: (reactData.startObj.good && reactData.endObj.good),\n }, true)\n }\n else {\n updateReactData({\n allDay: true,\n timeOK: true,\n }, true)\n }\n }}\n disableRipple\n className={classes.radioButton}\n size='small'\n />\n \n All Day?\n \n \n {!personalEvent && !isAppointment && !options.simpleForm &&\n \n Does this event require sign-up?\n \n \n }\n label={\n \n Open/Unlimited\n }\n />\n }\n label={\n \n Limited to a maximum number of Participants\n }\n />\n }\n label={\n \n Schedule appointments at specific intervals\n }\n />\n \n \n \n }\n {(signup_type === 'seats') &&\n
    \n \n
    \n }\n {(signup_type === 'time') &&\n
    \n \n
    \n }\n {(displayTimes.length > 0) && (signup_type === 'time') &&\n \n \n \n {'Appointment schedule will be'}\n \n {displayTimes.map((time) => (\n \n {time}\n \n ))}\n \n \n }\n {reactData.slotObjList && (reactData.slotObjList.length > 0) &&\n \n Tap to Customize this event\n \n {\n setcustomizeButton(true);\n }}\n >\n Customize\n \n \n \n }\n {!personalEvent && !isAppointment && !options.simpleForm &&\n \n Do you wish to restrict this event to specific groups only?\n \n \n }\n label={\n \n No\n }\n />\n }\n label={\n \n Yes\n }\n />\n \n \n \n }\n {(specificPeople === 'yes') &&\n {\n if (selections.length === 0) {\n selections = ['*all'];\n }\n updateReactData({\n restrictToGroups: selections\n }, false);\n }}\n />\n }\n {!personalEvent && !isAppointment &&\n \n Show someone other than you be listed as an event owner?\n \n \n }\n label={\n \n No\n }\n />\n }\n label={\n \n Yes\n }\n />\n \n \n \n }\n {(specificOwners === 'yes') &&\n
    \n {ownerList.length > 0 ?\n ownerList.map((ownerEntry, x) => (\n (\n \n \n {ownerTargetInfo && ownerTargetInfo[ownerEntry] &&\n ((typeof ownerTargetInfo[ownerEntry].name === 'object')\n ? `${ownerTargetInfo[ownerEntry].name.first} ${ownerTargetInfo[ownerEntry].name.last}`\n : ownerTargetInfo[ownerEntry].name\n )\n }\n \n \n )\n ))\n : (\n \n {'Tap the button below to choose...'}\n \n )\n }\n {\n let ownerTargetObj = await prepareTargets(session.user_id, session.client_id, { includeGroups: false, includePeople: true });\n setOwnerTargetInfo(ownerTargetObj.responsibleObj);\n setShowOwnerSelect(true);\n }}\n >\n {`Tap to select`}\n \n
    \n }\n \n
    \n \n \n \n { onClose(); }}\n startIcon={}\n >\n {'Done'}\n \n {OK2Save() &&\n {\n handleUpdate();\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n >\n {'Save'}\n \n }\n \n \n \n {showOwnerSelect &&\n {\n setShowOwnerSelect(false);\n }}\n onSelect={(pChoices) => {\n setOwnerList(makeArray(pChoices));\n setShowOwnerSelect(false);\n }}\n >\n \n }\n
    \n }\n {showNewEvent && customizeButton &&\n {\n setcustomizeButton(false);\n updateReactData({\n slotObjList: response\n }, true);\n }}\n />\n }\n \n );\n};\n","import React from 'react';\n\nimport useSession from '../../hooks/useSession';\n\nimport { deepCopy, isMobile, titleCase, listFromArray, isEmpty } from '../../util/AVAUtilities';\nimport { AVATextStyle, AVAclasses } from '../../util/AVAStyles';\nimport PeopleMaintenance from '../dialogs/PeopleMaintenance';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport { Box, Button, TextField, Typography, Dialog, Paper, DialogContentText, DialogActions, Switch } from '@material-ui/core/';\n\nconst useStyles = makeStyles(theme => ({\n clientPopUp: {\n borderRadius: '30px 30px 30px 30px',\n padding: '16px',\n height: '450px'\n }\n}));\n\nexport default ({ reactData, updateReactData, onClose, options = {} }) => {\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n const { state } = useSession();\n const isMounted = React.useRef(false);\n const administrative_account = (['admin', 'support', 'master'].includes(state.user.account_class));\n\n React.useEffect(() => {\n async function initialize() {\n let reactUpd = {};\n reactUpd.preferred_recipients = [];\n for (let this_group in state.groups.preferred_recipients) {\n if (state.groups.preferred_recipients[this_group].length > 0) {\n for (const this_pref of state.groups.preferred_recipients[this_group]) {\n reactUpd.preferred_recipients.push({\n objText: titleCase((this_pref.objText.toLowerCase().split('message to')).pop()),\n personList: this_pref.personList,\n personNames: this_pref.personNames\n });\n }\n }\n }\n if (options.withGroups && !reactData.groupInfo) {\n if (state.hasOwnProperty('groups')) {\n let groupList = [];\n let groupList_minLevel = 99;\n loadList('__TOP__', state.groups.groupTree['__TOP__'], 0);\n function loadList(this_item, my_children, this_level) {\n if (administrative_account || (state.accessList[state.session.client_id].groups[this_item] >= 2)) {\n groupList.push({\n group_id: this_item,\n group_name: state.groups.groupNames[this_item],\n level: this_level\n });\n if (groupList_minLevel > this_level) {\n groupList_minLevel = this_level;\n }\n }\n if (isEmpty(my_children)) { return; }\n else {\n let next_level = this_level + 1;\n for (let my_child in my_children) {\n loadList(my_child, my_children[my_child], next_level);\n }\n }\n }\n reactUpd.groupInfo = Object.assign({}, deepCopy(state.groups), {\n // groupList: deepCopy(groupList) });\n\n groupList: groupList.map(this_group => {\n return {\n group_id: this_group.group_id,\n group_name: this_group.group_name,\n level: this_group.level - groupList_minLevel\n };\n })\n });\n\n }\n }\n if (!reactData.accessList) {\n if (!state.accessList) {\n if (isMounted.current) {\n onClose();\n }\n }\n else {\n reactUpd.selections = (options.keepSelections ? reactData.selections : []);\n reactUpd.accessList = deepCopy(state.accessList[state.session.client_id].list);\n }\n }\n else {\n reactUpd.selections = (options.keepSelections ? reactData.selections : []);\n }\n updateReactData(reactUpd, true);\n }\n isMounted.current = true;\n initialize();\n return () => { isMounted.current = false; };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const clean = (this_entry) => {\n let work = titleCase(this_entry.replace(/GRP|AVA|TOP|ALL/gm, '').replace(/_/gm, ' ').trim());\n let responseA = [];\n let skip = false;\n for (let char of work) {\n if (skip) {\n responseA.push(char);\n skip = false;\n }\n else if (char === char.toLowerCase()) { responseA.push(char); }\n else if (char === ' ') {\n responseA.push(char);\n skip = true;\n }\n else if (char === char.toUpperCase()) { responseA.push(' ', char); }\n else { responseA.push(char); }\n }\n return responseA.join('');\n };\n\n const countSelections = () => {\n let selectedPeople_count = 0;\n let selectedPeople_list = [];\n if (reactData.selections) {\n let selectionPeople_obj = {};\n for (let this_selection of reactData.selections) {\n if (this_selection.hasOwnProperty('person_id')) {\n selectionPeople_obj[this_selection.person_id] = true;\n }\n else if (this_selection.hasOwnProperty('personList')) {\n for (let this_person of this_selection.personList) {\n selectionPeople_obj[this_person] = true;\n }\n }\n else if (this_selection.hasOwnProperty('group_id')) {\n for (let this_person of reactData.accessList) {\n if (this_person.groups && this_person.groups.includes(this_selection.group_id)) {\n selectionPeople_obj[this_person.person_id] = true;\n }\n }\n }\n }\n selectedPeople_list = Object.keys(selectionPeople_obj);\n selectedPeople_count = selectedPeople_list.length;\n }\n return { selectedPeople_count, selectedPeople_list };\n };\n\n const OKtoShowPreferred = (this_object) => {\n return (\n (options.showAll && (isEmpty(reactData.linkedPersonFilter) || reactData.linkedPersonFilter?.raw?.length < 2))\n ||\n ((reactData.linkedPersonFilter?.raw?.length > 1)\n && (this_object.objText.toLowerCase().includes(reactData.linkedPersonFilter.lower)))\n ||\n ((reactData.linkedPersonFilter?.raw?.length > 1)\n && (this_object.personNames.some(p => { return p.toLowerCase().includes(reactData.linkedPersonFilter.lower); })))\n );\n };\n\n const OKtoShowGroup = (this_group) => {\n if (this_group.level === 0) {\n return false;\n }\n return (\n (options.showAll && (isEmpty(reactData.linkedPersonFilter) || reactData.linkedPersonFilter?.raw?.length < 2))\n ||\n ((reactData.linkedPersonFilter?.raw?.length > 1)\n && (this_group.group_name.toLowerCase().includes(reactData.linkedPersonFilter.lower)))\n );\n };\n\n const OKtoShow = (this_person) => {\n return (\n (options.showAll && (isEmpty(reactData.linkedPersonFilter) || reactData.linkedPersonFilter?.raw?.length < 2))\n ||\n (options.withSpecialValues\n && (reactData.special_values.some(this_special => { return (this_special.person_id === this_person.person_id); }))\n )\n ||\n (\n ((reactData.selections.length > 0) && (reactData.selections.some(s => {\n return s.person_id === this_person.person_id;\n })))\n ||\n ((reactData.linkedPersonFilter?.raw?.length > 1)\n && (`${this_person.last} ${this_person.first}`).toLowerCase().includes(reactData.linkedPersonFilter.lower))\n )\n );\n };\n\n return (\n { onClose(); }}\n >\n \n {options.title || `Quick Search`}\n \n {\n if (event.target.value.length === 0) {\n updateReactData({\n linkedPersonFilter: {\n raw: '',\n lower: ''\n }\n }, true);\n }\n else {\n updateReactData({\n linkedPersonFilter: {\n raw: event.target.value.trim(),\n lower: event.target.value.trim().toLowerCase()\n }\n }, true);\n }\n }}\n autoComplete='off'\n helperText='Name Search'\n />\n \n {reactData.showAll && reactData.selections && (reactData.selections.length > 0) &&\n \n \n \n {'Selected'}\n \n \n \n {reactData.selections.map((this_selection, sIndex) => (\n {\n if (options.pickAndGo) {\n reactData.selections.splice(sIndex, 1);\n let { selectedPeople_count, selectedPeople_list } = countSelections();\n updateReactData({\n selectedPeople_count,\n selectedPeople_list,\n selections: reactData.selections\n }, true);\n }\n }}\n >\n \n {this_selection.person_name || this_selection.listName || this_selection.group_name}\n \n \n )\n )}\n \n \n }\n {options.withPreferred && (reactData.preferred_recipients.length > 0) &&\n \n \n \n {'Preferred Recipients'}\n \n \n \n {'Hide'}\n \n {\n updateReactData({\n showPreferredList: !reactData.showPreferredList\n }, true);\n }}\n name=\"ShowGroups\"\n color=\"primary\"\n />\n \n {'Show'}\n \n \n \n \n\n {reactData.showPreferredList && reactData.preferred_recipients.map((this_recipient, rIndex) => (\n OKtoShowPreferred(this_recipient) &&\n {\n e.preventDefault();\n updateReactData({\n alert: {\n severity: 'info',\n title: `${this_recipient.objText}`,\n message:
    \n Person IDs: {listFromArray(this_recipient.personList)}\n Person Names: {listFromArray(this_recipient.personNames)}
    \n }\n }, true);\n }}\n onClick={() => {\n if (options.pickAndGo) {\n const foundAt = reactData.selections.findIndex(s => { return (s.rIndex === rIndex); });\n if (foundAt > -1) {\n reactData.selections.splice(foundAt, 1);\n }\n else {\n reactData.selections.unshift({\n rIndex,\n personList: this_recipient.personList,\n personNames: this_recipient.personNames,\n listName: this_recipient.objText\n });\n }\n let { selectedPeople_count, selectedPeople_list } = countSelections();\n updateReactData({\n selectedPeople_count,\n selectedPeople_list,\n selections: reactData.selections\n }, true);\n }\n }}\n >\n { return s.rIndex === rIndex; }))\n ? AVATextStyle({ bold: true, color: 'green' })\n : AVATextStyle()\n )}\n >\n {this_recipient.objText}\n \n
    \n )\n )}\n
    \n \n }\n {options.withGroups && reactData.groupInfo && (reactData.groupInfo.groupList.length > 0) &&\n \n \n \n {'Groups'}\n \n {(!options.hidePeople || !reactData.showGroupList) &&\n \n \n {'Hide'}\n \n {\n updateReactData({\n showGroupList: !reactData.showGroupList\n }, true);\n }}\n name=\"ShowGroups\"\n color=\"primary\"\n />\n \n {'Show'}\n \n \n }\n \n \n {reactData.showGroupList && reactData.groupInfo.groupList.map((this_group, gIndex) => (\n OKtoShowGroup(this_group) &&\n {\n e.preventDefault();\n updateReactData({\n alert: {\n severity: 'info',\n title: `${this_group.group_name}`,\n message:
    \n Group ID: {this_group.group_id}
    \n }\n }, true);\n }}\n onClick={() => {\n if (options.pickAndGo) {\n const foundAt = reactData.selections.findIndex(s => { return (s.group_id === this_group.group_id); });\n if (foundAt > -1) {\n reactData.selections.splice(foundAt, 1);\n }\n else {\n reactData.selections.unshift({\n group_id: this_group.group_id,\n group_name: this_group.group_name\n });\n }\n let { selectedPeople_count, selectedPeople_list } = countSelections();\n updateReactData({\n selectedPeople_count,\n selectedPeople_list,\n selections: reactData.selections\n }, true);\n }\n else {\n updateReactData({\n showGroupEdit_id: this_group.group_id\n }, true);\n }\n }}\n >\n { return s.group_id === this_group.group_id; }))\n ? AVATextStyle({ bold: true, color: 'green' })\n : AVATextStyle(),\n { marginLeft: `${((this_group.level - 1) * 10)}px` }\n )}\n >\n {this_group.group_name}\n \n
    \n )\n )}\n \n \n }\n\n {reactData.accessList &&\n !options.hidePeople &&\n ((options.withSpecialValues ? reactData.special_values : []).concat(reactData.accessList).length > 0) &&\n \n \n {(options.showAll ? 'People' : `People (use search above to find ${(reactData.selections && (reactData.selections.length > 0)) ? 'more ' : ''}names)`)}\n \n \n {((options.withSpecialValues ? reactData.special_values : []).concat(reactData.accessList)).map((this_item, tIndex) => (\n OKtoShow(this_item) &&\n {\n e.preventDefault();\n updateReactData({\n alert: {\n severity: 'info',\n title: `${this_item.first} ${this_item.last}`,\n message:
    \n User ID: {this_item.person_id}
    \n Groups: {listFromArray(this_item.groups.map(g => {\n return clean(g);\n }), { ignoreBlank: true })}
    \n }\n }, true);\n }}\n\n onClick={() => {\n if (options.pickAndGo || options.pickOne) {\n const foundAt = reactData.selections.findIndex(s => { return (s.person_id === this_item.person_id); });\n if (foundAt > -1) {\n reactData.selections.splice(foundAt, 1);\n }\n else {\n reactData.selections.unshift({\n person_id: this_item.person_id,\n person_name: (`${this_item.first.trim()} ${this_item.last.trim()}`).trim(),\n person_firstName: this_item.first.trim(),\n person_lastName: this_item.last.trim()\n });\n }\n let { selectedPeople_count, selectedPeople_list } = countSelections();\n updateReactData({\n selectedPeople_count,\n selectedPeople_list,\n selections: reactData.selections\n }, true);\n if (options.pickOne) {\n onClose(reactData.selections);\n }\n }\n else {\n updateReactData({\n showProfileEdit_id: this_item.person_id\n }, true);\n }\n }}\n >\n { return s.person_id === this_item.person_id; }))\n ? AVATextStyle({ bold: true, color: 'green' })\n : (reactData.selectedPeople_list && reactData.selectedPeople_list.includes(this_item.person_id)\n ? AVATextStyle({ bold: true, color: 'orange' })\n : AVATextStyle())\n }\n >\n {`${this_item.first} ${this_item.last}`}\n \n
    \n )\n )}\n
    \n \n }\n
    \n \n {\n onClose(reactData.selections);\n }}\n >\n {options.buttonText || 'Exit'}\n \n \n {\n reactData.showProfileEdit_id &&\n {\n updateReactData({\n showProfileEdit_id: false\n }, true);\n }}\n />\n }\n
    \n );\n};","import React from 'react';\nimport useSession from '../../hooks/useSession';\n\nimport { getImage, getPerson, makeName } from '../../util/AVAPeople';\nimport { extract, dbClient, titleCase, listFromArray, cl, uuid, recordExists, isEmpty } from '../../util/AVAUtilities';\nimport { AVATextStyle } from '../../util/AVAStyles';\nimport { makeDate } from '../../util/AVADateTime';\nimport AVAUploadFile from '../../util/AVAUploadFile';\nimport { Alert, AlertTitle } from '@material-ui/lab/';\nimport PeopleMaintenance from '../dialogs/PeopleMaintenance';\n\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport ExpandLessIcon from '@material-ui/icons/ExpandLess';\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport AttachmentIcon from '@material-ui/icons/Attachment';\nimport ReplyIcon from '@material-ui/icons/Reply';\nimport SettingsIcon from '@material-ui/icons/Settings';\n\nimport QuickSearch from '../sections/QuickSearch';\n\nimport { useIdleTimer } from 'react-idle-timer';\n\nimport Button from '@material-ui/core/Button';\nimport { Snackbar } from '@material-ui/core';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContentText from '@material-ui/core/DialogContentText';\n\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport TextField from '@material-ui/core/TextField';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport SendIcon from '@material-ui/icons/Send';\nimport AVAConfirm from './AVAConfirm';\n\nimport { AVAclasses } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n newMessagePage: {\n paddingTop: '8px',\n paddingBottom: '8px',\n justifyContent: 'center',\n minHeight: 'fit-content',\n flexGrow: 1,\n overflow: 'visible'\n },\n page: {\n height: 'auto',\n overflowX: 'hidden'\n },\n SendButton: {\n marginRight: theme.spacing(1),\n marginTop: theme.spacing(1),\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n AVAButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n freeInput: {\n marginLeft: '25px',\n marginRight: 2,\n marginBottom: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: theme.spacing(1),\n width: '60%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n },\n imageArea: {\n minWidth: '50px',\n maxWidth: '50px',\n minHeight: '50px',\n maxHeight: '50px',\n marginRight: theme.spacing(1),\n borderRadius: '25px'\n },\n myImageArea: {\n minWidth: '70px',\n maxWidth: '70px',\n minHeight: '70px',\n maxHeight: '70px',\n marginRight: theme.spacing(1),\n borderRadius: '35px'\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n buttonArea: {\n maxWidth: 1000,\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n rowButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'contained',\n size: 'small'\n },\n listItem: {\n justifyContent: 'space-between',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(1),\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n makeIconStyle: {\n marginRight: theme.spacing(1),\n },\n locationLine: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n preferenceLine: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n attachmentLine: {\n marginTop: theme.spacing(1),\n fontSize: theme.typography.fontSize * 1.0,\n },\n techInfoLine: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(2),\n },\n techInfoLine2: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(4),\n },\n confirm: {\n backgroundColor: 'green',\n },\n firstName: {\n fontSize: theme.typography.fontSize * 1.4,\n marginRight: theme.spacing(1),\n },\n timeLine: {\n fontSize: theme.typography.fontSize * 1.4,\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1.5),\n },\n lastName: {\n fontWeight: 'bold',\n fontSize: theme.typography.fontSize * 1.8,\n marginRight: theme.spacing(1),\n }\n}));\n\nexport default ({ pPerson, pClient, pMessageList, onReset, defaultValue, options }) => {\n\n const { state } = useSession();\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const placeholderImage =\n 'https://theseus-medical-storage.s3.amazonaws.com/public/patients/tboone.jpg';\n\n\n const [reactData, setReactData] = React.useState({\n administrative_account: (['admin', 'support', 'master'].includes(state.user.account_class)),\n alert: false,\n attachments_to_send: ((options && options.newMessage && options.attachmentList) ? options.attachmentList : []),\n confirmMessage: false,\n confirmessage_index: false,\n deletePending: false,\n expanded_composite_key: false,\n forceReloadTime: 0,\n idleState: false,\n imageTable: {},\n inOut_filter: (options && options.inOut_filter) || false,\n isSmall: (window.window.innerWidth < 800),\n isTiny: (window.window.innerWidth < 500),\n lastActiveTime: new Date(),\n lastReloadTime: 0,\n messageFilter: false,\n messageFilterLower: false,\n messageList: pMessageList,\n myImage: null,\n myName: null,\n newMessageMode: (options && options.newMessage) || false,\n newMessageRecipients: ((options && options.newMessage && options.recipients) ? options.recipients : []),\n newMessageSubject: ((options && options.newMessage && options.subject) ? options.subject : ''),\n newMessageText: ((options && options.newMessage && options.messageText) ? options.messageText : ''),\n newMessageThread: false,\n newMessageVMAlternative: false,\n newMessageVMAltText: '',\n newUrgentMessage: false,\n options,\n preferred_recipients: [],\n replyToList: [],\n selectedPeople_count: 0,\n selectedPeople_list: [],\n selections: [], // wip selections from quick search\n showDeleted: (options && options.showDeleted) || false,\n showGroupList: (options && options.showGroupList ? true : false),\n showIndividualList: false,\n showPreferredList: ((options && options.hasOwnProperty('showPreferredList') && !options.showPreferredList) ? false : true),\n showQuickSearch: (options && options.newMessage && (!options.recipients || (options.recipients.length === 0))) || false,\n singleFilterDigit: false,\n start_time: (options && options.hasOwnProperty('start_time')) ? makeDate(options.start_time).timestamp : false,\n statusFilter: (options && options.statusFilter) || false,\n statusMessage: false,\n sorted_threads: [],\n threadObj: {},\n threads: {},\n // threads is {[]: {last_update: <>, messages: []}}, {[]: {}}...]\n // threads[n].messages is [{message_text: <>, last_update: <>, attachments: [], recipients: []}, {}...]\n // threads[n].messages[m].recipients is [{recipient_id: <>, recipient_name: <>, wasHeld: , methods: []}, {}...] \n // threads[n].messages[m].recipients[o].methods is [{method: <>, sent_time: <>, last_update_time: <>, result: <>}, {}...]\n viewOnly: (options && options.viewOnly) || false,\n viewPeopleMaintenance: false,\n warning: false,\n window_width: window.window.innerWidth,\n });\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n let last_displayed_thread = null;\n let status_filter_result = false;\n\n const onImageError = (e) => {\n e.target.src = placeholderImage;\n };\n\n if (defaultValue) {\n if (Array.isArray(defaultValue)) {\n defaultValue = defaultValue[0];\n }\n }\n\n const [rowLimit, setRowLimit] = React.useState(20);\n const scrollValue = 20;\n\n function makeReadableTime(pJavaDate) {\n let dDate = new Date(Number(pJavaDate));\n return dDate.toLocaleDateString('en-US', {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true\n });\n }\n\n function makeSubject(this_thread, message_number) {\n last_displayed_thread = this_thread;\n let response = reactData.threads[this_thread].messages[message_number].subject || `Conversation originated by ${reactData.threads[this_thread].messages[message_number].author_name}`;\n if (reactData.threads[this_thread].messages[message_number].subject.startsWith('Message from')) {\n response = reactData.threads[this_thread].messages[message_number].subject.replace('Message from', 'Conversation originated by');\n }\n return titleCase(response);\n }\n\n function searchButtonText() {\n if (reactData.selections.length === 0) {\n return 'Exit';\n }\n if (reactData.selections.length > 1) {\n if (!reactData.selectedPeople_count || (reactData.selectedPeople_count === 0)) {\n return `Select ${reactData.selections.reduce((total, this_selection) => {\n return (this_selection.peopleList ? (total + this_selection.peopleList.length) : (total + 1));\n }, 0)} people`;\n }\n else {\n return `Select ${reactData.selectedPeople_count} people`;\n }\n }\n // options below if only one item selected\n if (reactData.selections[0].hasOwnProperty('person_id')) {\n return `Select ${reactData.selections[0].person_name.split(' ')[0]}`;\n }\n else if (reactData.selections[0].hasOwnProperty('personList')) {\n return `Select ${reactData.selections[0].listName}`;\n }\n else if (reactData.selections[0].hasOwnProperty('group_name')) {\n return `Select ${reactData.selections[0].group_name}`;\n }\n else {\n return `Select`;\n }\n }\n\n const handleChangeMessageFilter = event => {\n if (event.target.value.length === 0) {\n updateReactData({\n messageFilter: false,\n messageFilterLower: false,\n singleFilterDigit: false\n }, true);\n }\n else {\n updateReactData({\n messageFilter: event.target.value,\n messageFilterLower: event.target.value.toLowerCase(),\n singleFilterDigit: (event.target.value.length === 1)\n }, true);\n }\n };\n\n const handleRemoveMessage = async ({ thread_id, composite_key }) => {\n let dRec = await dbClient\n .get({\n Key: {\n thread_id: thread_id,\n composite_key: composite_key\n },\n UpdateExpression: 'set delete_flag = :t',\n ExpressionAttributeValues: {\n ':t': true\n },\n TableName: \"TheseusMessages\",\n })\n .promise()\n .catch(error => {\n dRec = null;\n });\n if (!recordExists(dRec)) {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'Not Deleted',\n message: `We couldn't retrieve the message you want to delete`,\n }\n }, true);\n return;\n }\n else {\n let new_deleted_by = (dRec.Item.deleted_by || []);\n new_deleted_by.push(state.session.user_id);\n await dbClient\n .update({\n Key: {\n thread_id: thread_id,\n composite_key: composite_key\n },\n UpdateExpression: 'set delete_flag = :t, deleted_by = :d',\n ExpressionAttributeValues: {\n ':t': true,\n ':d': new_deleted_by\n },\n TableName: \"TheseusMessages\",\n })\n .promise()\n .catch(error => {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'Not Deleted',\n message: `We were unable to delete that message`,\n }\n }, true);\n return;\n });\n }\n delete reactData.threads[thread_id];\n let foundIt = reactData.sorted_threads.findIndex(t => { return t === thread_id; });\n if (foundIt > -1) {\n reactData.sorted_threads.splice(foundIt, 1);\n }\n updateReactData({\n threads: reactData.threads,\n sorted_threads: reactData.sorted_threads,\n expanded_composite_key: false\n }, true);\n };\n\n const onScroll = event => {\n if (rowLimit < reactData.messageList.length) {\n setRowLimit(rowLimit + scrollValue);\n setForceRedisplay(!forceRedisplay);\n }\n };\n\n const oneMinute = 1000 * 60;\n const msBeforeSleeping = 1 * oneMinute;\n\n const onAction = async () => {\n if (reactData.forceReloadTime) {\n let now = new Date().getTime();\n if (reactData.forceReloadTime < now) {\n await initialize();\n }\n }\n if (reactData.idleState) {\n updateReactData({\n idleState: false,\n }, false);\n }\n reset();\n };\n\n const onIdle = async () => {\n let now = new Date();\n let minutesSinceActive = 0;\n if (reactData.forceReloadTime) {\n let now = new Date().getTime();\n if (reactData.forceReloadTime < now) {\n await initialize();\n }\n }\n if (!reactData.idleState) { // if we weren't previously in an idle state and we are now...\n cl(`Went idle at ${now.toLocaleString()}. Idle for ${minutesSinceActive} minutes.`);\n updateReactData({\n idleState: true,\n enteredIdleStateTime: now,\n }, true);\n }\n else { // we are still in an idle state\n minutesSinceActive = Math.floor((now.getTime() - reactData.enteredIdleStateTime.getTime()) / oneMinute);\n if (minutesSinceActive > 2) {\n await initialize();\n }\n else {\n cl(`Still idle at ${now.toLocaleString()}. Idle for ${minutesSinceActive} minutes.`);\n }\n }\n reset();\n };\n\n const { start, reset } = useIdleTimer({\n onIdle,\n onAction,\n timeout: msBeforeSleeping,\n throttle: 500\n });\n\n async function sendMessage() {\n let postTime = new Date().getTime();\n let message_id;\n if (!reactData.newMessageThread) {\n reactData.newMessageThread = `${postTime}.${uuid(6)}`;\n message_id = `${postTime}.${uuid(6)}.0~CuredMessage`;\n }\n else {\n message_id = `${reactData.newMessageThread}.${postTime}~CuredMessage`;\n }\n const reply_to = (reactData.replyToList && (reactData.replyToList.length > 0))\n ? reactData.replyToList.map(r => { return r.person_id; })\n : [];\n let recipient_key = [];\n reactData.newMessageRecipients.forEach(r => {\n if (r.person_id) { recipient_key.push(...([r.person_id].flat())); }\n else if (r.group_id) { recipient_key.push(`GRP:${r.group_id}`); }\n else if (r.rIndex) {\n recipient_key.push(...reactData.preferred_recipients[r.rIndex].personList);\n }\n });\n reply_to.forEach(r => { // this makes sure that everyone on the reply_to list is copied on the original message\n if ((r !== pPerson) && !recipient_key.includes(r)) {\n recipient_key.push(r);\n }\n });\n let PostOfficeRec = {\n Item: {\n thread_id: reactData.newMessageThread,\n message_id,\n allowReplyAll: reactData.allowReplyAll,\n attachments: reactData.attachments_to_send,\n client_id: pClient,\n deliver_time: postTime,\n from: pPerson,\n message_text: reactData.newMessageText,\n patient_id: pPerson,\n preferred_method: (reactData.newUrgentMessage ? 'urgent' : null),\n recipient_base: 'list',\n recipient_key,\n subject: reactData.newMessageSubject || `Message from ${await makeName(pPerson)}`,\n reply_to\n },\n TableName: 'PostOffice'\n };\n if (reactData.newMessageVMAlternative && reactData.newMessageVMAltText && (reactData.newMessageVMAltText.length > 0)) {\n PostOfficeRec.Item.voice_mail = reactData.newMessageVMAltText;\n }\n if (window.location.href.split('//')[1].slice(0, 1).toUpperCase() !== 'D') {\n PostOfficeRec.TableName = 'TestPostOffice';\n }\n let goodPost = true;\n await dbClient\n .put(PostOfficeRec)\n .promise()\n .catch(error => {\n cl(`Error writing to Post Office; error is ${error}`);\n goodPost = false;\n });\n if (goodPost) {\n let nowTime = new Date().getTime();\n reactData.threads[reactData.newMessageThread] = {\n last_update: nowTime,\n delete_flag: false,\n messages: [\n {\n message_text: PostOfficeRec.Item.message_text,\n subject: PostOfficeRec.Item.subject,\n last_update: nowTime,\n attachments: PostOfficeRec.Item.attachments,\n composite_key: `T:${reactData.newMessageThread}~M:001~D:${recipient_key[0]}`,\n inOut: 'out',\n my_id: pPerson,\n sent_time: nowTime,\n author_id: pPerson,\n author_name: await makeName(pPerson),\n author_image: getImage(pPerson),\n reply_to: PostOfficeRec.Item.reply_to,\n allowReplyAll: PostOfficeRec.Item.allowReplyAll,\n status_urgent: reactData.newUrgentMessage,\n status_with_attachment: Boolean(reactData.attachments_to_send && (reactData.attachments_to_send.length > 0)),\n partner_id: PostOfficeRec.recipient_key,\n recipients: reactData.newMessageRecipients.map((r, x) => {\n return {\n recipient_id: r.person_id || r.group_id || reactData.preferred_recipients[r.rIndex].personList[0],\n recipient_name: r.person_name || r.group_name || reactData.preferred_recipients[r.rIndex].objText,\n wasHeld: false,\n status_held: false,\n status_blocked: false,\n status_redirected: false,\n status_with_rules: false,\n status_not_og: false,\n heldUntil: 0,\n methods: {\n 'in Process': {\n last_update_time: nowTime,\n result: 'Recently sent',\n composite_key: `T:${reactData.newMessageThread}~M:001~D:${x}`\n }\n }\n };\n }),\n other_recipients: [] // these are IDs of people who - on an inbound message to me - also received the same message\n }\n ]\n };\n reactData.sorted_threads.unshift(reactData.newMessageThread);\n const recipientMessageText = `${listFromArray(((reactData.newMessageRecipients.length > 0)\n ? reactData.newMessageRecipients\n : reactData.selections)\n .map(r => (r.person_name || r.group_name || reactData.preferred_recipients[r.rIndex].objText)),\n { max: { length: 4, words: 'recipients' } })}`;\n updateReactData({\n newMessageMode: false,\n threads: reactData.threads,\n sorted_threads: reactData.sorted_threads,\n selections: [], // wip selections from quick search\n newMessageSubject: '',\n newMessageRecipients: [],\n newUrgentMessage: false,\n replyToList: [],\n newMessageText: '',\n newMessageThread: false,\n newMessageVMAlternative: false,\n newMessageVMAltText: '',\n attachments_to_send: [],\n forceReloadTime: new Date().getTime() + (1000 * 30),\n alert: {\n severity: 'success',\n title: 'Your Message',\n message: `Your message is on the way to ${recipientMessageText}`\n }\n }, true);\n }\n else {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'Your Message',\n message: `There was a problem sending your message`,\n }\n }, true);\n }\n return;\n }\n\n function handleResize() {\n updateReactData({\n window_width: window.window.innerWidth,\n isSmall: (window.window.innerWidth < 800),\n isTiny: (window.window.innerWidth < 500),\n }, true);\n }\n\n const oneDay = 24 * 60 * 60 * 1000;\n\n async function allMessages({ person_id, start_time, end_time }) {\n if (!start_time) {\n let nowTime = new Date().getTime();\n start_time = nowTime - (7 * oneDay);\n end_time = nowTime + oneDay;\n }\n let queryObj;\n // Get messages to me\n if (!reactData.inOut_filter || (reactData.inOut_filter === 'in')) {\n let inRecs;\n queryObj = {\n KeyConditionExpression: 'deliver_to = :p AND created_time between :s and :e',\n ExpressionAttributeValues: {\n ':p': person_id,\n ':s': start_time.toString(),\n ':e': end_time.toString()\n },\n TableName: \"TheseusMessages\",\n IndexName: 'deliver_to-index',\n ScanIndexForward: false,\n };\n do {\n inRecs = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'No Internet',\n message: `There is no internet connection`,\n }\n }, true);\n }\n else {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'Database problem',\n message: `Error reading inbound Messages: ${error}`,\n }\n }, true);\n }\n });\n if (inRecs && inRecs.LastEvaluatedKey) {\n queryObj.ExclusiveStartKey = inRecs.LastEvaluatedKey;\n }\n else {\n delete queryObj.ExclusiveStartKey;\n }\n if (recordExists(inRecs)) {\n await processDeliveryRecs(inRecs.Items, '', person_id);\n }\n } while (queryObj.ExclusiveStartKey);\n }\n // Get messages from me\n if (!reactData.inOut_filter || (reactData.inOut_filter === 'out')) {\n let outRecs;\n queryObj = {\n KeyConditionExpression: 'sent_from = :p AND created_time between :s and :e',\n FilterExpression: 'record_type = :t',\n ExpressionAttributeValues: {\n ':p': person_id,\n ':s': start_time.toString(),\n ':e': end_time.toString(),\n ':t': 'delivery',\n },\n TableName: \"TheseusMessages\",\n IndexName: 'sent_from-index',\n ScanIndexForward: false,\n };\n do {\n outRecs = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'No Internet',\n message: `There is no internet connection`,\n }\n }, true);\n }\n else {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'Database problem',\n message: `Error reading outbound Messages: ${error}`,\n }\n }, true);\n }\n });\n if (outRecs && outRecs.LastEvaluatedKey) {\n queryObj.ExclusiveStartKey = outRecs.LastEvaluatedKey;\n }\n else {\n delete queryObj.ExclusiveStartKey;\n }\n if (recordExists(outRecs)) {\n await processDeliveryRecs(outRecs.Items, '', person_id);\n }\n } while (queryObj.ExclusiveStartKey);\n }\n }\n\n async function processDeliveryRecs(deliveryRecs, inOut, my_id) {\n let totalProcessed = 0;\n let totalCount = deliveryRecs.length;\n for (let this_deliveryRec of deliveryRecs) {\n totalProcessed++;\n // if (this_deliveryRec.sent_from === this_deliveryRec.deliver_to) { // a message to myself? ignore...\n // continue;\n // }\n inOut = ((this_deliveryRec.sent_from === my_id) ? 'out' : 'in');\n // threads is {[]: {last_update: <>, delete_flag: , messages: []}}, {[]: {}}...]\n // threads[n].messages is [{message_text: <>, last_update: <>, attachments: [], sent_time: <>, author_id: <>, author_name: <>, author_image: <>, inOut: ,recipients: []}, {}...]\n // threads[n].messages[m].recipients is [{recipient_id: <>, recipient_name: <>, wasHeld: , methods: {}}, {}...] \n // YOU ARE HERE -> threads[n].messages[m].recipients[o].methods is {[method]: {last_update_time: <>, result: <>}}, {[method]: {}}...]\n if (!(this_deliveryRec.thread_id in reactData.threads)) { // does this thread exist yet?\n reactData.threads[this_deliveryRec.thread_id] = {\n last_update: this_deliveryRec.created_time || 0,\n delete_flag: false,\n messages: []\n };\n }\n let message_number = -1;\n let message_added = false;\n if (reactData.threads[this_deliveryRec.thread_id].messages.length > 0) {\n message_number = reactData.threads[this_deliveryRec.thread_id].messages.findIndex(this_message => {\n return ((this_message.author_id === this_deliveryRec.author.author_id) && (this_message.message_text === this_deliveryRec.content.current['EN-US'].text));\n });\n };\n if (message_number === -1) {\n // convert inline link to an attachment by extracting all text after (and including http:)\n let hLink = extract(this_deliveryRec.content.current['EN-US'].text, 'http', ' ', {\n fuzzyRight: true, // allow end-of-string as a right delimeter \n includeLeft: true, // return the left delimeter\n });\n if (hLink) {\n if (!this_deliveryRec.content.current.attachments) {\n this_deliveryRec.content.current.attachments = [hLink];\n }\n else {\n this_deliveryRec.content.current.attachments.push(hLink);\n }\n this_deliveryRec.content.current['EN-US'].text = this_deliveryRec.content.current['EN-US'].text.replace(hLink, 'the attachment');\n }\n if (this_deliveryRec.author.author_name === 'AVA notifications') {\n let sRec = await getPerson(this_deliveryRec.author.author_id);\n if (sRec && sRec.name) {\n this_deliveryRec.author.author_name = (`${sRec.name.first} ${sRec.name.last}`).trim();\n }\n }\n if (!reactData.imageTable.hasOwnProperty(this_deliveryRec.author.author_id)) {\n reactData.imageTable[this_deliveryRec.author.author_id] = await getImage(this_deliveryRec.author.author_id);\n }\n reactData.threads[this_deliveryRec.thread_id].messages.push({\n message_text: this_deliveryRec.content.current['EN-US'].text,\n subject: this_deliveryRec.subject_line,\n last_update: 0,\n attachments: this_deliveryRec.content.current.attachments,\n composite_key: this_deliveryRec.composite_key,\n inOut,\n my_id,\n sent_time: this_deliveryRec.created_time,\n author_id: this_deliveryRec.author.author_id,\n author_name: this_deliveryRec.author.author_name,\n author_image: reactData.imageTable[this_deliveryRec.author.author_id],\n reply_to: [],\n allowReplyAll: this_deliveryRec.allowReplyAll || false,\n status_urgent: this_deliveryRec.urgency.startsWith('urg'),\n status_with_attachment: Boolean(this_deliveryRec.content.current.attachments && (this_deliveryRec.content.current.attachments.length > 0)),\n partner_id: [],\n recipients: [],\n other_recipients: [] // these are IDs of people who - on an inbound message to me - also received the same message\n });\n message_added = true;\n message_number = reactData.threads[this_deliveryRec.thread_id].messages.length - 1;\n }\n let recipient_number = -1;\n if (reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients.length > 0) {\n recipient_number = reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients.findIndex(this_recipient => {\n return ((this_recipient.recipient_id === this_deliveryRec.deliver_to));\n });\n };\n if (recipient_number === -1) {\n if (inOut === 'in') {\n reactData.threads[this_deliveryRec.thread_id].messages[message_number].partner_id.push(this_deliveryRec.author.author_id);\n // if it is INBOUND to me, I won't have any information about other recipients (people, other than me, that also received this message)\n // to get that information, we need to look at other inbound messages on the same thread.\n // we want other messages that have the same author and text and thread. We'll get a list of recipient_ids and load them in the partner_id area\n /*\n reactData.threads[this_deliveryRec.thread_id].messages[message_number].other_recipients = await getRecipientList({\n my_id,\n thread_id: this_deliveryRec.thread_id,\n author_id: this_deliveryRec.author.author_id,\n message_text: reactData.threads[this_deliveryRec.thread_id].messages[message_number].message_text\n });\n */\n }\n else {\n reactData.threads[this_deliveryRec.thread_id].messages[message_number].partner_id.push(this_deliveryRec.deliver_to);\n }\n recipient_number = reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients.push({\n recipient_id: this_deliveryRec.deliver_to,\n recipient_name: (`${this_deliveryRec.recipient_list.name.first} ${this_deliveryRec.recipient_list.name.last}`).trim(),\n wasHeld: false,\n status_held: false,\n status_blocked: false,\n status_redirected: false,\n status_with_rules: Boolean(this_deliveryRec.recipient_list && this_deliveryRec.recipient_list.rule_used),\n status_not_og: Boolean(this_deliveryRec.recipient_list && this_deliveryRec.recipient_list.not_original_recipient),\n heldUntil: 0,\n methods: {}\n }) - 1;\n }\n let this_method = standardizeMethod(this_deliveryRec.deliver_method);\n if (this_method === 'held') {\n reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients[recipient_number].wasHeld = true;\n reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients[recipient_number].status_held = true;\n reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients[recipient_number].heldUntil = this_deliveryRec.recipient_list.holdUntil;\n if (this_deliveryRec.recipient_list.hold_reason === 'blocked') {\n reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients[recipient_number].status_blocked = true;\n }\n if (this_deliveryRec.recipient_list.hold_reason === 'replaced') {\n reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients[recipient_number].status_redirected = true;\n }\n }\n let this_result = this_deliveryRec.results[0];\n this_deliveryRec.last_update = Number(this_result.posted_time || this_deliveryRec.created_time);\n if (((this_method !== 'held') && (this_method !== 'AVA'))\n || (Object.keys(reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients[recipient_number].methods).length === 0)) {\n if (reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients[recipient_number].methods) {\n delete reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients[recipient_number].methods['held'];\n delete reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients[recipient_number].methods['AVA'];\n }\n reactData.threads[this_deliveryRec.thread_id].messages[message_number].recipients[recipient_number].methods[this_method] = {\n last_update_time: (this_result.posted_time || this_deliveryRec.created_time).toString(),\n result: this_result.result,\n composite_key: this_deliveryRec.composite_key,\n };\n }\n if (this_deliveryRec.last_update > reactData.threads[this_deliveryRec.thread_id].messages[message_number].last_update) {\n reactData.threads[this_deliveryRec.thread_id].messages[message_number].last_update = this_deliveryRec.last_update;\n if ((this_deliveryRec.last_update > reactData.threads[this_deliveryRec.thread_id].last_update)\n && (!['open', 'delivered', 'delivery'].includes(this_deliveryRec.delivery_status))\n ) {\n reactData.threads[this_deliveryRec.thread_id].last_update = this_deliveryRec.last_update;\n }\n }\n if ((this_deliveryRec.delete_flag) && this_deliveryRec.deleted_by && (this_deliveryRec.deleted_by.includes(state.session.user_id))) {\n reactData.threads[this_deliveryRec.thread_id].delete_flag = true;\n }\n if (!isEmpty(this_deliveryRec.reply_to)) {\n reactData.threads[this_deliveryRec.thread_id].messages[message_number].reply_to = this_deliveryRec.reply_to;\n }\n // re-sort messages in this thread (if necessary)\n if (message_added && (reactData.threads[this_deliveryRec.thread_id].messages.length > 1)) {\n reactData.threads[this_deliveryRec.thread_id].messages.sort((a, b) => {\n return ((a.sent_time > b.sent_time) ? -1 : 1);\n });\n }\n // every 50 records, send info back\n if ((totalProcessed % 50) === 0) {\n let sorted_threads = Object.keys(reactData.threads).sort((a, b) => {\n return ((reactData.threads[a].last_update > reactData.threads[b].last_update) ? -1 : 1);\n });\n updateReactData({\n statusMessage: `Processing inbound - ${totalProcessed} of ${totalCount}`,\n threads: reactData.threads,\n sorted_threads\n }, true);\n }\n }\n if (totalProcessed > 0) {\n let sorted_threads = Object.keys(reactData.threads).sort((a, b) => {\n return ((reactData.threads[a].last_update > reactData.threads[b].last_update) ? -1 : 1);\n });\n updateReactData({\n statusMessage: `Processing inbound - ${totalProcessed} of ${totalCount}`,\n threads: reactData.threads,\n sorted_threads\n }, true);\n }\n }\n\n function makeRecipientLines(this_recipient) {\n let response = [];\n let this_line = `${this_recipient.recipient_name}`;\n if (Object.keys(this_recipient.methods).length > 1) {\n response.push(this_line);\n this_line = '';\n }\n for (let this_method in this_recipient.methods) {\n let result;\n switch (this_recipient.methods[this_method].result) {\n case 'submitted': {\n result = 'Sent';\n break;\n }\n case 'userDisconnect': {\n result = 'Call answered; user disconnected';\n break;\n }\n case 'callComplete': {\n result = 'Call completed';\n break;\n }\n case 'delivered': {\n result = 'Delivery confirmed';\n break;\n }\n case 'open': {\n result = 'Message opened';\n break;\n }\n case 'duplicate': {\n result = `Duplicated another person's address`;\n break;\n }\n default: {\n result = this_recipient.methods[this_method].result;\n }\n }\n this_line += ` ${this_recipient.wasHeld ? 'held, then ' : ''}via ${this_method} - ${result} ${makeDate(this_recipient.methods[this_method].last_update_time).relative}`;\n response.push(this_line);\n this_line = '';\n }\n return response;\n }\n\n function makeMethodLine(this_message) {\n let response = [];\n let wasHeld = false;\n let heldUntil = false;\n for (let this_recipient of this_message.recipients) {\n if (this_recipient.wasHeld) {\n wasHeld = true;\n heldUntil = this_recipient.heldUntil;\n }\n for (let this_method in this_recipient.methods) {\n if ((this_method !== 'hold') && (this_method !== 'AVA') && (!response.includes(this_method))) {\n response.push(this_method);\n }\n }\n }\n if (response.length === 0) {\n if (wasHeld) {\n return `Holding until ${makeDate(heldUntil).relative}`;\n }\n else {\n return 'AVA';\n }\n }\n else {\n return `${wasHeld ? 'Held, then ' : ''}${listFromArray(response)}`;\n }\n }\n\n function makeToLine(this_thread, message_index) {\n let response;\n if (reactData.threads[this_thread].messages[message_index].inOut === 'out') {\n response = `Me -> `;\n if (reactData.threads[this_thread].messages[message_index].recipients.length < 4) {\n response += listFromArray(reactData.threads[this_thread].messages[message_index].recipients.map(r => { return r.recipient_name; }));\n }\n else {\n response += `${reactData.threads[this_thread].messages[message_index].recipients.length} people`;\n }\n }\n else {\n response = `${reactData.threads[this_thread].messages[message_index].author_name} -> `;\n if (reactData.threads[this_thread].messages[message_index].other_recipients.length < 3) {\n response += listFromArray(reactData.threads[this_thread].messages[message_index].other_recipients.concat(['Me']));\n }\n else {\n response += `Me and ${reactData.threads[this_thread].messages[message_index].other_recipients.length} other people`;\n }\n }\n return response;\n }\n\n async function initialize() {\n // my Image\n updateReactData({\n myImage: await getImage(pPerson),\n myName: await makeName(pPerson)\n }, true);\n let nowTime = new Date().getTime();\n let loop_until;\n if (!reactData.start_time) {\n loop_until = nowTime - (30 * oneDay);\n }\n else {\n loop_until = reactData.start_time;\n }\n let this_start = Math.max((nowTime - (2 * oneDay)), loop_until);\n let this_end = nowTime + oneDay;\n do {\n await allMessages({ person_id: pPerson, start_time: this_start, end_time: this_end });\n this_end = this_start;\n this_start -= (7 * oneDay);\n } while (this_start > loop_until);\n await allMessages({ person_id: pPerson, start_time: loop_until, end_time: this_end });\n start(); // idle timer\n updateReactData({\n lastReloadTime: new Date(),\n lastActiveTime: new Date(),\n forceReloadTime: 0,\n idleState: false,\n statusMessage: false\n }, true);\n }\n\n function standardizeMethod(raw_method) {\n if (raw_method === 'email') {\n return 'e-Mail';\n }\n else if (raw_method === 'sms') {\n return 'text';\n }\n else if (raw_method === 'voice') {\n return 'phone';\n }\n else if (raw_method === 'hold') {\n return 'held';\n }\n else {\n return 'AVA';\n }\n }\n\n React.useEffect(() => {\n initialize();\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, [pPerson, pClient]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n function okToShow(this_thread, this_messageIndex) {\n let response = true;\n status_filter_result = false;\n if (reactData.personFilter) {\n response = reactData.threads[this_thread].messages[this_messageIndex].partner_id.includes(reactData.personFilter);\n }\n else if (reactData.messageFilter) {\n response = false;\n if (reactData.singleFilterDigit) {\n response = true;\n }\n else if (reactData.threads[this_thread].messages[this_messageIndex].message_text.toLowerCase().includes(reactData.messageFilterLower)) {\n response = true;\n }\n else if (reactData.threads[this_thread].messages[this_messageIndex].subject.toLowerCase().includes(reactData.messageFilterLower)) {\n response = true;\n }\n else if (reactData.threads[this_thread].messages[this_messageIndex].author_name.toLowerCase().includes(reactData.messageFilterLower)) {\n response = true;\n }\n else if (reactData.threads[this_thread].messages[this_messageIndex].recipients.some(r => {\n return r.recipient_name.inculdes(reactData.messageFilterLower);\n })) {\n response = true;\n }\n }\n else if (reactData.statusFilter) {\n if (reactData.threads[this_thread].messages[this_messageIndex].hasOwnProperty(`status_${reactData.statusFilter}`)) {\n response = reactData.threads[this_thread].messages[this_messageIndex][`status_${reactData.statusFilter}`];\n }\n else {\n response = (reactData.threads[this_thread].messages[this_messageIndex].recipients.some(r => {\n if (r.hasOwnProperty(`status_${reactData.statusFilter}`)) {\n return r[`status_${reactData.statusFilter}`];\n }\n else {\n return false;\n }\n }));\n }\n status_filter_result = response;\n }\n else if (reactData.threads[this_thread].delete_flag) {\n response = reactData.showDeleted;\n }\n return response;\n }\n\n // ******************\n\n return (\n \n {(reactData.threads || reactData.newMessageMode) &&\n \n \n \n \n {`${reactData.myName ? (reactData.myName + \"'\" + (reactData.myName.endsWith('s') ? '' : 's')) : 'My'} Messages`}\n \n \n \n {\n updateReactData({\n viewPeopleMaintenance: true\n }, true);\n }}\n >\n \n \n \n \n {reactData.newMessageMode &&\n \n \n \n \n \n \n \n {\n updateReactData({\n newMessageRecipients: [],\n showQuickSearch: true,\n selections: reactData.newMessageRecipients\n }, true);\n }}\n >\n \n {((reactData.newMessageRecipients.length > 4) || ((reactData.selections.length > 4) && !reactData.showReplyToSearch))\n ? (`Me -> ${reactData.selectedPeople_count || reactData.selections.length} recipients`)\n : ((reactData.newMessageRecipients.length > 0) || ((reactData.selections.length > 0) && !reactData.showReplyToSearch))\n ? `Me -> ${listFromArray(((reactData.newMessageRecipients.length > 0)\n ? reactData.newMessageRecipients\n : reactData.selections)\n .map(r => (r.person_name || r.group_name || reactData.preferred_recipients?.[r.rIndex]?.objText)),\n { max: { length: 4, words: 'recipients' } })}`\n : 'Me ->'\n }\n \n \n {(!(reactData.newMessageRecipients.length === 0) && (!reactData.selections || reactData.showReplyToSearch))\n ? '(Tap here to select Recipients)'\n : `(Tap here to add/change Recipients)`\n }\n \n \n \n {`${makeReadableTime(new Date().getTime())}`}\n \n {\n updateReactData({\n newMessageSubject: event.target.value\n }, true);\n }}\n defaultValue={reactData.newMessageSubject}\n helperText={'Subject'}\n />\n \n {reactData.attachments_to_send && reactData.attachments_to_send.map((aLine, aIndex) => (\n \n \n \n ))}\n \n {\n let reactUpdObj = {\n newMessageText: event.target.value\n };\n if (event.target.value.length > 500) {\n reactUpdObj.warning = true;\n reactUpdObj.alert = {\n severity: 'warning',\n title: 'Message length',\n message:
    Your message is {event.target.value.length.toLocaleString('en-US')} characters long.
    \n Some text messaging networks limit message size to 500 characters.
    \n You may send the message as is. If you choose to do that, we will break the message into {Math.floor(event.target.value.length / 500) + 1} parts and send each part as a separate message for text message recipients.\n (All other recipients will receive the message as entered.)
    ,\n };\n }\n updateReactData(reactUpdObj, true);\n }}\n defaultValue={reactData.newMessageText}\n helperText={'Message Text'}\n />\n {reactData.newMessageVMAlternative &&\n {\n updateReactData({\n newMessageVMAltText: event.target.value\n }, true);\n }}\n defaultValue={reactData.newMessageVMAltText}\n helperText={'Alternative Message to use leaving a Voice Mail'}\n />\n }\n \n \n 0) && (reactData.newMessageRecipients.length > 0))\n ? { marginTop: '24px', backgroundColor: 'green', color: 'white' }\n : { marginTop: '24px', backgroundColor: 'white', color: 'green' }\n }\n size='small'\n disabled={(reactData.newMessageText.length === 0) || (reactData.newMessageRecipients.length === 0)}\n onClick={async () => {\n if (!reactData.warning) {\n await sendMessage();\n await initialize();\n }\n }}\n startIcon={}\n >\n {'Send'}\n \n \n \n {\n updateReactData({\n replyToList: [],\n showReplyToSearch: true,\n selections: reactData.replyToList\n }, true);\n }}\n >\n {((reactData.replyToList.length > 0) || ((reactData.selections.length > 0) && !reactData.showQuickSearch))\n ? `Replies cc'd to: ${listFromArray(((reactData.replyToList.length > 0)\n ? reactData.replyToList\n : reactData.selections).map(r => r.person_name),\n { max: { length: 2, words: 'people' } })}`\n : `Add Reply To`\n }\n \n {\n updateReactData({\n getAttachment: true\n }, true);\n }}\n >\n {'Add Attachment(s)'}\n \n {(reactData.attachments_to_send.length > 0) &&\n {\n updateReactData({\n attachments_to_send: []\n }, true);\n }}\n >\n {`Remove ${(reactData.attachments_to_send.length > 2)\n ? 'all attachments'\n : ((reactData.attachments_to_send.length === 2)\n ? 'both attachments'\n : 'the attachment'\n )}`}\n \n }\n {reactData.administrative_account &&\n {\n updateReactData({\n newUrgentMessage: !reactData.newUrgentMessage\n }, true);\n }}\n >\n {(reactData.newUrgentMessage) ? 'Mark as not urgent' : 'Mark as urgent'}\n \n }\n {reactData.administrative_account &&\n {\n updateReactData({\n newMessageVMAlternative: !reactData.newMessageVMAlternative\n }, true);\n }}\n >\n {(reactData.newMessageVMAlternative) ? 'Remove VM Alt message' : 'Add VM Alt message'}\n \n }\n \n \n
    \n {\n updateReactData({\n newMessageRecipients: [],\n replyToList: [],\n newMessageMode: false\n }, true);\n }}\n />\n
    \n
    \n
    \n
    \n }\n {(Object.keys(reactData.threads).length > 0) &&\n \n {reactData.sorted_threads.map((this_thread, thread_index) => (\n reactData.threads[this_thread].messages.map((this_message, message_index) => (\n (okToShow(this_thread, message_index) &&\n {\n e.preventDefault();\n }}\n >\n \n \n \n \n \n \n {(this_thread !== last_displayed_thread) &&\n {\n updateReactData({\n personFilter: this_message.partner_id[0]\n }, true);\n }}\n >\n \n \n }\n \n \n \n \n {(this_thread !== last_displayed_thread) &&\n \n \n {makeSubject(this_thread, message_index)}\n \n \n }\n \n {makeToLine(this_thread, message_index)}\n \n \n {`${makeReadableTime(this_message.sent_time)} - ${makeMethodLine(this_message)}`}\n \n \n \n \n {this_message.message_text}\n \n \n \n {reactData.expanded_composite_key === this_message.composite_key &&\n \n \n {`Results`}\n \n {(this_message.recipients.sort((a, b) => { return ((a.recipient_name > b.recipient_name) ? 1 : -1); })).map((this_recipient) => (\n (makeRecipientLines(this_recipient)).map((this_line, result_index) => (\n \n {this_line}\n \n ))\n ))}\n \n {`(Message ID ${this_message.composite_key.split('~D')[0]})`}\n \n \n }\n \n \n \n {this_message.attachments &&\n \n {this_message.attachments.map((aLine, aIndex) => (\n \n \n \n ))}\n \n }\n \n {reactData.expanded_composite_key !== this_message.composite_key ?\n {\n updateReactData({\n expanded_composite_key: this_message.composite_key\n }, true);\n }}\n />\n :\n {\n updateReactData({\n expanded_composite_key: false\n }, true);\n }}\n />\n }\n {(message_index === 0) &&\n !reactData.viewOnly &&\n \n {\n let newMessageRecipients = [];\n let replyToList = [];\n for (let this_person of this_message.partner_id) {\n newMessageRecipients.push({ person_id: this_person, person_name: await makeName(this_person) });\n }\n if (this_message.reply_to && (this_message.reply_to.length > 0)) {\n for (const this_recipient of this_message.reply_to) {\n replyToList.push({ person_id: this_recipient, person_name: await makeName(this_recipient) });\n }\n }\n updateReactData({\n newMessageRecipients,\n replyToList,\n newMessageThread: this_message.thread_id || this_message.composite_key.split('~')[0].replace('T:', ''),\n newMessageSubject: this_message.subject,\n newMessageMode: true\n }, true);\n }}\n />\n {\n updateReactData({\n deletePending: {\n composite_key: this_message.composite_key,\n thread_id: this_thread\n },\n confirmMessage: `Delete this message?`\n }, true);\n }}\n />\n \n }\n \n \n \n \n \n )\n ))\n ))}\n \n }\n {(Object.keys(reactData.threads).length === 0) &&\n \n \n {(reactData.lastReloadTime === 0) ? `Loading! Please wait...` : `You don't have any message activity yet!`}\n \n \n }\n {reactData.deletePending &&\n {\n updateReactData({\n deletePending: false\n }, true);\n }}\n onConfirm={() => {\n handleRemoveMessage(reactData.deletePending);\n updateReactData({\n deletePending: false\n }, true);\n }}\n >\n \n }\n {reactData.getAttachment &&\n {\n updateReactData({\n getAttachment: false\n }, true);\n }}\n onLoad={async (response) => {\n updateReactData({\n attachments_to_send: response.map(f => { return f.fLoc; }),\n getAttachment: false\n }, true);\n }}\n />\n }\n {reactData.showQuickSearch &&\n {\n updateReactData({\n showQuickSearch: false,\n newMessageRecipients: selections || [],\n selections: []\n }, true);\n }}\n />\n }\n {reactData.showReplyToSearch &&\n {\n updateReactData({\n showReplyToSearch: false,\n replyToList: selections,\n selections: []\n }, true);\n }}\n />\n }\n {reactData.viewPeopleMaintenance &&\n {\n updateReactData({\n viewPeopleMaintenance: false\n }, true);\n }}\n />\n }\n { // Command Area\n \n \n \n }\n >\n {'Close'}\n \n {!reactData.viewOnly &&\n {\n let reactUpd = {\n showQuickSearch: true,\n newMessageMode: true,\n newMessageSubject: '',\n newMessageText: '',\n newUrgentMessage: false,\n newMessageRecipients: [],\n replyToList: [],\n newMessageThread: false,\n };\n if (reactData.personFilter) {\n reactUpd.newMessageRecipients = [{\n person_id: reactData.personFilter,\n person_name: await makeName(reactData.personFilter)\n }];\n reactUpd.showQuickSearch = false;\n }\n updateReactData(reactUpd, true);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n startIcon={}\n >\n {`New Message`}\n \n }\n {reactData.personFilter &&\n {\n updateReactData({\n personFilter: false\n }, true);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'blue', color: 'white' }}\n size='small'\n >\n {`Show all`}\n \n }\n \n {reactData.statusMessage &&\n \n {reactData.statusMessage}\n \n }\n \n \n }\n {reactData.alert &&\n {\n updateReactData({\n alert: false\n }, true);\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center'\n }}\n >\n \n {([reactData.alert.action].flat()).map((this_action, actionNdx) => (\n this_action.function()}\n >\n {this_action.text}\n \n ))}\n \n : null\n )}\n variant='filled'\n onClose={() => {\n updateReactData({\n alert: false\n }, true);\n }}\n >\n {reactData.alert.title && {reactData.alert.title}}\n {reactData.alert.message}\n \n \n }\n
    \n }\n \n );\n};","import React from 'react';\n\nimport useSession from '../../hooks/useSession';\n\nimport { getMemberList } from '../../util/AVAGroups';\nimport { dbClient } from '../../util/AVAUtilities';\nimport QuickSearch from '../sections/QuickSearch';\nimport { getPerson } from '../../util/AVAPeople';\n\nimport { Snackbar, Paper, TextField, Box, Dialog, DialogActions, Button, Typography, Switch, Slider } from '@material-ui/core';\nimport { Alert, AlertTitle } from '@material-ui/lab/';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport CloseIcon from '@material-ui/icons/ExitToApp';\nimport PeopleIcon from '@material-ui/icons/People';\nimport SendIcon from '@material-ui/icons/Send';\n\nimport { AVAclasses, AVATextStyle, AVADefaults } from '../../util/AVAStyles';\nimport MessageForm from './MessageForm';\n\nimport { useIdleTimer } from 'react-idle-timer';\n\nconst useStyles = makeStyles(theme => ({\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n myImageArea: {\n minWidth: '50px',\n maxWidth: '50px',\n minHeight: '50px',\n maxHeight: '50px',\n marginTop: '16px',\n marginRight: theme.spacing(1),\n borderRadius: '25px'\n },\n peopleBox: {\n paddingTop: 0,\n paddingBottom: theme.spacing(2),\n overflowX: 'auto',\n scrollbarWidth: 'thin',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n display: 'flex',\n width: '100%',\n flexDirection: 'column'\n },\n peopleBoxWithSpace: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(2),\n overflowX: 'auto',\n scrollbarWidth: 'thin',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n display: 'flex',\n width: '100%',\n flexDirection: 'row'\n },\n paperPallette: {\n borderRadius: '30px 30px 30px 30px',\n width: '95%',\n height: '100%',\n overflow: 'hidden'\n },\n dragNamesFirst: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: '3px',\n marginBottom: '-10px'\n },\n dragNamesLast: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: '3px',\n fontWeight: 'bold',\n marginBottom: '-10px'\n },\n assignment_avatar: {\n marginTop: 0,\n marginBottom: 0,\n height: 40,\n width: 40,\n paddingTop: 0,\n fontSize: '1.2rem',\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n listItemAVA: {\n fontSize: theme.typography.fontSize * 1.5,\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n}));\n\nexport default ({ defaults, onCancel }) => {\n\n const { state } = useSession();\n\n const [activity_filter, setActivityFilter] = React.useState('');\n const [lower_activity_filter, setLowerFilter] = React.useState('');\n\n const [reactData, setReactData] = React.useState({\n alert: false,\n window_width: 1,\n administrative_account: (['admin', 'support', 'master'].includes(state.user.account_class)),\n\n anchorEl: null,\n building: 'not started',\n columnSort: 'sent',\n daysToMonitor: 1,\n defaults,\n denseView: false,\n display_name: state.patient?.name?.first || 'My',\n event_being_edited: false,\n filterTextLower: null,\n focusAt: (defaults.focusAt || 0),\n forceReloadTime: 0,\n groupID: (defaults.group_id || '*all'),\n groupName: '',\n groupRec: {},\n groupsManagedObject: prepareGroupObject([defaults.group_id || '*all'].flat()),\n groupMemberList: [],\n isDarkMode: useMediaQuery('(prefers-color-scheme: dark)'),\n loading: false,\n needRef: false,\n newGroups: {},\n popUpOpen: false,\n progressMessage: 'Building Group List',\n pWidth: 60,\n received_mode: false,\n rowLimit: 50,\n selectDate: null,\n selectedPerson_id: null,\n selectedPersonRec: false,\n selectedPersonFirstName: '',\n selectedPersonLastName: '',\n showList: (defaults.show_group || 'select'),\n showGroupSelect: false,\n showQuickSearch: false,\n selectedGroup_id: null,\n selectedGroupRec: false,\n selectedGroupMembers: false,\n timeLastFetched: 0,\n timeWindowStart: new Date().getTime() - (24 * 60 * 60 * 1000), // 24-hours ago\n updatesMade: false,\n viewPeopleMaintenance: false\n });\n const [refreshTrigger, setRefreshTrigger] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setRefreshTrigger(refreshTrigger => !refreshTrigger); }\n };\n\n const sliderMarks = [\n {\n value: 1,\n label: '',\n },\n {\n value: 2,\n label: '2',\n },\n {\n value: 3,\n label: '3',\n },\n {\n value: 4,\n label: '4',\n },\n {\n value: 5,\n label: '5',\n },\n {\n value: 6,\n label: '6',\n },\n {\n value: 7,\n label: '',\n },\n ];\n\n\n function handleResize() {\n updateReactData({\n window_width: Math.min(((window.window.innerWidth - 220) / 1400), 1),\n }, true);\n }\n\n function calcMinimumGroupLevel() {\n let response = 99;\n Object.keys(reactData.groupsManagedObject).forEach((listEntry) => {\n if (reactData.groupsManagedObject[listEntry].level && (reactData.groupsManagedObject[listEntry].level < response)) {\n response = reactData.groupsManagedObject[listEntry].level;\n }\n });\n return response;\n }\n const [minimumGroupLevel,] = React.useState(calcMinimumGroupLevel() - 1);\n\n const oneMinute = 1000 * 60;\n const msBeforeSleeping = 1 * oneMinute;\n\n const onAction = async () => {\n if (reactData.forceReloadTime) {\n let now = new Date().getTime();\n if (reactData.forceReloadTime < now) {\n const timeLastFetched = new Date().getTime();\n let groupMembersUpdated = await messageFetch({\n response: reactData.selectedGroupMembers,\n startTime: reactData.timeLastFetched,\n });\n updateReactData({\n selectedGroupMembers: groupMembersUpdated,\n forceReloadTime: new Date().getTime() + (1000 * 300),\n timeLastFetched,\n }, true);\n }\n }\n if (reactData.idleState) {\n updateReactData({\n idleState: false,\n }, false);\n }\n reset();\n };\n\n const onIdle = async () => {\n let now = new Date();\n let minutesSinceActive = 0;\n if (reactData.forceReloadTime) {\n let now = new Date().getTime();\n if (reactData.forceReloadTime < now) {\n const timeLastFetched = new Date().getTime();\n let groupMembersUpdated = await messageFetch({\n response: reactData.selectedGroupMembers,\n startTime: reactData.timeLastFetched,\n });\n updateReactData({\n selectedGroupMembers: groupMembersUpdated,\n forceReloadTime: new Date().getTime() + (1000 * 300),\n timeLastFetched,\n }, true);\n }\n }\n if (!reactData.idleState) { // if we weren't previously in an idle state and we are now...\n updateReactData({\n idleState: true,\n enteredIdleStateTime: now,\n }, true);\n }\n else { // we are still in an idle state\n minutesSinceActive = Math.floor((now.getTime() - reactData.enteredIdleStateTime.getTime()) / oneMinute);\n if (minutesSinceActive > 1) {\n const timeLastFetched = new Date().getTime();\n let groupMembersUpdated = await messageFetch({\n response: reactData.selectedGroupMembers,\n startTime: reactData.timeLastFetched,\n });\n updateReactData({\n selectedGroupMembers: groupMembersUpdated,\n forceReloadTime: new Date().getTime() + (1000 * 300),\n timeLastFetched,\n }, true);\n }\n else {\n }\n }\n reset();\n };\n\n const { start, reset } = useIdleTimer({\n onIdle,\n onAction,\n timeout: msBeforeSleeping,\n throttle: 500\n });\n\n function prepareGroupObject(pGroupList) {\n let selectAll = pGroupList.includes('*all');\n let selectOpen = pGroupList.includes('*all_open') || pGroupList.includes('*all_public');\n let selectPrivate = pGroupList.includes('*all_closed') || pGroupList.includes('*all_private');\n const selectMine = !pGroupList || (pGroupList.length === 0) || (pGroupList.includes('*user'));\n let response = {};\n for (let g of state.groups.adminHierarchy) {\n if ((g.level > 0)\n && (selectAll\n || selectMine\n || pGroupList.includes(g.id)\n || pGroupList.includes(g.belongs_to)\n || pGroupList.includes('*responsible'))\n ) {\n response[g.id] = {\n group_name: g.name,\n group_type: 'admin',\n group_id: g.id,\n level: g.level\n };\n if (!pGroupList.includes(g.id)) {\n pGroupList.push(g.id);\n }\n }\n };\n for (let gID in state.groups.publicGroups) {\n if (selectAll || pGroupList.includes(gID) || selectOpen) {\n response[gID] = {\n group_name: state.groups.publicGroups[gID].group_name,\n group_id: gID,\n group_type: 'public',\n level: 0\n };\n }\n };\n for (let gID in state.groups.privateGroups) {\n if (selectAll || pGroupList.includes(gID) || selectPrivate) {\n response[gID] = {\n group_name: state.groups.privateGroups[gID].group_name,\n group_id: gID,\n group_type: 'private',\n level: 0\n };\n }\n };\n return response;\n };\n\n // const autoFocus = (element) => element?.focus();\n\n var rowsDisplayed;\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n const handleChangeActivityFilter = event => {\n setActivityFilter(event.target.value);\n setLowerFilter(event.target.value.toLowerCase());\n };\n\n function OKtoShow(inObj) {\n if (!lower_activity_filter) { return true; }\n if (inObj.hasOwnProperty('group_name')) {\n if (inObj.group_name.toLowerCase().includes(lower_activity_filter)) {\n return true;\n }\n }\n return (inObj.group_id.toLowerCase().includes(lower_activity_filter));\n };\n\n async function resetTimeWindow(daysToMonitor) {\n for (const this_member in reactData.selectedGroupMembers) {\n reactData.selectedGroupMembers[this_member].messageData = {\n sent: {\n count: 0,\n urgent: 0,\n held: 0,\n blocked: 0, // hold_reason === 'blocked'\n redirected: 0, // hold_reason === 'replaced'\n bounced: 0,\n with_attachment: 0,\n with_rules: 0\n },\n received: {\n count: 0,\n urgent: 0,\n held: 0,\n blocked: 0, // hold_reason === 'blocked'\n redirected: 0, // hold_reason === 'replaced'\n bounced: 0,\n with_attachment: 0,\n with_rules: 0,\n not_og: 0 // you were not an original receipient (recipient_list.not_original_recipient is true)\n },\n };\n }\n const start_time = new Date().getTime() - (daysToMonitor * 24 * 60 * 60 * 1000);\n let updatedSelections = await messageFetch({\n response: reactData.selectedGroupMembers,\n startTime: start_time,\n });\n updateReactData({\n daysToMonitor: daysToMonitor,\n timeWindowStart: start_time,\n forceReloadTime: new Date().getTime() + (1000 * 300),\n selectedGroupMembers: updatedSelections\n }, true);\n return;\n }\n\n async function selectMembers(this_group) {\n let response = {};\n let memberList = await getMemberList(this_group, state.session.client_id, { \"exclude\": false });\n for (const this_member of memberList.peopleList) {\n response[this_member.person_id] = this_member;\n response[this_member.person_id].messageData = {\n sent: {\n count: 0,\n urgent: 0,\n held: 0,\n blocked: 0, // hold_reason === 'blocked'\n redirected: 0, // hold_reason === 'replaced'\n bounced: 0,\n with_attachment: 0,\n with_rules: 0\n },\n received: {\n count: 0,\n urgent: 0,\n held: 0,\n blocked: 0, // hold_reason === 'blocked'\n redirected: 0, // hold_reason === 'replaced'\n bounced: 0,\n with_attachment: 0,\n with_rules: 0,\n not_og: 0 // you were not an original receipient (recipient_list.not_original_recipient is true)\n },\n };\n }\n await messageFetch({\n response,\n startTime: reactData.timeWindowStart,\n });\n return response;\n }\n\n async function messageFetch({ response, startTime }) {\n let queryObj = {\n KeyConditionExpression: 'record_type = :t and created_time > :s',\n ExpressionAttributeValues: {\n ':t': 'delivery',\n ':s': `${startTime}`\n },\n TableName: \"TheseusMessages\",\n IndexName: 'record_type-created_time-index',\n ScanIndexForward: false,\n };\n do {\n let mRecs = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'No network',\n message: `There is no internet connection.`\n }\n }, true);\n }\n console.log({ 'Error reading Messages': error });\n });\n if (mRecs.LastEvaluatedKey) {\n queryObj.ExclusiveStartKey = mRecs.LastEvaluatedKey;\n }\n else {\n delete queryObj.ExclusiveStartKey;\n }\n if (mRecs && mRecs.hasOwnProperty('Items')) {\n for (const this_message of mRecs.Items) {\n let isUrgent = (this_message.urgency.startsWith('urg') ? 1 : 0);\n let isAttachment = ((this_message.content?.current?.attachments && (this_message.content.current.attachments.length > 0)) ? 1 : 0);\n let ruleUsed = this_message.recipient_list?.rule_used ? 1 : 0;\n let blocked = 0;\n let redirected = 0;\n let held = 0;\n if (this_message.delivery_status === 'held') {\n held = 1;\n blocked = ((this_message.recipient_list.hold_reason === 'blocked') ? 1 : 0);\n redirected = ((this_message.recipient_list.hold_reason === 'replaced') ? 1 : 0);\n }\n if (response.hasOwnProperty(this_message.author?.author_id)) {\n let sender = this_message.author?.author_id;\n response[sender].messageData.sent.count++;\n response[sender].messageData.sent.urgent += isUrgent;\n response[sender].messageData.sent.with_attachment += isAttachment;\n response[sender].messageData.sent.with_rules += ruleUsed;\n response[sender].messageData.sent.held += held;\n response[sender].messageData.sent.blocked += blocked;\n response[sender].messageData.sent.redirected += redirected;\n if (ruleUsed) {\n objRefIncrement(response[sender].messageData.sent.rule_list, this_message.recipient_list.rule_used);\n }\n }\n if (response.hasOwnProperty(this_message.deliver_to)) {\n let recipient = this_message.deliver_to;\n response[recipient].messageData.received.count++;\n response[recipient].messageData.received.urgent += isUrgent;\n response[recipient].messageData.received.with_attachment += isAttachment;\n response[recipient].messageData.received.with_rules += ruleUsed;\n response[recipient].messageData.received.held += held;\n response[recipient].messageData.received.blocked += blocked;\n response[recipient].messageData.received.redirected += redirected;\n if (ruleUsed) {\n objRefIncrement(response[recipient].messageData.received.rule_list, this_message.recipient_list.rule_used);\n }\n if (this_message.recipient_list.not_original_recipient) {\n response[recipient].messageData.received.not_og++;\n };\n }\n }\n }\n } while (queryObj.ExclusiveStartKey);\n return response;\n };\n\n function objRefIncrement(obj, key) {\n if (!obj) { obj = { key: 1 }; }\n else if (!(key in obj)) { obj[key] = 1; }\n else { return obj[key] + 1; }\n }\n\n async function initialize() {\n }\n\n React.useEffect(() => {\n initialize();\n window.addEventListener('resize', handleResize);\n start(); // idle timer\n updateReactData({\n lastReloadTime: new Date(),\n lastActiveTime: new Date(),\n forceReloadTime: 0,\n idleState: false,\n statusMessage: false,\n showGroupSelect: true,\n building: 'done'\n }, true);\n return () => window.removeEventListener('resize', handleResize);\n }, [defaults]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n // **************************\n\n return (\n \n {(reactData.building === 'done')\n &&\n \n \n \n \n {'Select a group from this list'}\n \n \n \n {\n updateReactData({ showQuickSearch: true }, true);\n }}\n />\n \n\n \n\n {/* LEFT SIDE */}\n \n \n {`${state.session.client_name} Groups`}\n \n \n \n {Object.keys(reactData.groupsManagedObject).map((listEntry, listIndex) => (\n (OKtoShow(reactData.groupsManagedObject[listEntry]) &&\n \n {\n const timeLastFetched = new Date().getTime(); // want to set this before getting into select members to accomodate latendy in that process\n updateReactData({\n selectedGroup_id: listEntry,\n selectedGroupRec: reactData.groupsManagedObject[listEntry],\n selectedGroupMembers: await selectMembers(listEntry),\n forceReloadTime: new Date().getTime() + (1000 * 300),\n timeLastFetched,\n selectedPerson_id: false,\n selectedPersonRec: false,\n selectedPersonFirstName: false,\n selectedPersonLastName: false,\n }, true);\n }}\n onContextMenu={async (e) => {\n e.preventDefault();\n updateReactData({\n alert: {\n severity: 'info',\n title: reactData.groupsManagedObject[listEntry].group_name,\n message:
    \n Group ID: {listEntry}
    \n }\n }, true);\n }}\n >\n \n {reactData.groupsManagedObject[listEntry].group_name}\n \n
    \n
    \n )\n ))}\n \n \n \n \n\n {/* RIGHT SIDE */}\n {reactData.selectedGroupRec &&\n \n \n \n {`${reactData.selectedGroupRec.group_name} Members`}\n \n \n \n {'Sent'}\n \n {\n updateReactData({\n received_mode: !reactData.received_mode\n }, true);\n }}\n name=\"Mode\"\n color=\"primary\"\n />\n \n {`Rec'd`}\n \n \n \n \n \n \n \n \n {``}\n \n \n {(['#', 'Urg', 'Hld', 'Blk', 'Chg', 'Att', 'Rul'].concat(reactData.received_mode ? ['xOG'] : [])).map((this_key, kX) =>\n \n {this_key}\n \n )}\n\n \n {reactData.selectedGroupMembers && Object.keys(reactData.selectedGroupMembers).sort((a, b) => {\n if (!reactData.received_mode) {\n return (reactData.selectedGroupMembers[a].messageData.sent.count < reactData.selectedGroupMembers[b].messageData.sent.count) ? 1 : -1;\n }\n else {\n return (reactData.selectedGroupMembers[a].messageData.received.count < reactData.selectedGroupMembers[b].messageData.received.count) ? 1 : -1;\n }\n }).map((this_person, cX) => (\n \n \n {\n updateReactData({\n personMessages: this_person\n }, true);\n }}\n >\n {`${reactData.selectedGroupMembers[this_person].name.first} ${reactData.selectedGroupMembers[this_person].name.last}`}\n \n \n {(['count', 'urgent', 'held', 'blocked', 'redirected', 'with_attachment', 'with_rules'].concat(reactData.received_mode ? ['not_og'] : [])).map((this_key, kX) =>\n {\n updateReactData({\n personMessages: this_person,\n personMessages_inOutFilter: ((this_key === 'count') ? (reactData.received_mode ? 'in' : 'out') : false),\n personMessages_statusFilter: ((this_key === 'count') ? false : this_key)\n }, true);\n }}\n style={AVATextStyle({\n overflow: 'visible',\n align: 'center',\n size: 1,\n width: '35px',\n opacity: (((reactData.received_mode && reactData.selectedGroupMembers[this_person].messageData.received[this_key] === 0)\n || (!reactData.received_mode && reactData.selectedGroupMembers[this_person].messageData.sent[this_key] === 0)\n ) ? '30%' : ''),\n margin: { left: 0.2, right: 0.2, top: 0, bottom: 0.8 },\n })}\n >\n {reactData.received_mode\n ? `${reactData.selectedGroupMembers[this_person].messageData.received[this_key]}`\n : `${reactData.selectedGroupMembers[this_person].messageData.sent[this_key]}`\n }\n \n )}\n \n ))}\n \n \n \n \n {`Days to Monitor`}\n \n \n \n {`1`}\n \n {\n await resetTimeWindow(newValue);\n }}\n aria-labelledby=\"continuous-slider\"\n marks={sliderMarks}\n step={1}\n min={1}\n max={7}\n />\n \n {`7`}\n \n \n \n \n }\n \n\n \n }\n {reactData.showQuickSearch &&\n {\n if (selections && (selections.length > 0)) {\n updateReactData({\n showQuickSearch: false,\n selectedGroup_id: false,\n selectedGroupRec: false,\n seletedGroupMembers: false,\n selectedPerson_id: selections[0].person_id,\n selectedPersonRec: await getPerson(selections[0].person_id,),\n selectedPersonFirstName: selections[0].person_firstName,\n selectedPersonLastName: selections[0].person_lastName,\n }, true);\n }\n else {\n updateReactData({\n showQuickSearch: false,\n }, true);\n }\n }}\n />\n }\n {reactData.personMessages &&\n {\n updateReactData({\n personMessages: false,\n personMessages_inOutFilter: false,\n personMessages_statusFilter: false\n }, true);\n }}\n options={{\n viewOnly: true,\n start_time: reactData.timeWindowStart,\n inOut_filter: reactData.personMessages_inOutFilter,\n statusFilter: reactData.personMessages_statusFilter\n }}\n />\n }\n {(rowsDisplayed === 0) &&\n \n \n {!lower_activity_filter ? 'This Group has no members' : 'No members match that filter'}\n \n \n }\n \n {(reactData.building === 'done') &&\n }\n onClick={() => {\n onCancel();\n }}\n >\n {'Done'}\n \n }\n \n {reactData.alert &&\n {\n updateReactData({\n alert: false\n }, true);\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center'\n }}\n >\n \n {([reactData.alert.action].flat()).map((this_action, actionNdx) => (\n this_action.function()}\n >\n {this_action.text}\n \n ))}\n \n : null\n )}\n variant='filled'\n onClose={() => {\n updateReactData({\n alert: false\n }, true);\n }}\n >\n {reactData.alert.title && {reactData.alert.title}}\n {reactData.alert.message}\n \n \n }\n \n );\n};\n","import React from 'react';\nimport { useSnackbar } from 'notistack';\nimport { getImage, getPerson, makeName } from '../../util/AVAPeople';\nimport { messageHistory, getMessages } from '../../util/AVAMessages';\nimport { extract, dbClient, lambda, isObject } from '../../util/AVAUtilities';\nimport { AVATextStyle } from '../../util/AVAStyles';\n\nimport List from '@material-ui/core/List';\n\nimport Collapse from '@material-ui/core/Collapse';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport ExpandLessIcon from '@material-ui/icons/ExpandLess';\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport { Switch } from '@material-ui/core';\n\nimport MarkunreadMailboxOutlinedIcon from '@material-ui/icons/MarkunreadMailboxOutlined';\nimport ContactMailOutlinedIcon from '@material-ui/icons/ContactMailOutlined';\n\nimport MakeMessage from './MakeMessage';\n\nimport Button from '@material-ui/core/Button';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContentText from '@material-ui/core/DialogContentText';\n\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport TextField from '@material-ui/core/TextField';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport SendIcon from '@material-ui/icons/Send';\nimport AVAConfirm from './AVAConfirm';\nimport SendMessageDialog from '../dialogs/SendMessageDialog';\n\nimport { AVAclasses } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n page: {\n height: 950,\n maxWidth: 1000\n },\n AVAButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n freeInput: {\n marginLeft: '25px',\n marginRight: 2,\n marginBottom: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: theme.spacing(1),\n width: '60%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n },\n imageArea: {\n minWidth: '100px',\n maxWidth: '100px',\n minHeight: '100px',\n maxHeight: '100px',\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n buttonArea: {\n maxWidth: 1000,\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n rowButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'contained',\n size: 'small'\n },\n listItem: {\n justifyContent: 'space-between',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(1),\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n makeIconStyle: {\n marginRight: theme.spacing(1),\n },\n locationLine: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n preferenceLine: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n attachmentLine: {\n marginTop: theme.spacing(1),\n fontSize: theme.typography.fontSize * 1.0,\n },\n techInfoLine: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(2),\n },\n techInfoLine2: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(4),\n },\n confirm: {\n backgroundColor: 'green',\n },\n firstName: {\n fontSize: theme.typography.fontSize * 1.4,\n marginRight: theme.spacing(1),\n },\n timeLine: {\n fontSize: theme.typography.fontSize * 1.4,\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1.5),\n },\n lastName: {\n fontWeight: 'bold',\n fontSize: theme.typography.fontSize * 1.8,\n marginRight: theme.spacing(1),\n }\n}));\n\nexport default ({ pPerson, pClient, pMessageList, pSession, onReset, defaultValue }) => {\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const [message_filter, setMessageFilter] = React.useState('');\n const [message_filter_lower, setMessageFilterLower] = React.useState('');\n const [singleFilterDigit, setSingleFilterDigit] = React.useState(false);\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n\n const [messageList, setMessageList] = React.useState(pMessageList);\n\n const [showAddPrompt, setShowAddPrompt] = React.useState(false);\n const [messageResults, setMessageResults] = React.useState();\n const [deletePending, setDeletePending] = React.useState(false);\n // const [showDeleted, setShowDeleted] = React.useState(false);\n const showDeleted = false;\n const [confirmMessage, setConfirmMessage] = React.useState('');\n const [confirmID, setConfirmID] = React.useState('');\n const [confirmIndex, setConfirmIndex] = React.useState('');\n const [promptForMessage, setPromptForMessage] = React.useState('');\n const [recipient, setRecipient] = React.useState();\n const [recipientIndex, setRecipientIndex] = React.useState(-1);\n const [open, setOpen] = React.useState([]);\n\n let setDefault = 'in';\n if (defaultValue) {\n if (Array.isArray(defaultValue)) {\n defaultValue = defaultValue[0];\n }\n if (['sent', 'out'].includes(defaultValue)) { setDefault = 'out'; }\n }\n const [inOut_mode, setinOut] = React.useState(setDefault);\n\n const [rowLimit, setRowLimit] = React.useState(20);\n const scrollValue = 20;\n var rowsWritten;\n\n const { enqueueSnackbar } = useSnackbar();\n\n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:GroupMemberMaintenance',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: ''\n };\n\n function makeReadableTime(pJavaDate) {\n let dDate = new Date(Number(pJavaDate));\n return dDate.toLocaleDateString('en-US', {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true\n });\n }\n\n function makeSubject(pContent) {\n if (pContent) {\n return pContent.slice(0, 1).toUpperCase() + pContent.slice(1);\n /*\n let lContent = pContent.toLowerCase().trim().split(/[^a-zA-Z0-9 ']+/);\n return (lContent[0] || lContent[1]).split(/[ ]+/g).map(w => { return (w.charAt(0).toUpperCase() + w.substring(1)); }).join(' ');\n */\n }\n else { return 'AVA Message'; }\n }\n\n async function replyAllList(pThreadID) {\n let threadHeaderRec = await getMessages({\n thread_id: pThreadID,\n type: 'message'\n });\n if (!threadHeaderRec || (threadHeaderRec.length === 0)) { return []; }\n let responseList = [];\n Object.values(threadHeaderRec[0].recipient_list).forEach(r => {\n let resp;\n if (r.name) { resp = (r.name.first + ' ' + r.name.last).trim(); }\n else { resp = r.destination; }\n resp += ':' + r.id;\n responseList.push(resp);\n });\n return responseList;\n }\n\n const handleChangeMessageFilter = event => {\n if (event.target.value.length === 0) {\n setMessageFilter(null);\n setMessageFilterLower(null);\n }\n else {\n setMessageFilter(event.target.value);\n setMessageFilterLower(event.target.value.toLowerCase());\n setSingleFilterDigit(event.target.value.length === 1);\n }\n setRowLimit(scrollValue);\n };\n\n const handleRemoveMessage = async (pMessage_id, pIndex) => {\n await dbClient\n .update({\n Key: {\n thread_id: pMessage_id.split('~')[0].slice(2),\n composite_key: pMessage_id\n },\n UpdateExpression: 'set delete_flag = :t',\n ExpressionAttributeValues: {\n ':t': true\n },\n TableName: \"TheseusMessages\",\n })\n .promise()\n .catch(error => {\n enqueueSnackbar(`AVA couldn't delete that message. Error is ${error}`,\n { variant: 'error', persist: true }\n );\n return;\n });\n let tempMessageList = messageList;\n tempMessageList.splice(pIndex, 1);\n setMessageList(tempMessageList);\n let workingOpen = open;\n workingOpen.splice(pIndex, 1);\n setOpen(workingOpen);\n setForceRedisplay(!forceRedisplay);\n return tempMessageList;\n };\n\n async function getMessageResults(pCommonKey) {\n let requestBody = {\n thread_id: pCommonKey.split('~')[0].slice(2),\n composite_key: pCommonKey,\n record_type: 'delivery'\n };\n let returnArray = await messageHistory(requestBody);\n /*\n let mRecs = await dbClient\n .query({\n KeyConditionExpression: 'thread_id = :k AND begins_with(composite_key, :c)',\n FilterExpression: 'record_type = :t',\n ExpressionAttributeValues: {\n ':c': pCommonKey,\n ':k': pCommonKey.split('~')[0].slice(2),\n ':t': 'delivery'\n },\n TableName: \"TheseusMessages\",\n ScanIndexForward: false,\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n enqueueSnackbar(`There is no internet connection.`, { variant: 'error', persist: true });\n }\n console.log({ 'Error reading Messages': error });\n });\n if (mRecs && mRecs.hasOwnProperty('Items')) {\n // let timeZones = ['UTC', 'UTC-1', 'UTC-2', 'UTC-3', 'America/New_York', 'America/New_York', 'America/Chicago'];\n // let timeZone = timeZones[-1 * (authorRec?.time_offset || -5)] || 'America/New_York';\n let timeZone = 'America/New_York';\n const oneMinute = 1000 * 60;\n const oneHour = 60 * oneMinute;\n let currentTime = new Date().getTime();\n let Time24HoursAgo = currentTime - (24 * oneHour);\n let Time7DaysAgo = currentTime - (7 * 24 * oneHour);\n mRecs.Items.forEach(mR => {\n let mTime = mR.posted_time;\n let mInfo = '';\n let mLine = `Sent to ${mR.recipient_list.name.first} ${mR.recipient_list.name.last}`;\n switch (mR.deliver_method) {\n case 'sms': {\n mLine += ' via text message';\n break;\n }\n case 'voice':\n case 'office': {\n mLine += ' via phone call';\n break;\n }\n case 'email': {\n mLine += ' via e-Mail';\n break;\n }\n case 'hold': {\n mLine += \" held for later delivery per recipient's instructions\";\n break;\n }\n default: { mLine += ` via ${mR.deliver_method}`; }\n }\n if (mR.results) {\n let mRLast = mR.results[0];\n mTime = mRLast.posted_time;\n switch (mRLast.result) {\n case 'reply': {\n mLine += '. Reply received';\n mInfo = ` Reply is \"${mRLast.update_contents.replace(':', ' -')}\"`;\n break;\n }\n case 'submitted': {\n break;\n }\n case 'replyReceived': {\n mLine += '. Reply received';\n break;\n }\n case 'delivered': {\n mLine += '. Delivered';\n break;\n }\n case 'open': {\n mLine += '. Opened';\n break;\n }\n default: {\n mLine += `. ${mRLast.result}`;\n }\n }\n }\n \n let mDateCheck = new Date(mTime);\n let mDate = '';\n if (mTime > Time24HoursAgo) { // date within the last 24 hours? Use Time only\n if ((mDateCheck.getHours() > new Date(currentTime).getHours())) {\n mDate = ' yesterday';\n }\n }\n else if (mTime > Time7DaysAgo) { // date within the last 7 days? Use Day of week (\"Tue\", \"Sun\", etc)\n let mWord = 'on';\n if ((mDateCheck.getDay() % 6 !== 0) && (mDateCheck.getDay() > new Date().getDay())) {\n mWord = 'last';\n }\n mDate = ` ${mWord} ${mDateCheck.toLocaleString([], { timeZone: timeZone, weekday: 'short' })}`;\n }\n else {\n mDate = ` on ${mDateCheck.toLocaleString([], { timeZone: timeZone, month: 'short', day: 'numeric' })}`;\n }\n mLine += `${mDate} at ${mDateCheck.toLocaleString([], { timeZone: timeZone, hour: 'numeric', minute: '2-digit' })}`;\n mLine += mInfo;\n returnArray.push(mLine);\n });\n */\n return ['~~~', 'Results:', ...returnArray];\n };\n\n async function getReceiptDetails(pCommonKey) {\n params.FunctionName = 'arn:aws:lambda:us-east-1:125549937716:function:MessageMaintenance';\n params.Payload = JSON.stringify({\n action: \"receipt_results\",\n clientId: pClient,\n request: {\n \"common_key\": pCommonKey,\n \"person_id\": pPerson\n }\n });\n let invokeFailed = false;\n const fResp = await lambda\n .invoke(params)\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA encountered an error. Error is ${err.message}`, {\n variant: 'error'\n });\n invokeFailed = true;\n });\n if (!invokeFailed) {\n let returnData = JSON.parse(fResp.Payload);\n if (returnData.status === 200) {\n if (returnData.body.length > 0) {\n return ['~~~', 'Results:', ...returnData.body];\n }\n }\n }\n return [];\n };\n\n const onScroll = event => {\n if (rowLimit < messageList.length) {\n setRowLimit(rowLimit + scrollValue);\n setForceRedisplay(!forceRedisplay);\n }\n };\n\n const toggleOpen = async (pIndex, pMessageID) => {\n let workingOpen = [];\n if (!open[pIndex]) {\n workingOpen[pIndex] = true;\n if (inOut_mode === 'in') { setMessageResults(await getReceiptDetails(pMessageID)); }\n else { setMessageResults(await getMessageResults(pMessageID)); }\n }\n setOpen(workingOpen);\n setForceRedisplay(!forceRedisplay);\n };\n\n function filteredMessage(pMessageRec, pFilter) {\n if (singleFilterDigit) { return true; }\n else {\n let searchString = [pMessageRec.message_text, pMessageRec.sender_name, pMessageRec.sender_id].join(' ');\n return searchString.toLowerCase().includes(message_filter_lower);\n }\n }\n\n function attachmentName(a) {\n if (isObject(a)) {\n a = a.Location;\n }\n let fNArr = a.split('/').pop().split('.');\n fNArr.pop();\n return decodeURI(fNArr.join('.'));\n }\n\n React.useEffect(() => {\n async function initialize() {\n let messageArray = [];\n // Get messages to me\n let mRecs = await dbClient\n .query({\n KeyConditionExpression: 'deliver_to = :p',\n FilterExpression: 'delete_flag <> :true',\n ExpressionAttributeValues: {\n ':p': pPerson,\n ':true': true\n },\n TableName: \"TheseusMessages\",\n IndexName: 'deliver_to-index',\n ScanIndexForward: false,\n Limit: 20\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n enqueueSnackbar(`There is no internet connection.`, { variant: 'error', persist: true });\n }\n console.log({ 'Error reading Messages': error });\n });\n if (mRecs && mRecs.hasOwnProperty('Items')) {\n for (let x = 0; x < mRecs.Items.length; x++) {\n let m = mRecs.Items[x];\n // let language = m.language || 'EN-US';\n let language = 'EN-US';\n let this_image = await getImage(m.author.author_id);\n if (m.author.author_name === 'AVA notifications') {\n let sRec = await getPerson(m.author.author_id);\n if (sRec && sRec.name) {\n m.author.author_name = `${sRec.name.first} ${sRec.name.last}`;\n }\n }\n // convert inline link to an attachment by extracting all text after (and including http:)\n let hLink = extract(m.content.current[language].text, 'http', ' ', {\n fuzzyRight: true, // allow end-of-string as a right delimeter \n includeLeft: true, // return the left delimeter\n });\n if (hLink) {\n if (!m.content.current.attachments) { m.content.current.attachments = []; }\n m.content.current.attachments.push(hLink);\n m.content.current[language].text = m.content.current[language].text.replace(hLink, '');\n }\n let this_message = {\n inOut: 'in',\n delete_flag: m.delete_flag,\n person_id: m.deliver_to,\n patient_name: m.author.author_name,\n sender_name: m.author.author_name,\n sender_id: m.author.author_id,\n sender_image: this_image,\n message_id: m.composite_key,\n posted_time: m.created_time,\n deliver_time: m.created_time,\n common_key: m.composite_key,\n message_content: m.content.current[language].text,\n attachments: m.content.current.attachments,\n subject: m.subject_line,\n message_text: m.content.current[language].text,\n thread_id: m.thread_id,\n allowReplyAll: (m.allowReplyAll || false)\n };\n messageArray.push(this_message);\n };\n }\n // Get messages From me\n mRecs = await dbClient\n .query({\n KeyConditionExpression: 'sent_from = :p',\n FilterExpression: 'delete_flag <> :true AND record_type = :t',\n ExpressionAttributeValues: {\n ':p': pPerson,\n ':t': 'message',\n ':true': true\n },\n TableName: \"TheseusMessages\",\n IndexName: 'sent_from-index',\n ScanIndexForward: false,\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n enqueueSnackbar(`There is no internet connection.`, { variant: 'error', persist: true });\n }\n console.log({ 'Error reading Messages': error });\n });\n if (mRecs && mRecs.hasOwnProperty('Items')) {\n for (let x = 0; x < mRecs.Items.length; x++) {\n let m = mRecs.Items[x];\n // let language = m.language || 'EN-US';\n let language = 'EN-US';\n // convert inline link to an attachment\n let hLink;\n if (m.content.current[language].hasOwnProperty('text') && m.content.current[language].text) {\n hLink = extract(m.content.current[language].text, 'http', ' ', {\n fuzzyRight: true, // allow end-of-string as a right delimeter \n includeLeft: true, // return the left delimeter\n });\n }\n else { continue; }\n if (hLink) {\n if (!m.content.current.attachments) { m.content.current.attachments = []; }\n m.content.current.attachments.push(hLink);\n m.content.current[language].text = m.content.current[language].text.replace(hLink, '');\n }\n let this_message = {\n inOut: 'out',\n delete_flag: m.delete_flag,\n person_id: m.deliver_to,\n patient_name: m.author.author_name,\n sender_name: m.author.author_name,\n sender_id: m.author.author_id,\n message_id: m.composite_key,\n posted_time: m.created_time,\n deliver_time: m.created_time,\n common_key: m.composite_key,\n message_content: m.content.current[language].text,\n attachments: m.content.current.attachments,\n subject: m.subject_line,\n message_text: m.content.current[language].text\n };\n let rArray = Object.keys(m.recipient_list);\n if (rArray.length === 1) {\n this_message.sender_image = await getImage(m.recipient_list[rArray[0]].id);\n this_message.toLine = (`${m.recipient_list[rArray[0]].name.first} ${m.recipient_list[rArray[0]].name.last}`).trim();\n }\n else {\n let random = Math.floor(Math.random() * rArray.length);\n let randomName = await makeName(m.recipient_list[rArray[random]].id);\n this_message.toLine = `${rArray.length} people, including ${randomName}`;\n this_message.sender_image = await getImage(m.recipient_list[rArray[random]].id);\n }\n messageArray.push(this_message);\n };\n }\n setMessageList(messageArray);\n }\n initialize();\n }, [pPerson, pClient]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n // ******************\n\n return (\n \n {messageList &&\n \n \n \n Recent Messages {inOut_mode === 'out' ? 'from me to others' : 'sent to me'}\n \n \n {\n await dbClient\n .update({\n Key: {\n person_id: pPerson,\n },\n UpdateExpression: 'set #c = :c',\n ExpressionAttributeValues: {\n ':c': true\n },\n ExpressionAttributeNames: {\n '#c': 'useNewMessaging'\n },\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating People; error is: `, error);\n });\n onReset('restart');\n }}\n name=\"MessagingStyle\"\n color=\"primary\"\n />\n \n {'Use New'}\n \n \n \n \n {(messageList.length > 0) &&\n \n \n \n {rowsWritten = 0}\n \n {messageList.map((this_item, index) => (\n ((rowsWritten <= rowLimit)\n && (this_item.inOut === inOut_mode)\n && (!message_filter || filteredMessage(this_item, message_filter))\n && (!this_item.delete_flag || showDeleted) ?\n \n \n {rowsWritten++}\n \n \n { toggleOpen(index, this_item.common_key); }}\n >\n \n {(inOut_mode === 'in') &&\n \n \n \n \n {makeSubject(this_item.subject || this_item.message_text)}\n {`from: ${this_item.patient_name || this_item.sender_name || this_item.sender_id}`}\n {makeReadableTime(this_item.posted_time || this_item.deliver_time)}\n \n \n {this_item.message_text.split(/[\\n\\r]+/).map((mLine, mIndex) => (\n {mLine}\n ))}\n {this_item.attachments && this_item.attachments.map((aLine, aIndex) => (\n \n \n {`Attachment: ${attachmentName(aLine)}`}\n \n \n ))}\n {open[index] &&\n messageResults.map((mLine, mIndex) => (\n {mLine})\n )\n }\n \n }\n {(inOut_mode === 'out') &&\n \n \n \n \n {this_item.subject || makeSubject(this_item.message_text)}\n {`to: ${this_item.toLine}`}\n {makeReadableTime(this_item.deliver_time)}\n \n \n {this_item.message_text.split(/[\\n\\r]+/).map((mLine, mIndex) => (\n {mLine})\n )}\n {this_item.attachments && this_item.attachments.map((aLine, aIndex) => (\n \n \n {`Attachment: ${attachmentName(aLine)}`}\n \n \n ))}\n {open[index] &&\n messageResults.map((mLine, mIndex) => (\n {mLine})\n )\n }\n \n }\n \n {!open[index] ? : }\n {(inOut_mode === 'in') &&\n {\n setConfirmMessage(`Delete message from ${this_item.patient_name || this_item.sender_name}?`);\n setConfirmID(this_item.message_id);\n setConfirmIndex(index);\n setDeletePending(true);\n setForceRedisplay(false);\n }}\n />\n }\n \n \n {\n \n {(inOut_mode === 'in') && (this_item.allowReplyAll) &&\n {\n let rList = await replyAllList(this_item.thread_id);\n setRecipient(rList);\n setRecipientIndex(index);\n setPromptForMessage(true);\n }}\n className={classes.AVAButton}\n startIcon={}\n >\n Reply All\n \n }\n {(inOut_mode === 'in') &&\n {\n setPromptForMessage(true);\n setRecipient(`${this_item.sender_name}:${this_item.sender_id}`);\n setRecipientIndex(index);\n }}\n className={classes.AVAButton}\n startIcon={}\n >\n Reply\n \n }\n \n }\n \n \n \n : null\n )\n ))}\n \n \n }\n {(messageList.length === 0) &&\n \n \n {`There are no messages to show`}\n \n \n }\n {\n promptForMessage &&\n { return r.split(':')[1]; }) : [recipient.split(':')[1]]}\n pRecipientName={Array.isArray(recipient) ? recipient.map(r => { return r.split(':')[0]; }) : [recipient.split(':')[0]]}\n onCancel={() => {\n setPromptForMessage(false);\n setForceRedisplay(!forceRedisplay);\n }}\n onComplete={() => {\n setPromptForMessage(false);\n setForceRedisplay(!forceRedisplay);\n }}\n allowCancel={true}\n thread_id={(recipientIndex >= 0) ? messageList[recipientIndex].thread_id : ''}\n seedText={[((recipientIndex >= 0)\n ? `${pSession.user_display_name}'s reply to ${messageList[recipientIndex].subject}`\n : ''), '']}\n />\n }\n {\n deletePending &&\n {\n setDeletePending(false);\n }}\n onConfirm={() => {\n handleRemoveMessage(confirmID, confirmIndex);\n setDeletePending(false);\n }}\n >\n \n }\n {\n showAddPrompt &&\n {\n setShowAddPrompt(false);\n }}\n pReturnValue={'object'}\n multiSelect={true}\n onSelect={(selectedPerson) => {\n setPromptForMessage(true);\n setShowAddPrompt(false);\n let rList = [];\n Object.keys(selectedPerson).forEach(r => {\n rList.push(`${selectedPerson[r]}:${r}`);\n });\n setRecipient(rList);\n }}\n >\n \n }\n { // Command Area\n \n \n \n onReset()}\n startIcon={}\n >\n {'Close'}\n \n {\n if (inOut_mode === 'in') { setinOut('out'); }\n else { setinOut('in'); }\n }}\n startIcon={\n (inOut_mode === 'in' ? : )\n }\n >\n {inOut_mode === 'in' ? 'View Sent Messages' : 'View Received Messages'}\n \n {\n setShowAddPrompt(true);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n startIcon={}\n >\n {`New Message`}\n \n \n \n \n }\n \n }\n \n );\n};","import React from 'react';\n\nimport { s3 } from '../../util/AVAUtilities';\n\nimport { useSnackbar } from 'notistack';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\n\nimport LoadIcon from '@material-ui/icons/GetApp';\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport CloudUploadIcon from '@material-ui/icons/CloudUpload';\n\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nconst useStyles = makeStyles(theme => ({\n containerBox: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0\n },\n contentBox: {\n minWidth: '100%',\n },\n screenBody: {\n minWidth: '100%',\n marginBottom: theme.spacing(2)\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n },\n rowButtonConfirm: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n border: '0.4px solid gray',\n textTransform: 'none',\n fontWeight: 'bold',\n size: 'small',\n color: theme.palette.confirm[theme.palette.type],\n },\n uploadButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n border: '0.4px solid gray',\n textTransform: 'none',\n fontWeight: 'bold',\n size: 'small',\n color: theme.palette.primary[theme.palette.type],\n },\n rowButtonReject: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n border: '0.4px solid gray',\n textTransform: 'none',\n fontWeight: 'bold',\n size: 'small',\n color: theme.palette.reject[theme.palette.type],\n },\n rowButtonGreen: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n },\n radioButton: {\n marginTop: 0,\n marginRight: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 1,\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n fontWeight: 'bold'\n },\n prompt: {\n marginTop: 0,\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.0rem'\n },\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n minWidth: '100%',\n marginTop: 10,\n marginBottom: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 0,\n },\n}));\n\nexport default ({ promptText, pClient, fileTag, onCancel }) => {\n\n const classes = useStyles();\n const { enqueueSnackbar } = useSnackbar();\n\n const [forceRedisplay, setForceRedisplay] = React.useState(true);\n\n const [reactData, setReactData] = React.useState({\n fileType: '',\n fileName: '',\n file: '',\n loading: false\n });\n\n const hiddenFileInput = React.useRef(null);\n\n const handleFileUpload = event => {\n hiddenFileInput.current.click();\n };\n\n function handleStoreReference(pTarget) {\n reactData.fileType = pTarget.type;\n reactData.fileName = pTarget.name;\n reactData.file = pTarget;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n return;\n }\n\n async function handleSaveFile() {\n reactData.loading = true;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n let s3Resp = await s3\n .upload({\n Bucket: 'theseus-medical-storage',\n Key: `${pClient}_${fileTag[0]}`,\n Body: reactData.file,\n ACL: 'public-read-write',\n ContentType: reactData.fileType\n })\n .promise()\n .catch(err => {\n enqueueSnackbar(`Uh oh! AVA couldn't save your file. The reason is ${err.message}`, { variant: 'error', persist: true });\n });\n console.log(s3Resp);\n onCancel();\n };\n\n // **************************\n\n return (\n \n \n \n {'Upload a File to AVA'}\n \n \n {promptText}\n \n \n \n }\n onClick={handleFileUpload}\n >\n {`Select a ${reactData.fileName ? 'different' : ''} File`}\n \n {\n handleStoreReference(target.target.files[0]);\n setForceRedisplay(!forceRedisplay);\n }}\n />\n \n \n {reactData.fileName &&\n \n {`You selected ${reactData.fileName}`}\n \n }\n \n \n \n {\n onCancel();\n }}\n startIcon={}\n >\n {'Cancel'}\n \n {reactData.fileName &&\n \n {reactData.loading\n ?\n < Button\n className={classes.rowButtonGreen}\n size='small'\n >\n {'Loading'}\n \n :\n < Button\n className={classes.rowButtonConfirm}\n size='small'\n onClick={async () => { await handleSaveFile(); }}\n startIcon={}\n >\n {'Confirm'}\n \n }\n \n }\n \n \n \n );\n};\n","import React from 'react';\nimport { s3 } from '../../util/AVAUtilities';\nimport { makeDate } from '../../util/AVADateTime';\nimport { makeName } from '../../util/AVAPeople';\nimport { putServiceRequest } from '../../util/AVAServiceRequest';\nimport { getObservationItems } from '../../util/AVAObservations';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport { useSnackbar } from 'notistack';\n\nimport TextField from '@material-ui/core/TextField';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Typography from '@material-ui/core/Typography';\nimport Button from '@material-ui/core/Button';\nimport List from '@material-ui/core/List';\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport CheckIcon from '@material-ui/icons/Check';\nimport CloudUploadIcon from '@material-ui/icons/CloudUpload';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport LinearProgress from '@material-ui/core/LinearProgress';\n\nimport HomeIcon from '@material-ui/icons/Home';\nimport AutorenewIcon from '@material-ui/icons/Autorenew';\n\nimport Avatar from '@material-ui/core/Avatar';\nimport Menu from '@material-ui/core/Menu';\nimport MenuList from '@material-ui/core/MenuList';\nimport MenuItem from '@material-ui/core/MenuItem';\n\nimport AVAConfirm from './AVAConfirm';\n\nimport { AVAclasses, AVADefaults, AVATextStyle } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n textLine: {\n fontSize: '1rem',\n flexGrow: 0,\n marginRight: '7px'\n },\n containerBox: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0\n },\n headerLine: {\n marginTop: theme.spacing(3.0),\n marginBottom: theme.spacing(1.0),\n fontSize: theme.typography.fontSize * 1.5,\n fontWeight: 'bold'\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n marginBottom: 0,\n marginTop: 0,\n paddingLeft: 0,\n paddingRight: 50,\n },\n descText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(3),\n marginBottom: 10,\n marginTop: 0,\n paddingLeft: 0,\n paddingRight: 50,\n },\n messageArea: {\n alignItems: 'center',\n justifyContent: 'space-between',\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(1),\n },\n radioHeader: {\n fontSize: theme.typography.fontSize * 0.9,\n fontWeight: 'bold',\n marginLeft: 0,\n marginBottom: 0,\n marginTop: 0,\n paddingLeft: 0,\n },\n profileArea: {\n alignItems: 'center'\n },\n popUpMenu: {\n marginRight: theme.spacing(3),\n paddingRight: 2,\n },\n popUpMenuRow: {\n marginLeft: theme.spacing(1),\n fontSize: theme.typography.fontSize * 1.0,\n },\n popUpFooter: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: 3,\n paddingLeft: 0,\n paddingRight: 1,\n },\n freeInput: {\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 0,\n flexGrow: 2,\n fontSize: theme.typography.fontSize * 1.3,\n },\n confirm: {\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n inputRow: {\n marginTop: theme.spacing(0.75),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(0.75),\n },\n listItem: {\n marginTop: theme.spacing(0.75),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(0.75),\n flexWrap: 'nowrap'\n },\n page: {\n height: 950,\n },\n title: {\n marginTop: theme.spacing(2),\n marginRight: theme.spacing(2),\n // marginLeft: theme.spacing(2),\n marginBottom: 0,\n fontSize: theme.typography.fontSize * 1.5,\n fontWeight: 'bold',\n },\n subTitle: {\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(0.5),\n // marginLeft: theme.spacing(2),\n fontSize: theme.typography.fontSize * 1.2\n },\n buttonArea: {\n maxWidth: 1000,\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n }\n}));\n\nexport default ({ fact, factName, defaultValue, prompt, pClient, qualifiers, listValues, onSave, onClose }) => {\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n const { enqueueSnackbar } = useSnackbar();\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const [reactData, setReactData] = React.useState({\n cancelPending: false,\n confirmStatus: '',\n confirmPrompt: false,\n checkedToSave: null,\n attachmentList: [],\n textInput: {},\n initialLoadComplete: null,\n popupMenuOpen: false,\n loadProgress: [],\n errorOnScreen: false\n });\n\n const [dataRows, setDataRows] = React.useState();\n const [anchorEl, setAnchorEl] = React.useState(null);\n const [linkURL, setLinkURL] = React.useState(null);\n\n const factType = fact.activity_key.split('.')[0];\n\n const handleClick = async (event) => {\n setAnchorEl(event.currentTarget);\n };\n\n\n /* value | meaning | example */\n /* --------- | ---------- | ------------- */\n\n /* headers...\n /* ~~ | section header | ~~Entree Choices */\n\n /* check boxes...\n /* | selection/check box | Filet Mignon */\n\n /* instructions...\n /* ~[checkbox=off] | Stop rendering check boxes, render value only\n /* ~[checkbox=on] | Begin rendering check boxes AND values\n /* ~[display=off] | Do not display anything until display=on is encountered\n /* ~[display=on] | Begin showing lines again\n /* ~[required=on] | Text fields between these tags must not be left blank\n /* ~[required=off] | Stop requiring entry in text fields\n \n /* prompt for response...\n /* ~other: | prompt for text response with | ~other:What is your name? */\n /* ~time: | prompt for time response with | ~time:What time would you like your meal? */\n /* ~date: | prompt for date response with | ~date:What date would you like your meal? */\n\n let displayRowList = [];\n let checkbox = true;\n let ignore = false;\n let required = false;\n let displayBold = false;\n let displayItalic = false;\n const defaultCheckedWords = ['checked', 'on', 'selected', 'true'];\n\n async function initialLoad() {\n //if (!reactData.initialLoadComplete) {\n let defaultObj = {};\n let defaultChecked = [];\n let defaultDataRows = {};\n if (defaultValue) {\n (Array.isArray(defaultValue) ? [...defaultValue] : [defaultValue]).forEach(i => {\n let [key, value] = i.split('=');\n defaultObj[key] = value;\n });\n }\n for (let vIndex = 0; vIndex < listValues.length; vIndex++) {\n // All rows are evaluated as follows \"~:\"\n // OR... \"~~\" (instruction[0] expected to be null/blank in this case)\n let instruction = listValues[vIndex].split(/[~:]+/);\n // console.log(instruction);\n\n // This checks for rows that contain \"~[=]\"\n let dValue = '';\n let last_instruction = instruction[instruction.length - 1];\n if (last_instruction.charAt(0) === '[') {\n let [, oControl, oValue] = last_instruction.split(/[=[\\]]+/);\n switch (oControl) {\n case 'checkbox': { // checkbox default state is true; this allows you to toggle it off/on\n checkbox = (oValue.toLowerCase() === 'on');\n break;\n }\n case 'display': {\n ignore = (oValue.toLowerCase() === 'off');\n break;\n }\n case 'required': {\n required = (oValue.toLowerCase() === 'on');\n break;\n }\n case 'bold': {\n displayBold = (oValue.toLowerCase() === 'on');\n break;\n }\n case 'italics':\n case 'italic': {\n displayItalic = (oValue.toLowerCase() === 'on');\n break;\n }\n case 'default': {\n dValue = oValue;\n break;\n }\n default: { }\n }\n instruction.pop();\n if ((instruction.length === 0) || ((instruction.length === 1) && !instruction[0])) { continue; }\n }\n\n if (ignore) { continue; }\n\n // This handles any row without a leading \"~\"\n // These will be checkbox fields UNLESS a previous instruction turned checkbox OFF (~[checkbox=OFF])\n if (instruction[0]) {\n let rObj = {\n checkbox,\n required,\n text: instruction[0],\n oKey: getKey(instruction[0]),\n altValue: (listValues[vIndex].includes(\":\") ? instruction[1] : null),\n desc: getDescription(instruction[0]),\n input: false,\n bold: displayBold,\n italic: displayItalic\n };\n displayRowList.push(rObj);\n // default the checkbox to checked if either:\n // a previous instruction set the default for all checkboxes to ON (~[default=checked]), OR\n // a passed in default for this item instructs AVA to set the checkbox ON\n if (defaultCheckedWords.includes(dValue)\n || (defaultObj.hasOwnProperty(instruction[0]) && defaultCheckedWords.includes(defaultObj[instruction[0]]))) {\n delete defaultObj[instruction[0]];\n defaultChecked.push(instruction[0]);\n let oItem = await getObservationItems(rObj.oKey);\n if (oItem && oItem.hasOwnProperty('options')) {\n defaultDataRows[instruction[0]] = oItem.options.display_value;\n let workChosenQ = {};\n if (defaultDataRows.hasOwnProperty('chosenQual')) {\n workChosenQ = defaultDataRows.chosenQual;\n }\n if (!workChosenQ.hasOwnProperty(instruction[0])) {\n workChosenQ[instruction[0]] = {};\n oItem.options.display_value.forEach(v => {\n if (v.default) {\n if (Array.isArray(v.default)) { workChosenQ[instruction[0]][v.title] = v.default; }\n else { workChosenQ[instruction[0]][v.title] = [v.default]; }\n }\n else { workChosenQ[instruction[0]][v.title] = []; }\n });\n }\n defaultDataRows.chosenQual = workChosenQ;\n }\n }\n continue;\n }\n\n // Dropping through to here means that instruction[0] was null/blank\n // (ie. there was nothing before the first \"~\"; the row started with \"~\")\n // This handles rows in the form \"~:\", for example\n // \"~lambda:ServiceRequestMaintenance\" or\n // \"~prompt:Notes for the Dining Staff...\"\n if (instruction[2]) {\n let rObj = {\n checkbox: (instruction[1].includes('withCheckBox')),\n required: required || (instruction[1].includes('required')),\n text: instruction[2],\n oKey: getKey(instruction[2]),\n desc: getDescription(instruction[2]),\n input: instruction[1]\n };\n displayRowList.push(rObj);\n if (dValue) { defaultObj[instruction[2]] = dValue; }\n if (defaultObj.hasOwnProperty(`private~${instruction[2]}`)) {\n if (!reactData.textInput) { reactData.textInput = {}; }\n reactData.textInput[instruction[2]] = defaultObj[`private~${instruction[2]}`];\n fact.value.freeText[instruction[2]] = defaultObj[`private~${instruction[2]}`];\n }\n continue;\n }\n\n // Dropping through to here means that instruction[2] was also null/blank\n // so the row looked like \"~\" or \"~~\"\n // Turns out, this is a header line in instruction[1]\n displayRowList.push({\n checkbox: false,\n required: false,\n text: instruction[1],\n oKey: getKey(instruction[1]),\n desc: getDescription(instruction[1]),\n input: false,\n header: true\n });\n if (dValue) { defaultObj[instruction[1]] = dValue; }\n };\n if (defaultObj && (Object.keys(defaultObj).length > 0)) {\n for (const key in defaultObj) {\n if (!key.startsWith('private~')) {\n if (!reactData.textInput) { reactData.textInput = {}; }\n if (defaultObj[key]) {\n reactData.textInput[key] = defaultObj[key];\n }\n }\n else { delete fact?.value?.freeText[key]; }\n }\n }\n reactData.initialLoadComplete = true;\n let setValue = Object.assign({\n displayRows: displayRowList,\n dataRows: {},\n checked: defaultChecked\n },\n defaultDataRows);\n setDataRows(setValue);\n setReactData(reactData);\n }\n\n React.useEffect(() => {\n async function initialize() {\n await initialLoad();\n }\n if (!reactData.initialLoadComplete) {\n initialize();\n }\n }, [defaultValue]); // eslint-disable-line react-hooks/exhaustive-deps\n\n async function getObservations(pText, pObsKey, pChecked) {\n let workDataRows = dataRows;\n workDataRows.checked = pChecked;\n if (dataRows.hasOwnProperty(pText)) {\n setDataRows(workDataRows);\n setForceRedisplay(!forceRedisplay);\n return;\n }\n if (pObsKey) {\n let oItem = await getObservationItems(pObsKey);\n if (oItem && oItem.hasOwnProperty('options')) {\n workDataRows[pText] = oItem.options.display_value;\n let workChosenQ = {};\n if (workDataRows.hasOwnProperty('chosenQual')) {\n workChosenQ = workDataRows.chosenQual;\n }\n if (!workChosenQ.hasOwnProperty(pText)) {\n workChosenQ[pText] = {};\n oItem.options.display_value.forEach(v => {\n if (v.default) {\n if (Array.isArray(v.default)) { workChosenQ[pText][v.title] = v.default; }\n else { workChosenQ[pText][v.title] = [v.default]; }\n }\n else { workChosenQ[pText][v.title] = []; }\n });\n }\n workDataRows.chosenQual = workChosenQ;\n }\n if (oItem && oItem.hasOwnProperty('links')) {\n if (!workDataRows.hasOwnProperty('links')) {\n workDataRows.links = {};\n }\n oItem.links.display_value.forEach(l => {\n workDataRows.links[l.display] = l.link;\n });\n }\n }\n setDataRows(workDataRows);\n setForceRedisplay(!forceRedisplay);\n }\n\n function handleQualChecked(pOrderOption, pQualifier, pQualChoice) {\n if (!pQualChoice) { return; }\n let qRule = dataRows[pOrderOption].find(r => { return (r.title === pQualifier); });\n let workChosenQ = dataRows.chosenQual;\n if (!workChosenQ) {\n workChosenQ[pOrderOption] = {};\n }\n if (!workChosenQ[pOrderOption]) {\n workChosenQ[pOrderOption][pQualifier] = {};\n }\n if (!workChosenQ[pOrderOption][pQualifier] || (workChosenQ[pOrderOption][pQualifier].length === 0)) {\n workChosenQ[pOrderOption][pQualifier] = [pQualChoice];\n }\n else {\n let x = workChosenQ[pOrderOption][pQualifier].indexOf(pQualChoice);\n let workArray = workChosenQ[pOrderOption][pQualifier];\n if (x === -1) {\n if (workArray.length >= (qRule.max_allowed || 99)) { workArray.pop(); }\n workArray.push(pQualChoice);\n }\n else {\n if (workArray.length > (qRule.min_required || 0)) {\n workArray.splice(x, 1);\n }\n }\n workChosenQ[pOrderOption][pQualifier] = workArray;\n }\n // Checking Rules\n dataRows.chosenQual = workChosenQ;\n setDataRows(dataRows);\n setForceRedisplay(!forceRedisplay);\n }\n\n function loadingInProgress(index = 'all') {\n if (!reactData.loadProgress) {\n return false;\n }\n if (index !== 'all') {\n return (reactData.loadProgress[index] && reactData.loadProgress[index].loading);\n }\n else {\n return (reactData.loadProgress.some(i => {\n return (i.loading);\n }))\n }\n }\n\n function getKey(pText) {\n if (qualifiers.hasOwnProperty(pText) && qualifiers[pText].qualifiers) {\n let qKey = qualifiers[pText].qualifiers.find(q => { return (q.startsWith('~~key=')); });\n if (qKey) { return qKey.substr(6); }\n }\n return null;\n }\n\n function getDescription(pText) {\n if (qualifiers.hasOwnProperty(pText)) {\n return qualifiers[pText].description;\n }\n else {\n return null;\n }\n }\n\n const onCheckEnter = (event, this_item) => {\n if (event.key === 'Enter' || event.type === 'blur') {\n if (this_item.input === 'date') { handleDateExit(event, this_item); }\n else if (this_item.input === 'time') { handleTimeExit(event, this_item); }\n else { handleTextExit(event, this_item); }\n }\n setForceRedisplay(!forceRedisplay);\n };\n\n const handleDateExit = async (event, this_item) => {\n let AVAdate = makeDate(event.target.value, { validation: 'noFuture' });\n reactData.textInput[this_item.text] = AVAdate.absolute;\n reactData.errorOnScreen = (AVAdate.error && !!AVAdate.absolute);\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n };\n\n const handleTimeExit = (event, this_item) => {\n let ampm = null;\n if (event.target.value.includes('p')) { ampm = 'pm'; }\n else if (event.target.value.includes('a')) { ampm = 'am'; };\n let [hh$, mm$] = event.target.value.split(':');\n let hh = Number(hh$.replace(/\\D+/g, ''));\n let mm = 0;\n if (hh > 100) {\n if (!mm$) { mm = hh % 100; }\n hh = Math.floor(hh / 100);\n }\n if (mm$) { mm = Number(mm$.replace(/\\D+/g, '')); }\n if (mm > 59) {\n let hAdd = Math.floor(mm / 60);\n mm -= (hAdd * 60);\n hh += hAdd;\n }\n if (hh >= 23) {\n hh = hh % 24;\n }\n if (hh >= 12) {\n hh -= 12;\n ampm = 'pm';\n }\n if (hh === 0) {\n hh = 12;\n ampm = 'pm';\n }\n if (!ampm) { ampm = ((hh > 6) && (hh < 12)) ? 'am' : 'pm'; }\n reactData.textInput[this_item.text] = `${hh}:${mm < 10 ? ('0' + mm) : mm} ${ampm}`;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n };\n\n const handleTextExit = (event, this_item) => {\n reactData.textInput[this_item.text] = event.target.value;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n };\n\n function isChecked(pObj) {\n return (dataRows.hasOwnProperty('checked') && dataRows.checked.includes(pObj.text) && pObj.checkbox);\n }\n\n function isQChecked(pObj, pQualName, pChoice) {\n return (dataRows.hasOwnProperty('chosenQual')\n && dataRows.chosenQual[pObj.text]\n && dataRows.chosenQual[pObj.text].hasOwnProperty(pQualName.title)\n && dataRows.chosenQual[pObj.text][pQualName.title].includes(pChoice));\n }\n\n function showQualifier(pObj) {\n return (isChecked(pObj) && !!dataRows && dataRows.hasOwnProperty(pObj.text));\n }\n\n function makeConfirm(pDisplayRows, pChecked, textInput = { 'empty': true }) {\n if (!textInput) { textInput = { 'empty': true }; }\n let workChecked = [];\n let errorsExist = false;\n let errorMessage = ['Please correct these errors', ''];\n let responseArray = [`Please confirm your selections`, ''];\n setLinkURL(null);\n pDisplayRows.forEach(r => {\n if (r.required && (!textInput.hasOwnProperty(r.text) || textInput[r.text] === '')) {\n errorsExist = true;\n errorMessage.push(`[italic]You left \"${r.text}\" blank!`);\n }\n if (r.checkbox || (textInput && textInput.hasOwnProperty(r.text))) {\n let rText = '';\n if (pChecked.includes(r.text)) { rText = r.text; }\n if (textInput.hasOwnProperty(r.text) && (textInput[r.text].length > 0)) { rText = textInput[r.text]; }\n if (rText) {\n if (pChecked.includes(r.text)) { workChecked.push(`${rText}${(r.altValue ? (':' + r.altValue) : '')}`); }\n responseArray.push(rText);\n if (dataRows.links && dataRows.links[rText]) {\n setLinkURL(dataRows.links[rText]);\n }\n if (dataRows.hasOwnProperty('chosenQual') && dataRows.chosenQual[r.text]) {\n for (let key in dataRows.chosenQual[r.text]) {\n if (dataRows.chosenQual[r.text][key] && (dataRows.chosenQual[r.text][key].length > 0)) {\n dataRows.chosenQual[r.text][key].forEach(qRow => {\n responseArray.push(`[indent=1]${qRow}`);\n if (dataRows.links && dataRows.links[qRow]) {\n setLinkURL(dataRows.links[qRow]);\n }\n });\n }\n }\n }\n }\n }\n });\n if (reactData.attachmentList && (reactData.attachmentList.length > 0)) {\n reactData.attachmentList.forEach(aRow => {\n let fNArr = aRow.Location.split('/').pop().split('.');\n fNArr.pop();\n let fName = decodeURI(fNArr.join('.'));\n responseArray.push(`Attachment: ${fName}`);\n });\n }\n reactData.checkedToSave = workChecked;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n if (errorsExist) { return ['error', errorMessage]; } else { return ['confirm', responseArray]; };\n }\n\n const hiddenFileInput = React.useRef(null);\n\n const handleFileUpload = event => {\n hiddenFileInput.current.click();\n };\n\n function textIsPresent(fieldName) {\n return (reactData.hasOwnProperty('textInput')\n && reactData.textInput.hasOwnProperty(fieldName)\n && (reactData.textInput[fieldName] !== ''));\n }\n\n let upload;\n async function handleSaveFile(pTarget) {\n let pType = pTarget.type;\n upload = s3.upload({\n partSize: 10 * 1024 * 1024,\n queueSize: 4,\n Bucket: 'theseus-medical-storage',\n Key: pTarget.name,\n Body: pTarget,\n ACL: 'public-read-write',\n ContentType: pType\n });\n let reactData_index = reactData.attachmentList.push({\n Key: pTarget.name\n }) - 1;\n reactData.loadProgress[reactData_index] = {\n loading: true,\n fileName: '',\n total: 1,\n progress: 0\n };\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n let s3Resp = await performUpload(); \n reactData.attachmentList[reactData_index] = s3Resp;\n if (!reactData.textInput) { reactData.textInput = { 's3file': s3Resp.Location }; }\n else { reactData.textInput.s3file = s3Resp.Location; }\n reactData.loadProgress[reactData_index] = {\n loading: false,\n fileName: '',\n total: 1,\n progress: 0\n }\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n return s3Resp;\n\n function performUpload() {\n return new Promise(function (resolve, reject) {\n upload\n .send((err, good) => {\n if (err) {\n if (err.code === 'RequestAbortedError') {\n enqueueSnackbar(`AVA stopped loading at your request.`, { variant: 'error', persist: false });\n }\n else {\n enqueueSnackbar(`Uh oh! AVA couldn't save your file. The reason is ${err.message}`, { variant: 'error', persist: true });\n }\n reject({});\n }\n else {\n resolve(good);\n }\n });\n upload.on('httpUploadProgress', progress => {\n if (reactData.loadProgress[reactData_index].loading === 'abort') {\n upload.abort();\n reactData.loadProgress.splice(reactData_index, 1);\n }\n else {\n let pFactor = 1000;\n do {\n pFactor *= 10;\n }\n while (progress.total > (1000 * pFactor));\n reactData.loadProgress[reactData_index] = {\n loading: true,\n fileName: progress.key,\n total: (progress.total / pFactor),\n progress: ((progress.loaded * 100) / progress.total)\n };\n }\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n });\n });\n };\n };\n\n return (\n \n {!!dataRows && dataRows.hasOwnProperty('displayRows') && dataRows.displayRows.length > 0 &&\n \n {/* Header with Avatar, Message, and VertMenu */}\n \n \n \n {factName}\n \n \n {prompt || `Please select from these options`}\n \n \n {\n handleClick(event);\n reactData.popupMenuOpen = true;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}>\n \n \n {\n reactData.popupMenuOpen = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n keepMounted>\n \n {\n onClose();\n }}>\n \n \n {'Go to AVA Menu'}\n \n \n {\n let jumpTo = window.location.origin;\n window.location.replace(jumpTo);\n }}>\n \n \n {'Restart AVA'}\n \n \n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n {`User ${fact.session.user_id}${fact.patient_id !== fact.session.user_id ? (' (' + fact.patient_id + ')') : ''}`}\n {`Function: ObservationForm`}\n {`Activity: ${fact.activity_key}`}\n \n \n \n \n \n {/* Selections */}\n \n \n {dataRows.displayRows.map((this_item, this_index) => (\n \n {\n if (this_item.checkbox) {\n if (!dataRows.hasOwnProperty('checked') || (dataRows.checked.length === 0)) {\n dataRows.checked = [this_item.text];\n await getObservations(this_item.text, this_item.oKey, dataRows.checked);\n }\n else {\n let x = dataRows.checked.indexOf(this_item.text);\n let workChecked = dataRows.checked;\n if (x === -1) {\n workChecked.push(this_item.text);\n await getObservations(this_item.text, this_item.oKey, workChecked);\n }\n else {\n workChecked.splice(x, 1);\n dataRows.checked = workChecked;\n setDataRows(dataRows);\n setForceRedisplay(!forceRedisplay);\n }\n }\n }\n }}\n >\n {this_item.checkbox &&\n \n }\n {!this_item.input &&\n \n {this_item.bold\n ? (this_item.italic ? {this_item.text} : {this_item.text})\n : (this_item.italic ? {this_item.text} : `${this_item.text}`)}\n \n }\n {this_item.input &&\n {\n onCheckEnter(event, this_item);\n }}\n onChange={(event) => {\n if (!reactData.textInput) { reactData.textInput = {}; }\n reactData.textInput[this_item.text] = event.target.value;\n if (!event.target.value) {\n reactData.errorOnScreen = false;\n }\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onBlur={(event) => {\n onCheckEnter(event, this_item);\n }}\n autoComplete='off'\n value={textIsPresent(this_item.text) ? reactData.textInput[this_item.text] : ''}\n />\n }\n \n {(this_item.desc && isChecked(this_item)) &&\n {this_item.desc}\n }\n {showQualifier(this_item) &&\n dataRows[this_item.text].map((qR, qRndx) => (\n \n \n {qR.title}\n \n {qR.option && qR.option.map((opt, oX) => (\n {\n handleQualChecked(this_item.text, qR.title, opt.display);\n }}\n >\n {(!opt.type || (opt.type === 'checkbox')) &&\n \n \n {opt.display}\n \n }\n {opt.type === 'prompt' &&\n \n \n {\n qR.option[oX].display = event.target.value;\n }}\n autoComplete='off'\n />\n \n }\n \n ))}\n \n \n \n ))\n }\n \n ))}\n \n { /* Show list of already uploaded attachments (if applicable) */}\n {(reactData.attachmentList.length > 0) &&\n \n Attachments:\n {reactData.attachmentList.map((a, x) => (\n \n {\n reactData.attachmentList.splice(x, 1);\n reactData.forceRedisplay = !reactData.forceRedisplay;\n if (loadingInProgress(x)) { \n reactData.loadProgress[x].loading = 'abort';\n }\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n }}\n />\n {loadingInProgress(x) &&\n \n \n \n }\n \n {a.Key}\n \n \n ))}\n \n }\n \n { /* Prompts */}\n {\n reactData.cancelPending &&\n {\n reactData.cancelPending = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onConfirm={() => {\n onClose();\n }}\n >\n \n }\n {\n (reactData.confirmStatus === 'confirm') &&\n {\n reactData.confirmStatus = '';\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onConfirm={async () => {\n let rObj;\n if (factType !== 'list') {\n // in defaultValues, if foreign_key and/or obo exist they can either mean:\n // 1. the name of the prompt whose textInput contains the value, OR\n // 2. the value itself\n // if not mentioned in defaultValues, we'll assign values to them\n let oBo, foreign_key;\n if (fact.value.freeText) {\n if ('onBehalfOf' in fact.value.freeText) {\n oBo = fact.value.freeText.onBehalfOf;\n if (reactData.textInput && reactData.textInput[fact.value.freeText.onBehalfOf]) {\n oBo = reactData.textInput[fact.value.freeText.onBehalfOf];\n delete reactData.textInput[fact.value.freeText.onBehalfOf];\n delete fact.value.freeText.onBehalfOf;\n delete reactData.textInput.onBehalfOf;\n }\n }\n if ('foreignKey' in fact.value.freeText) {\n foreign_key = fact.value.freeText.foreignKey;\n if (reactData.textInput) {\n if (reactData.textInput[fact.value.freeText.foreignKey]) {\n foreign_key = reactData.textInput[fact.value.freeText.foreignKey];\n delete reactData.textInput[fact.value.freeText.foreignKey];\n delete fact.value.freeText.foreignKey;\n }\n else if ('foreignKey' in reactData.textInput) {\n foreign_key = reactData.textInput['foreignKey'];\n }\n delete reactData.textInput['foreignKey'];\n }\n }\n }\n if (reactData.checkedToSave.some(s => { return s.toLowerCase().includes('anonymous'); })) {\n oBo = 'Anonymous';\n }\n else if (!oBo) { oBo = await makeName(fact.patient_id); }\n if (!foreign_key) { foreign_key = '*tbd'; }\n\n delete reactData.textInput['requestType'];\n let requestObj = { 'selections': reactData.checkedToSave, textInput: reactData.textInput, 'qualifiers': dataRows.chosenQual };\n let messageObj = {};\n if ('messaging' in fact) {\n messageObj.messaging = Object.assign({}, requestObj, fact.messaging);\n messageObj.messaging.activityName = factName;\n }\n let putSR = {\n client: pClient,\n author: fact.patient_id,\n proxy_user: fact.session.user_id,\n requestType: fact.value.freeText.requestType,\n onBehalfOf: oBo.replace(/\\n/g, \" \").trim(),\n foreign_key,\n request: requestObj,\n messaging: fact.messaging,\n activity_key: fact.activity_key\n };\n if (reactData.attachmentList && (reactData.attachmentList.length > 0)) {\n putSR.attachments = reactData.attachmentList;\n }\n rObj = await putServiceRequest(putSR);\n }\n if (linkURL) {\n window.open(linkURL, (rObj.request_id || 'AVA_request_postURL'));\n }\n onSave((rObj ? rObj.request_id : ''), reactData.checkedToSave, reactData.textInput, dataRows.chosenQual);\n }}\n >\n \n }\n {\n (reactData.confirmStatus === 'error') &&\n {\n reactData.confirmStatus = '';\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onConfirm={() => { }}\n >\n \n }\n\n { /* Command Area */}\n {\n \n \n \n {reactData?.textInput?.requestType && !(['meal'].includes(reactData.textInput.requestType)) &&\n \n }\n size='small'\n onClick={handleFileUpload}\n >\n {'Attach'}\n \n {\n await handleSaveFile(target.target.files[0]);\n reactData.forceRedisplay = !reactData.forceRedisplay;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n />\n \n }\n {\n if (factType === 'list') { onClose(); }\n else {\n reactData.cancelPending = true;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n };\n }}\n startIcon={}\n >\n {'Exit'}\n \n {(!factType || (factType !== 'list')) &&\n {\n let [cStatus, response] = makeConfirm(dataRows.displayRows, dataRows.checked, reactData.textInput);\n reactData.confirmPrompt = response;\n reactData.confirmStatus = cStatus;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n startIcon={}\n >\n {'Confirm/Send'}\n \n }\n \n \n \n }\n \n }\n \n );\n\n};\n","import React from 'react';\n\nimport { titleCase, makeArray, s3 } from '../../util/AVAUtilities';\n\nimport { useSnackbar } from 'notistack';\n\nimport { Dialog, DialogContent, TextField, Box, Button, Typography, Checkbox } from '@material-ui/core';\n\nimport LoadIcon from '@material-ui/icons/GetApp';\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport CloudUploadIcon from '@material-ui/icons/CloudUpload';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport Select from \"react-dropdown-select\";\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport { AVATextStyle, AVADefaults } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n contentBox: {\n minWidth: '100%',\n dividers: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n }\n },\n radioButton: {\n marginTop: 0,\n marginRight: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 1,\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n },\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n placeHolder: {\n marginLeft: 0,\n color: 'black'\n },\n idText: {\n minWidth: '100%',\n marginTop: 10,\n marginBottom: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 0,\n },\n clientBackground: {\n borderRadius: '30px',\n },\n promptBackground: {\n borderRadius: '15px',\n marginTop: 4,\n marginBottom: 4,\n paddingLeft: 16,\n paddingRight: 16,\n backgroundColor: 'white',\n }\n}));\n\nexport default ({ titleText, promptText, valueText, selectionList, errorText, buttonText, onCancel, onSave, allowCancel = true, options = {} }) => {\n\n const classes = useStyles();\n\n const AVAButton = {\n margin: '8px',\n paddingLeft: '16px',\n paddingRight: '16px',\n borderRadius: '16px',\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n };\n\n const { enqueueSnackbar } = useSnackbar();\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n let keyPressed = 0;\n\n const [textInput, setTextInput] = React.useState(\n makeArray(promptText).map((p, x) => {\n if (valueText && valueText[x]) {\n return valueText[x];\n }\n else {\n return \"\";\n }\n })\n );\n const [forceRedisplay, setForceRedisplay] = React.useState(true);\n const [reactData, setReactData] = React.useState({\n saving: false,\n focusOn: 0,\n loadProgress: [],\n attachmentList: (options.allowAttach && options.attachmentList ? options.attachmentList : []),\n bgColor_option: options.bgColor || null\n });\n\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n const hiddenFileInput = React.useRef(null);\n\n const handleFileUpload = event => {\n hiddenFileInput.current.click();\n };\n\n const handleChangeTextInput = (inputValue, ndx, options = {}) => {\n if (!reactData.saving) {\n if (Array.isArray(inputValue)) {\n if (inputValue.length > 1) {\n textInput[ndx] = inputValue.map(v => {\n return v.value;\n });\n }\n else {\n textInput[ndx] = inputValue[0].value;\n }\n }\n else {\n textInput[ndx] = inputValue;\n }\n setTextInput(textInput);\n if (inputValue === '*% select_new %*') {\n updateReactData({ saving: true }, false);\n handleSave();\n }\n else if (options.edit) {\n textInput[ndx] = `*% edit_item %*${inputValue}`;\n setTextInput(textInput);\n updateReactData({ saving: true }, false);\n handleSave();\n }\n else {\n setForceRedisplay(!forceRedisplay);\n }\n }\n else {\n updateReactData({ saving: false }, false);\n }\n };\n\n const toggleCheckbox = (ndx) => {\n if (textInput[ndx] === 'checked') { textInput[ndx] = ''; }\n else {\n if (options.selectOne) {\n textInput.forEach((t, x) => textInput[x] = '');\n }\n textInput[ndx] = 'checked';\n }\n setTextInput(textInput);\n setForceRedisplay(!forceRedisplay);\n };\n\n const buildValueList = (ndx) => {\n if (!valueText || !valueText[ndx]) {\n return [];\n }\n let response = [];\n makeArray(valueText[ndx]).forEach(v => {\n response.push(selectionList[ndx].find(s => (s.value === v)));\n })\n return response;\n }\n\n function loadingInProgress(index = 'all') {\n if (!reactData.loadProgress) {\n return false;\n }\n if (index !== 'all') {\n return (reactData.loadProgress[index] && reactData.loadProgress[index].loading);\n }\n else {\n return (reactData.loadProgress.some(i => {\n return (i.loading);\n }));\n }\n }\n\n let upload;\n async function handleSaveFile(pTarget) {\n let pType = pTarget.type;\n upload = s3.upload({\n partSize: 10 * 1024 * 1024,\n queueSize: 4,\n Bucket: 'theseus-medical-storage',\n Key: pTarget.name,\n Body: pTarget,\n ACL: 'public-read-write',\n ContentType: pType\n });\n let reactData_index = reactData.attachmentList.push({\n Key: pTarget.name\n }) - 1;\n reactData.loadProgress[reactData_index] = {\n loading: true,\n fileName: '',\n total: 1,\n progress: 0\n };\n updateReactData({ loadProgress: reactData.loadProgress }, true);\n let s3Resp = await performUpload();\n reactData.attachmentList[reactData_index] = s3Resp;\n if (!reactData.textInput) { reactData.textInput = { 's3file': s3Resp.Location }; }\n else { reactData.textInput.s3file = s3Resp.Location; }\n reactData.loadProgress[reactData_index] = {\n loading: false,\n fileName: '',\n total: 1,\n progress: 0\n };\n updateReactData({\n loadProgress: reactData.loadProgress,\n attachmentList: reactData.attachmentList,\n textInput: reactData.textInput\n }, true);\n return s3Resp;\n\n function performUpload() {\n return new Promise(function (resolve, reject) {\n upload\n .send((err, good) => {\n if (err) {\n if (err.code === 'RequestAbortedError') {\n enqueueSnackbar(`AVA stopped loading at your request.`, { variant: 'error', persist: false });\n }\n else {\n enqueueSnackbar(`Uh oh! AVA couldn't save your file. The reason is ${err.message}`, { variant: 'error', persist: true });\n }\n reject({});\n }\n else {\n resolve(good);\n }\n });\n upload.on('httpUploadProgress', progress => {\n if (reactData.loadProgress[reactData_index].loading === 'abort') {\n upload.abort();\n reactData.loadProgress.splice(reactData_index, 1);\n }\n else {\n let pFactor = 1000;\n do {\n pFactor *= 10;\n }\n while (progress.total > (1000 * pFactor));\n reactData.loadProgress[reactData_index] = {\n loading: true,\n fileName: progress.key,\n total: (progress.total / pFactor),\n progress: ((progress.loaded * 100) / progress.total)\n };\n }\n updateReactData({ loadProgress: reactData.loadProgress }, true);\n });\n });\n };\n };\n\n const handleSave = () => {\n let attachments = [];\n if (reactData.attachmentList && (reactData.attachmentList.length > 0)) {\n attachments = reactData.attachmentList.map(a => {\n return a.Location;\n });\n }\n if (Array.isArray(promptText)) {\n onSave(textInput, keyPressed, attachments);\n }\n else {\n onSave(textInput[0], keyPressed, attachments);\n }\n };\n\n const onCheckEnter = (event) => {\n if (event.key === 'Enter') {\n if (options.save_on_enter) {\n updateReactData({ saving: true }, false);\n handleSave();\n }\n else if (Array.isArray(promptText)) {\n let currentIndex = promptText.findIndex(this_prompt => {\n let promptParts = this_prompt.split(']');\n return (promptParts[promptParts.length - 1] === event.currentTarget.innerText);\n });\n let currentFocus = currentIndex + 1;\n if (currentFocus >= promptText.length) {\n currentFocus = 0;\n }\n updateReactData({\n focusOn: currentFocus\n }, true);\n }\n }\n };\n\n let promptArray = [];\n if (Array.isArray(promptText)) { promptArray = promptText; }\n else {\n promptArray = [promptText];\n if (!titleText) { titleText = titleCase(promptText); }\n }\n let minHeight = 0;\n promptArray.forEach(p => {\n if (p.startsWith('[select')) {\n minHeight = 350;\n }\n });\n let titleArray = makeArray(titleText);\n /*\n let displayValueArray = makeArray(valueText).map((v, ndx) => {\n if (!v) { return ''; }\n if (Array.isArray(v)) {\n if (v.length === 0) { return ''; }\n }\n else if ((typeof(v) === 'string') && !(v.trim())) { return ''; }\n if (!selectionList || !selectionList[ndx]) {\n if (Array.isArray(v)) {\n return listFromArray(v);\n }\n else {\n return v;\n }\n }\n let foundIt = selectionList[ndx].find(s => {\n if (typeof (s) === 'string') {\n return (searchValueList.includes(s.toLowerCase().trim()));\n }\n else if (s.hasOwnProperty('value')) {\n return (searchValueList.includes(s.value.toLowerCase().trim()));\n }\n else {\n return false;\n }\n });\n if (foundIt) {\n if (typeof (foundIt) === 'string') {\n return foundIt;\n }\n else {\n return (foundIt.key || foundIt.label || foundIt.display);\n }\n }\n return '';\n });\n */\n\n\n let buttonArray = [];\n if (!buttonText) { buttonArray = ['Save', 'Cancel/Go Back']; }\n else if (Array.isArray(buttonText)) { buttonArray = buttonText; }\n else {\n buttonArray = [buttonText, 'Cancel/Go Back'];\n }\n\n // **************************\n\n return (\n \n \n {titleText && titleArray.map((t, tx) => (\n \n {t.replace('[italic]', '')}\n \n ))}\n \n\n {promptArray && (promptArray.length > 0) &&\n \n \n {promptArray.map((prompt, ndx) => (\n \n {prompt && (prompt.toLowerCase().startsWith('[')) ?\n \n \n {prompt.toLowerCase().startsWith('[checkbox]') &&\n \n {\n toggleCheckbox(ndx);\n }}\n checked={(textInput[ndx] === 'checked')}\n />\n \n {prompt.split(']').pop()}\n \n \n }\n {prompt.toLowerCase().startsWith('[select') &&\n \n \n {\n return {\n value: (typeof (sel) === 'string') ? sel : sel.value,\n label: (titleCase(((typeof (sel) === 'string') ? sel : (sel.key || sel.label || sel.display)).replace('_', ' ')))\n };\n })}\n searchBy={'label'}\n style={{\n fontSize: `${user_fontSize}rem`,\n marginLeft: -5,\n marginBottom: -4,\n marginTop: 1,\n borderWidth: 0\n }}\n dropdownHandle={true}\n dropdownPosition={'auto'}\n values={buildValueList(ndx)}\n clearable={true}\n clearOnSelect={true}\n clearOnBlur={true}\n key={`select_${ndx}`}\n searchable={true}\n multi={prompt.toLowerCase().startsWith('[selectmulti')}\n closeOnClickInput={!prompt.toLowerCase().startsWith('[selectmulti')}\n closeOnSelect={!prompt.toLowerCase().startsWith('[selectmulti')}\n create={prompt.toLowerCase().startsWith('[selectcreate')}\n keepSelectedInList={true}\n noDataLabel={\"No matches found\"}\n onChange={(values) => {\n if (values.length === 0) {\n textInput[ndx] = null; \n setTextInput(textInput);\n }\n else {\n handleChangeTextInput(values, ndx);\n }\n updateReactData({\n focusOn: (ndx + 1)\n }, true);\n }}\n />\n \n \n {prompt.split(']').pop()}\n \n \n \n \n }\n \n \n :\n \n {\n handleChangeTextInput(event.target.value, ndx);\n }}\n onKeyPress={(event) => {\n onCheckEnter(event);\n }}\n helperText={(errorText && errorText[ndx]) ? errorText[ndx] : ((prompt === titleText) ? '' : (prompt || ''))}\n autoComplete='off'\n />\n \n }\n \n ))}\n \n \n }\n {(options.allowAttach && reactData.attachmentList && reactData.attachmentList.length > 0) &&\n \n \n {(typeof (options.allowAttach) === 'string') ? options.allowAttach : 'Attachments'}:\n \n {reactData.attachmentList.map((a, x) => (\n \n {\n reactData.attachmentList.splice(x, 1);\n reactData.forceRedisplay = !reactData.forceRedisplay;\n if (loadingInProgress(x)) {\n reactData.loadProgress[x].loading = 'abort';\n }\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n }}\n />\n {loadingInProgress(x) &&\n \n \n \n }\n \n {a.Key}\n \n \n \n ))}\n \n }\n \n {allowCancel &&\n {\n onCancel();\n }}\n startIcon={}\n >\n {buttonArray[1]}\n \n }\n \n {\n keyPressed = 0;\n handleSave();\n }}\n startIcon={}\n >\n {buttonArray[0]}\n \n {(buttonArray.length > 2) &&\n buttonArray.map((b, i) => (\n (i > 1) &&\n b &&\n {\n keyPressed = i;\n handleSave();\n }}\n >\n {b}\n \n ))\n }\n {options.allowAttach && (!options.maxAttach || (options.maxAttach > reactData.attachmentList.length)) &&\n \n }\n onClick={handleFileUpload}\n >\n Add {(typeof (options.allowAttach) === 'string') ? options.allowAttach : 'Attachment'}\n \n {\n let s3Data = await handleSaveFile(target.target.files[0]);\n textInput.push(s3Data.Location);\n setTextInput(textInput);\n }}\n />\n \n }\n \n \n \n );\n};\n","import React from 'react';\n\nimport useSession from '../../hooks/useSession';\nimport { useSnackbar } from 'notistack';\n\nimport { getImage, getPerson, getSession, makeName } from '../../util/AVAPeople';\nimport { deepCopy, makeArray, cl, recordExists, dbClient, isEmpty } from '../../util/AVAUtilities';\nimport { makeDate } from '../../util/AVADateTime';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport { AVAclasses, AVATextStyle } from '../../util/AVAStyles';\nimport FormFillB from './FormFillB';\n\nimport { Button, IconButton } from '@material-ui/core';\nimport { Dialog, DialogContent, DialogActions } from '@material-ui/core';\nimport { Box, Typography, Radio, Avatar } from '@material-ui/core';\nimport { Menu, MenuList, MenuItem } from '@material-ui/core';\n\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport CheckIcon from '@material-ui/icons/Check';\nimport RadioButtonUncheckedIcon from '@material-ui/icons/RadioButtonUnchecked';\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle';\nimport HomeIcon from '@material-ui/icons/Home';\nimport GroupAddIcon from '@material-ui/icons/GroupAdd';\nimport EditIcon from '@material-ui/icons/Edit';\n\nimport AVATextInput from './AVATextInput';\n\nconst useStyles = makeStyles(theme => ({\n smallTextLine: {\n fontSize: theme.typography.fontSize * 1.0,\n flexGrow: 0,\n lineHeight: 1.25,\n whiteSpace: 'break-spaces'\n },\n messageArea: {\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n popUpFooter: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n radioButton: {\n marginTop: 0,\n marginRight: 4,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 1,\n },\n freeInput: {\n marginLeft: theme.spacing(1),\n paddingLeft: 0,\n paddingRight: 0,\n flexGrow: 2,\n fontSize: theme.typography.fontSize * 1.3,\n },\n confirm: {\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n rootNoPadding: {\n paddingBottom: 0,\n paddingTop: 0,\n },\n inputRow: {\n marginTop: theme.spacing(1.5),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n },\n listItem: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n backGroundRed: {\n backgroundColor: 'red'\n },\n backGroundGreen: {\n backgroundColor: 'green'\n },\n backGroundNone: {\n },\n hiddenItem: {\n display: 'none',\n visibility: 'hidden'\n },\n listTopRow: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n formControlTitle: {\n margin: 0,\n marginLeft: 0,\n marginRight: '2px',\n paddingTop: '16px',\n paddingBottom: 0,\n height: 1,\n fontSize: theme.typography.fontSize * 0.8,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: 0,\n marginBottom: '8px',\n },\n formControlCheckGroup: {\n marginTop: 0,\n paddingTop: 0,\n marginLeft: '32px'\n },\n listItemSticky: { // keep\n position: 'sticky',\n top: 0,\n opacity: 1,\n overflowY: 'hidden',\n overflowX: 'auto',\n zIndex: 1,\n minHeight: '160px',\n maxHeight: '160px',\n width: '100%',\n },\n page: {\n // height: 950,\n },\n buttonArea: {\n width: '100%',\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n }\n}));\n\nexport default ({ family_id, forms, options = {}, onSave, onClose }) => {\n\n /*\n forms as \n { \n : { : [ {form_id: xxx}, {form_id: xxx}, ... ], : [ {form_id: xxx}, {form_id: xxx}, ... ], ... },\n ...\n }\n */\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n const { enqueueSnackbar } = useSnackbar();\n\n const { state } = useSession();\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n\n const [reactData, setReactData] = React.useState({\n stage: 'start',\n family_id,\n familyMembers: [],\n defaults: deepCopy(options),\n pertains_to: options.person_id || state.session.patient_id,\n newAccountForm: {},\n showCompleted: false,\n restrict_to_client_id: options.client_id || null,\n selectedColumn: 0,\n columnForms: [],\n forms,\n formList: []\n });\n\n const [popupMenuOpen, setPopupMenuOpen] = React.useState(false);\n const [anchorEl, setAnchorEl] = React.useState(null);\n\n const handleClick = async (event) => {\n setAnchorEl(event.currentTarget);\n };\n\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n async function initialLoad() {\n if (!reactData.family_id) {\n let foundFamily = await dbClient\n .query({\n TableName: 'FamilyGroups',\n IndexName: 'person_id-index',\n KeyConditionExpression: 'client_id = :c AND person_id = :p',\n ExpressionAttributeValues: {\n ':c': state.session.client_id,\n ':p': reactData.pertains_to\n }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading FamilyGroups with key of ${state.session.client_id}/${reactData.pertains_to}: ${error}`);\n });\n if (recordExists(foundFamily)) {\n updateReactData({\n family_id: foundFamily.Items[0].family_id,\n myRole: foundFamily.Items[0].role\n }, false);\n }\n else {\n // no Family ID was passed in and this account doesn't have a Family ID.\n // Create a Family and add this account as a new Caregiver\n const newFamilyID = `family_${new Date().getTime()}`;\n await dbClient\n .put({\n Item: {\n client_id: state.session.client_id,\n composite_key: newFamilyID,\n record_type: 'header',\n role: 'family',\n family_id: newFamilyID,\n family_name: (state?.patient?.name?.last\n ? `The ${state?.patient?.name?.last} Family`\n : 'My Family')\n },\n TableName: 'FamilyGroups'\n })\n .promise()\n .catch(error => {\n cl(`Bad put to Family. Error is: ${error}`);\n onClose();\n });\n await dbClient\n .put({\n Item: {\n client_id: state.session.client_id,\n composite_key: `${newFamilyID}%%${state.session.patient_id}`,\n family_id: newFamilyID,\n person_id: state.session.patient_id,\n record_type: 'person',\n role: options.role_if_new || 'primary'\n },\n TableName: 'FamilyGroups'\n })\n .promise()\n .catch(error => {\n cl(`Bad put to Family (person). Error is: ${error}`);\n onClose();\n });\n await dbClient\n .update({\n Key: { person_id: state.session.patient_id },\n UpdateExpression: 'set family_id = :f',\n ExpressionAttributeValues: {\n ':f': newFamilyID\n },\n TableName: \"People\",\n })\n .promise()\n .catch(error => { console.log(`caught error updating People; error is:`, error); });\n updateReactData({\n family_id: newFamilyID\n }, false);\n }\n }\n let qQ = {\n KeyConditionExpression: 'family_id = :f',\n ExpressionAttributeValues: { ':f': reactData.family_id },\n TableName: 'FamilyGroups',\n IndexName: 'family_id-index'\n };\n if (reactData.restrict_to_client_id) {\n qQ.KeyConditionExpression += ` and client_id = :c`;\n qQ.ExpressionAttributeValues[':c'] = reactData.restrict_to_client_id;\n qQ.IndexName = 'client-family-index';\n }\n let familyRecs = await dbClient\n .query(qQ)\n .promise()\n .catch(error => { cl(`Error reading FamilyGroups is: ${error}`, qQ); });\n let familyHeader = {};\n let familyMembers = [];\n if (recordExists(familyRecs)) {\n for (const this_familyRec of familyRecs.Items) {\n if (this_familyRec.record_type === 'header') {\n Object.assign(familyHeader, this_familyRec);\n }\n else if (this_familyRec.record_type === 'person') {\n let personRec = await getPerson(this_familyRec.person_id, '*all', true);\n let sessionRec = await getSession(this_familyRec.person_id);\n delete sessionRec.last_state;\n delete personRec.last_state;\n let this_columnNumber = familyMembers.push(Object.assign({}, this_familyRec, sessionRec, personRec)) - 1;\n if (this_familyRec.person_id === state.session.person_id) {\n reactData.selectedColumn = this_columnNumber;\n }\n }\n };\n }\n if (familyMembers.length === 0) {\n onClose();\n }\n if (isEmpty(familyHeader)) {\n const lastName = familyMembers[0]?.name?.last;\n familyHeader = {\n family_name: (lastName ? `The ${lastName} Family` : 'Our Family'),\n record_type: 'header',\n };\n }\n if (!familyHeader.hasOwnProperty('role')) {\n familyHeader.role = 'family';\n }\n const may_create = (state.session.hasOwnProperty('account_types')) ? state.session.account_types[reactData.myRole].may_create : [];\n const accountTypeList = () => {\n if (!may_create) { return []; }\n return [may_create].flat().map(this_type => {\n return {\n value: this_type,\n label: state.session.account_types[this_type].description\n };\n });\n }\n ;\n if (!reactData.defaults.noFamilyColumn) {\n updateReactData({\n familyMembers: [familyHeader].concat(familyMembers),\n selectedColumn: reactData.selectedColumn || 0,\n accountTypeList\n }, false);\n }\n else {\n updateReactData({\n familyMembers,\n selectedColumn: reactData.selectedColumn || 0,\n accountTypeList\n }, false);\n }\n const this_formList = await makeFormList({\n selectedColumn: reactData.selectedColumn,\n client_id: state.session.client_id,\n role: reactData.familyMembers[0].role\n });\n updateReactData({\n formList: this_formList\n }, false);\n return {};\n };\n\n React.useEffect(() => {\n async function initialize() {\n updateReactData({ stage: 'initializing' }, false);\n await initialLoad();\n updateReactData({ stage: 'ready' }, true);\n }\n if (reactData.stage === 'start') {\n initialize();\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n function getRefValue({ selectedColumn, form_index, refField }) {\n let refValue;\n // is this value already on the current form?\n refValue = reactData.columnForms[selectedColumn][form_index].fields[refField]?.value?.data_value;\n if (!refValue) {\n // does it exist anywhere in the family column?\n for (let ndx = 0; ((ndx < reactData.columnForms[0].length) && !refValue); ndx++) {\n refValue = reactData.columnForms[0][ndx].fields[refField]?.value?.data_value;\n }\n }\n if (!refValue) {\n // does it exist on another form in this column?\n for (let ndx = 0; ((ndx < reactData.columnForms[selectedColumn].length) && !refValue); ndx++) {\n if (ndx !== form_index) {\n refValue = reactData.columnForms[selectedColumn][ndx].fields[refField]?.value?.data_value;\n }\n }\n }\n return refValue;\n }\n\n function prepareField({ selectedColumn, form_index, field_name, editMode }) {\n let fieldData = reactData.columnForms[selectedColumn][form_index].fields[field_name];\n let prompt = fieldData.prompt.ref;\n let data_value = fieldData.value.data_value;\n if (fieldData.value.hidden && fieldData.edit && fieldData.edit.reset && editMode) {\n data_value = null;\n }\n if ((!fieldData.value) || (!data_value)) {\n // in edit mode, default value comes from fieldData.edit\n if (editMode || fieldData.loaded) {\n fieldData.default = fieldData.edit;\n }\n // No value; does it have a default value?\n if (fieldData.default) {\n if (!data_value) {\n // does the referenced field exist on ANY other form? (default ref must be a string)\n if (typeof (fieldData.default.ref) === 'string') {\n data_value = getRefValue({ selectedColumn, form_index, refField: fieldData.default.ref });\n }\n }\n if (!data_value) {\n // does the default reference exist in a database table we retrieved?\n // refs gives you the name of the field - or array with structure as in name.first is ['name','first'] \n let refs = makeArray(fieldData.default.ref);\n if (refs.length > 0) {\n // familyMembers has already been loaded with SessionsV2 and People rec info for this person\n // if the field name referenced in refs is in familyMembers for this person, we'll use the\n // value from familyMembers as the default value for this column/person\n data_value = refs.reduce((remainingData, this_ref) => {\n if (this_ref === 'personRec') { return remainingData; }\n if (!remainingData) { return null; }\n return remainingData[this_ref];\n }, reactData.familyMembers[selectedColumn]);\n // if we weren't able to set a default based on the person's individual familyMembers record,\n // see if the field referenced in refs happens to be in the family information column\n // Family information is stored in the FamilyGroups \"header\" record.\n if (!data_value && (selectedColumn !== 0)) {\n data_value = refs.reduce((remainingData, this_ref) => {\n if (!remainingData) { return null; }\n return remainingData[this_ref];\n }, reactData.familyMembers[0]);\n }\n }\n }\n if (data_value) {\n // we got a value from the default.ref\n // does that value need to be manipulated based on the default type?\n switch (fieldData.default.type) {\n case 'ID': {\n let refWords = data_value.split(/\\s+/);\n data_value = (refWords[0].replace(/[^a-zA-Z]/, '').slice(0, 1)\n + (refWords[1] ? refWords[1].replace(/[^a-zA-Z]/, '') : '')\n + '-' + state.session.client_id).toLowerCase();\n break;\n }\n case 'first': {\n let refWords = data_value.split(/\\s+/);\n data_value = refWords[0];\n break;\n }\n case 'last': {\n let refWords = data_value.split(/\\s+/);\n refWords.shift();\n data_value = refWords.join(' ');\n break;\n }\n default: { }\n }\n }\n Object.assign(\n fieldData.value,\n cleanValue({\n type: fieldData.value.type || 'text',\n value: data_value\n })\n );\n }\n }\n let error = false;\n if (fieldData.value.required && !data_value) {\n error = `This field is required`;\n prompt += ` - ${error}`;\n }\n if (field_name === 'nickname') {\n reactData.familyMembers[selectedColumn].nickname = data_value || 'New!';\n }\n else if (field_name === 'family_name') {\n reactData.familyMembers[selectedColumn].family_name = data_value || '';\n }\n else if (fieldData?.default?.type === 'ID') {\n reactData.familyMembers[selectedColumn].person_id = data_value;\n reactData.familyMembers[selectedColumn].composite_key = `${reactData.familyMembers[selectedColumn].family_id}%%${data_value}`;\n }\n fieldData.loaded = true;\n let response = [Object.assign({},\n fieldData.value,\n {\n prompt,\n error,\n isBlank: !data_value,\n }\n )];\n return response;\n }\n\n function cleanValue({ type, value }) {\n if (!value) {\n return {\n data_value: '',\n visible_value: '',\n raw_value: value,\n type\n };\n }\n switch (type) {\n case 'phone': {\n let allNums = (`${value}`.match(/[^\\D]/g, \"\") || []).join(\"\");\n return {\n data_value: `+1${allNums.slice(-10)}`,\n visible_value: `(${allNums.slice(-10, -7)}) ${allNums.slice(-7, -4)}-${allNums.slice(-4)}`,\n raw_value: value,\n type\n };\n }\n default: {\n return {\n data_value: value,\n visible_value: value,\n raw_value: value,\n type\n };\n }\n }\n }\n\n const identifyNewAccountForm = ({ role }) => {\n if (reactData.defaults.hasOwnProperty('roles')) {\n if (reactData.defaults.roles.hasOwnProperty(role)) {\n return reactData.defaults.roles[role].form_if_new || state.session.new_account_form || 'new_account_form';\n }\n }\n return ((role === 'caregiver') ? 'new_caregiver_form' : 'new_camper_form');\n };\n\n function selectAForm({ selectedColumn, form_index, showCompleted }) {\n if (reactData.columnForms[selectedColumn][form_index].isChecked) {\n reactData.columnForms[selectedColumn][form_index].isChecked = false;\n }\n else {\n for (let ndx = 0; ndx < reactData.columnForms[selectedColumn].length; ndx++) {\n reactData.columnForms[selectedColumn][ndx].isChecked = false;\n }\n reactData.columnForms[selectedColumn][form_index].isChecked = true;\n }\n updateReactData({\n columnForms: reactData.columnForms,\n showCompleted\n }, true);\n }\n\n async function editColumn({ selectedColumn }) {\n for (let form_index = 0; form_index < reactData.columnForms[selectedColumn].length; form_index++) {\n await editForm({ selectedColumn, form_index, editMode: true });\n }\n }\n\n async function editForm({ selectedColumn, form_index, editMode }) {\n for (const field_name in reactData.columnForms[selectedColumn][form_index].fields) {\n const beforeValue = reactData.columnForms[selectedColumn][form_index].fields[field_name]?.value?.data_value;\n const [afterObj] = prepareField({ selectedColumn, form_index, field_name, editMode });\n if (!reactData.columnForms[selectedColumn][form_index].fields[field_name].value.version) {\n reactData.columnForms[selectedColumn][form_index].fields[field_name].value.version = 1;\n }\n else {\n reactData.columnForms[selectedColumn][form_index].fields[field_name].value.version++;\n }\n afterObj.error = false;\n if (afterObj.data_value !== beforeValue) {\n // data in this field changed\n }\n if (afterObj.required && !afterObj.data_value) {\n reactData.columnForms[selectedColumn][form_index].fields[field_name].value.error = `Please don't leave this blank`;\n }\n };\n updateReactData({\n columnForms: reactData.columnForms,\n familyMembers: reactData.familyMembers\n }, false);\n return ({\n columnForms: reactData.columnForms,\n familyMembers: reactData.familyMembers\n });\n }\n\n async function makeFormList({ selectedColumn, client_id, role }) {\n if (!isEmpty(reactData.columnForms[selectedColumn])) {\n return reactData.columnForms[selectedColumn];\n }\n reactData.columnForms[selectedColumn] = [];\n let form_index = -1;\n let formObjList = [];\n if (reactData.defaults.hasOwnProperty('forms') && reactData.defaults.forms[role]) {\n formObjList = reactData.defaults?.forms[role].map(this_obj => {\n return this_obj;\n });\n }\n else {\n formObjList = makeArray(state.session.account_types[role].forms);\n }\n if (formObjList.length === 0) {\n // you are asking for a form that was not named in the passed-in defaults,\n // build out a basic form with minimal info\n reactData.columnForms[selectedColumn] = [{\n client_id: state.session.client_id,\n fields: {},\n form_name: 'No Forms Available',\n isChecked: true,\n sections: []\n }];\n updateReactData({ columnForms: reactData.columnForms }, false);\n }\n else {\n for (let this_formObj of formObjList) {\n // is there an active form for this person?\n let queryObj = {\n KeyConditionExpression: 'pertains_to = :p and begins_with(formType_date, :f)',\n ScanIndexForward: false,\n IndexName: 'pertains_to-formType_date-index',\n Limit: 1,\n ExpressionAttributeValues: {\n ':p': reactData.familyMembers[selectedColumn].person_id,\n ':f': `${this_formObj.form_id}%%`\n }\n };\n queryObj.TableName = 'CompletedDocuments';\n let existingCompleteRecs = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n let existingComplete;\n let existingWIP = false;\n if (recordExists(existingCompleteRecs)) {\n // there IS a completed form for this person\n existingComplete = existingCompleteRecs.Items[0];\n }\n else {\n existingComplete = false;\n }\n // Load form info - needed below\n let this_form = await getForm(this_formObj.form_id);\n // Check for an exising WIP form\n queryObj = {\n KeyConditionExpression: 'pertains_to = :p and begins_with(formType_date, :f)',\n ScanIndexForward: false,\n TableName: 'DocumentsInProcess',\n IndexName: 'pertains_to-formType_date-index',\n Limit: 1,\n ExpressionAttributeValues: {\n ':p': reactData.pertains_to,\n ':f': `${this_formObj.form_id}%%`\n }\n };\n let queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} is ${error}`);\n });\n if (recordExists(queryResult)) {\n existingWIP = {\n document_id: queryResult.Items[0].document_id,\n date_started: makeDate(queryResult.Items[0].formType_date.split('%%')[1]).dateOnly\n };\n }\n else if (this_formObj.assign) {\n let nowTime = makeDate('today');\n const document_id_toBeAssigned = `${reactData.familyMembers[selectedColumn].person_id}%%${this_formObj.form_id}%%${nowTime.dateOnly}`;\n const myName = makeName(reactData.familyMembers[selectedColumn].person_id);\n await dbClient\n .put({\n Item: {\n client_id: state.session.client_id,\n document_id: document_id_toBeAssigned,\n form_id: this_formObj.form_id,\n formType: this_formObj.form_id,\n formType_date: `${this_formObj.form_id}%%${nowTime.timestamp}`,\n title: `${this_form.form_name} for ${myName}`,\n pertains_to: reactData.familyMembers[selectedColumn].person_id,\n date_assigned: nowTime.timestamp\n },\n TableName: \"DocumentsAssigned\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating DocumentsAssigned; error is:`, error);\n });\n await dbClient\n .put({\n Item: {\n document_id: document_id_toBeAssigned,\n person_id: '*status',\n client_id: state.session.client_id,\n formType: this_formObj.form_id,\n last_update: nowTime.timestamp,\n status: 'assigned'\n },\n TableName: \"DocumentXRef\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating DocumentXRef; error is:`, error);\n });\n await dbClient\n .put({\n Item: {\n document_id: document_id_toBeAssigned,\n person_id: reactData.familyMembers[selectedColumn].person_id,\n role: 'pertains_to'\n },\n TableName: \"DocumentXRef\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Calendar; error is:`, error);\n });\n }\n // Set up for a new form in case we need it \n if (this_form?.options?.anonymous) {\n reactData.newAccountForm[role] = this_form;\n updateReactData({\n newAccountForm: reactData.newAccountForm\n }, false);\n }\n if (isEmpty(this_form)) {\n form_index++;\n reactData.columnForms[selectedColumn][form_index] = { asForm: true };\n }\n else {\n form_index++;\n reactData.columnForms[selectedColumn][form_index] = deepCopy(this_form);\n reactData.columnForms[selectedColumn][form_index].asForm = true;\n reactData.columnForms[selectedColumn][form_index].useFamilyID = this_formObj.form_id.useFamilyID || false;\n let response = await editForm({ selectedColumn, form_index, editMode: false });\n reactData.columnForms = response.columnForms;\n }\n reactData.columnForms[selectedColumn][form_index].existingComplete = existingComplete;\n reactData.columnForms[selectedColumn][form_index].existingWIP = existingWIP;\n reactData.columnForms[selectedColumn][form_index].form_status = (existingComplete ? 'complete' : (existingWIP ? 'started' : 'not_started'));\n reactData.columnForms[selectedColumn][form_index].isChecked = false;\n }\n }\n // updateReactData({ columnForms: reactData.columnForms }, false);\n return reactData.columnForms[selectedColumn];\n //\n /* Functions used exclusively in makeFormList */\n //\n async function getForm(form_id) {\n let formRec = await dbClient\n .get({\n Key: {\n client_id,\n form_id\n },\n TableName: \"Forms\"\n })\n .promise()\n .catch(error => {\n cl(`Error getting Forms is: ${error}`, form_id);\n });\n if (!recordExists(formRec)) {\n return {};\n }\n else {\n return formRec.Item;\n }\n }\n }\n\n async function saveAndClose() {\n // get each column\n let column_index = -1;\n for (const this_column of reactData.familyMembers) {\n column_index++;\n if (this_column.record_type === 'header') {\n if (reactData.columnForms[column_index]) {\n let familyRec = deepCopy(this_column);\n for (const this_form of reactData.columnForms[column_index]) {\n Object.keys(this_form.fields).forEach(this_field => {\n familyRec[this_field] = this_form.fields[this_field].value.data_value;\n });\n }\n let familyIn = await dbClient\n .get({\n Key: {\n client_id: familyRec.client_id,\n composite_key: familyRec.composite_key\n },\n TableName: 'FamilyGroups'\n })\n .promise()\n .catch(error => { cl(`Error reading FamilyGroups is: ${error}`); });\n await dbClient\n .put({\n Item: Object.assign({}, familyIn.Item, familyRec),\n TableName: 'FamilyGroups'\n })\n .promise()\n .catch(error => { cl(`Error reading FamilyGroups is: ${error}`); });\n }\n }\n else if (this_column.record_type === 'person') {\n // for each person, we're updating three tables: People, SessionsV2, and FamilyGroups \n if (reactData.columnForms[column_index]) {\n // for each person's form info, we're going to load each of these table records with\n // data from the form, as specified in the form field's value.saveAs key\n let saveObj = {\n personRec: deepCopy(this_column),\n sessionRec: {},\n familyRec: {}\n };\n // remove? let sessionRec = deepCopy(this_column);\n for (const this_form of reactData.columnForms[column_index]) {\n // eslint-disable-next-line\n Object.keys(this_form.fields).forEach(this_field => {\n if (this_form.fields[this_field].value.data_value) {\n let all_ar = makeHandlerArray({ this_field, valueObj: this_form.fields[this_field].value });\n all_ar.forEach(ar => {\n saveObj = resolveValues(\n saveObj,\n ar,\n this_form.fields[this_field].value.data_value\n );\n });\n }\n });\n }\n if (!saveObj.personRec.person_id) {\n // new account => \n }\n let personIn = await dbClient\n .get({\n Key: {\n person_id: saveObj.personRec.person_id\n },\n TableName: 'People'\n })\n .promise()\n .catch(error => { cl(`Error reading People is: ${error}`); });\n let sessionIn = await dbClient\n .get({\n Key: {\n session_id: saveObj.personRec.person_id\n },\n TableName: 'SessionsV2'\n })\n .promise()\n .catch(error => { cl(`Error reading SessionV2 is: ${error}`); });\n if (!recordExists(personIn)) {\n if (saveObj.personRec.display_name) {\n let words = saveObj.personRec.display_name.split(/\\s+/);\n saveObj.personRec.first = words.shift();\n if (words) { saveObj.personRec.last = words.join(' '); }\n }\n personIn = {\n Item:\n {\n \"person_id\": saveObj.personRec.person_id,\n \"clients\": {\n \"groups\": [\n \"ALL\",\n \"__TOP__\"\n ],\n \"id\": saveObj.personRec.client_id\n },\n \"client_id\": saveObj.personRec.client_id,\n \"directory_option\": \"normal\",\n \"directory_partner\": \"na\",\n \"favorite_activities\": [],\n \"favorite_blocked\": [],\n \"groups\": [\n \"ALL\",\n \"__TOP__\"\n ],\n \"local_data\": {\n },\n \"location\": \"\",\n \"messaging\": {\n \"email\": saveObj.personRec.email || saveObj.personRec.eMail,\n \"office\": saveObj.personRec.office,\n \"sms\": saveObj.personRec.sms || saveObj.personRec.text,\n \"voice\": saveObj.personRec.voice\n },\n \"name\": {\n \"first\": saveObj.personRec.first,\n \"last\": saveObj.personRec.last\n },\n \"preferred_method\":\n (saveObj.personRec.email || saveObj.personRec.eMail)\n ? \"email\"\n : ((saveObj.personRec.sms || saveObj.personRec.text)\n ? \"sms\"\n : (saveObj.personRec.voice || saveObj.personRec.office)\n ? \"voice\"\n : \"AVA\"),\n \"pwdReset\": false,\n \"requirePassword\": false,\n \"search_data\": saveObj.personRec.display_name.toLowerCase(),\n \"storePassword\": false,\n \"subscription_status\": \"na\",\n }\n };\n sessionIn = {\n \"Item\":\n {\n \"session_id\": saveObj.personRec.person_id,\n \"assigned_to\": \"\",\n \"client_id\": saveObj.personRec.client_id,\n \"current_event\": \"\",\n \"customizations\": {\n \"font_size\": 1\n },\n \"groups_managed\": [\n ],\n \"kiosk_mode\": false,\n \"last_login\": \"\",\n \"method\": \"initial_load\",\n \"password_change_date\": \"\",\n \"patient_display_name\": saveObj.personRec.display_name,\n \"patient_id\": saveObj.personRec.person_id,\n \"person_id\": saveObj.personRec.person_id,\n \"platform\": \"Win32\",\n \"requirePassword\": false,\n \"responsible_for\": [\n ],\n \"status\": {\n \"environment\": \"L\",\n \"signin_status\": \"never\",\n \"source\": \"Family Maintenance\",\n \"time\": \"\",\n \"version\": \"\"\n },\n \"storePassword\": false,\n \"subscription_status\": \"na\",\n \"url_parameters\": \"\",\n \"user_display_name\": saveObj.personRec.display_name,\n \"user_homeClient\": saveObj.personRec.client_id,\n \"user_id\": saveObj.personRec.person_id\n }\n };\n }\n await dbClient\n .put({\n Item: Object.assign({}, personIn.Item, saveObj.personRec),\n TableName: 'People'\n })\n .promise()\n .catch(error => { cl(`Error writing People is: ${error}`); });\n await dbClient\n .put({\n Item: Object.assign({}, sessionIn.Item, saveObj.sessionRec),\n TableName: 'SessionsV2'\n })\n .promise()\n .catch(error => { cl(`Error writing SessionsV2 is: ${error}`); });\n if (this_column.composite_key !== (`${this_column.family_id}%%${saveObj.personRec.person_id}`)) {\n await dbClient\n .delete({\n Key: {\n client_id: this_column.client_id,\n composite_key: this_column.composite_key\n },\n TableName: 'FamilyGroups'\n })\n .promise()\n .catch(error => { cl(`Error deleting FamilyGroups is: ${error}`); });\n }\n const familyOut = {\n client_id: saveObj.personRec.client_id,\n composite_key: `${this_column.family_id}%%${saveObj.personRec.person_id}`,\n family_id: this_column.family_id,\n nickname: saveObj.personRec.nickname,\n person_id: saveObj.personRec.person_id,\n record_type: 'person',\n role: saveObj.personRec.role || reactData.defaults.role_if_new || 'member'\n };\n await dbClient\n .put({\n Item: Object.assign({}, familyOut, saveObj.familyRec),\n TableName: 'FamilyGroups'\n })\n .promise()\n .catch(error => { cl(`Error reading FamilyGroups is: ${error}`); });\n }\n }\n }\n onClose();\n\n function makeHandlerArray({ this_field, valueObj }) {\n let workList;\n if (!valueObj.saveAs) { workList = [['personRec', this_field]]; }\n else if (typeof (valueObj.saveAs) === 'string') {\n workList = [['personRec', valueObj.saveAs]];\n }\n else {\n workList = handleArray(valueObj.saveAs);\n };\n return workList;\n\n function handleArray(arrayToHandle) {\n let workIndex = 0;\n let response = [];\n arrayToHandle.forEach(this_entry => {\n if (typeof (this_entry) === 'string') {\n if (!response[workIndex] || (response[workIndex].length === 0)) {\n if (!['personRec', 'person', 'sessionRec', 'session', 'familyRec', 'family'].includes(this_entry)) {\n response[workIndex] = ['personRec', this_entry];\n }\n else {\n response[workIndex] = [`${this_entry}${((this_entry.slice(-3) !== 'Rec') ? 'Rec' : '')}`];\n }\n }\n else {\n response[workIndex].push(this_entry);\n }\n }\n else {\n // this_entry is an array\n let subArray = handleArray(this_entry);\n if (!response[workIndex] || (response[workIndex].length === 0)) {\n response[workIndex] = subArray;\n }\n else {\n response[workIndex].push(subArray);\n }\n }\n });\n return response;\n }\n }\n\n function resolveValues(obj, ar, v) {\n let oWork = obj;\n ar.forEach((o, nDx) => {\n if (Array.isArray(o)) {\n resolveValues(obj, o, v);\n }\n else {\n const last = (nDx === (ar.length - 1));\n oWork = checkObj(oWork, o, last, v);\n }\n });\n console.log(oWork);\n oWork = v;\n console.log(obj);\n return obj;\n\n function checkObj(oIn, key, last, value) {\n console.log(`checking ${key}`, oIn);\n if (!Object.keys(oIn).includes(key)) {\n oIn[key] = {};\n }\n if (last) {\n oIn[key] = value;\n }\n return oIn[key];\n }\n }\n };\n\n const makeScreenName = () => {\n if (reactData.familyMembers.length === 1) {\n var personName = (reactData.familyMembers[0].nickname || reactData.familyMembers[0].name?.first).trim();\n if (personName) {\n return `${personName}'${personName.endsWith('s') ? '' : 's'} Forms`;\n }\n }\n else {\n return 'My Group';\n }\n };\n\n const makeFormRequest = ({ form_index, showCompleted }) => {\n let response = {\n form_id: reactData.columnForms[reactData.selectedColumn][form_index].form_id,\n document_title: reactData.columnForms[reactData.selectedColumn][form_index].form_name,\n };\n if (reactData.columnForms[reactData.selectedColumn][form_index].useFamilyID) {\n response.family_id = reactData.family_id;\n }\n else {\n response.person_id = reactData.familyMembers[reactData.selectedColumn].person_id;\n }\n if (showCompleted) {\n response.document_id = reactData.columnForms[reactData.selectedColumn][form_index].existingComplete.document_id;\n }\n return response;\n };\n\n // **************************\n\n return (\n \n { /* MAIN */}\n \n {/* Header with Avatar, Message, and VertMenu */}\n \n \n \n {makeScreenName()}\n \n \n {\n handleClick(event);\n setPopupMenuOpen(true);\n }}>\n \n \n { setPopupMenuOpen(false); }}\n keepMounted\n >\n \n {\n onClose();\n }}>\n \n \n \n {'Go to AVA Menu'}\n \n \n \n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n {`User ${state.session.user_id}${state.session.patient_id !== state.session.user_id ? (' (' + state.session.patient_id + ')') : ''}`}\n {`Function: FamilyMaintenance`}\n \n \n \n \n \n\n { /* Selection Row */}\n {(reactData.familyMembers.length > 0) &&\n \n {(reactData.familyMembers.length > 1) &&\n 5) ? 'scroll' : null}\n key={'peopleSelectionBox'}\n id={'peopleSelectionBox'}\n className={classes.listItemSticky}\n >\n \n \n \n {'Select'}\n \n {reactData.familyMembers.map((this_column, this_columnNumber) => (\n \n {(this_column.record_type === 'header')\n ?\n \n {(this_column.family_name || 'My Family').split(/\\s+/).map((this_word, wX) => (\n \n {this_word.slice(0, 10)}\n \n ))}\n \n :\n \n \n \n {(this_column.nickname || this_column?.name?.first || 'New Person').split(/\\s+/).map((this_word, wX) => (\n \n {this_word.slice(0, 10)}\n \n ))}\n \n \n }\n {\n // changing columns - run a final edit on the one you are leaving\n await editColumn({ selectedColumn: reactData.selectedColumn });\n const this_formList = await makeFormList({\n selectedColumn: this_columnNumber,\n client_id: state.session.client_id,\n record_type: reactData.familyMembers[this_columnNumber].record_type,\n role: reactData.familyMembers[this_columnNumber].role\n });\n updateReactData({\n selectedColumn: this_columnNumber,\n formList: this_formList\n }, true);\n }}\n disableRipple\n className={classes.radioButton}\n size='small'\n />\n \n ))}\n \n \n \n }\n {!reactData.defaults.suppressAddPerson && reactData.accountTypeList && (reactData.accountTypeList.length > 0) &&\n {\n updateReactData({\n addDocPrompt: true,\n }, true);\n }}\n >\n \n \n }\n \n }\n\n { /* Data rows */}\n \n \n {(reactData.familyMembers.length > 0)\n && reactData.formList\n && (reactData.selectedColumn != null)\n &&\n \n {reactData.formList.map((this_form, form_index) => (\n \n \n \n {reactData.columnForms[reactData.selectedColumn][form_index].existingComplete\n ? {\n selectAForm({ selectedColumn: reactData.selectedColumn, form_index, showCompleted: true });\n }}\n disableRipple\n className={classes.radioButton}\n size='small'\n />\n : {\n selectAForm({ selectedColumn: reactData.selectedColumn, form_index, showCompleted: false });\n }}\n disableRipple\n className={classes.radioButton}\n size='small'\n />\n }\n {\n selectAForm({ selectedColumn: reactData.selectedColumn, form_index, showCompleted: !!reactData.columnForms[reactData.selectedColumn][form_index].existingComplete });\n }}\n disableRipple\n className={classes.radioButton}\n size='small'\n />\n {\n selectAForm({ selectedColumn: reactData.selectedColumn, form_index, showCompleted: !!reactData.columnForms[reactData.selectedColumn][form_index].existingComplete });\n }}\n onContextMenu={async (e) => {\n e.preventDefault();\n let contextText = false;\n if (reactData.columnForms[reactData.selectedColumn][form_index].existingComplete) {\n enqueueSnackbar(

    Completed Document
    \n 1. DocID: {reactData.columnForms[reactData.selectedColumn][form_index].existingComplete.document_id}
    \n 2. FormID: {reactData.columnForms[reactData.selectedColumn][form_index].form_id}
    \n 3. PersonID: {reactData.familyMembers[reactData.selectedColumn].person_id}

    ,\n { variant: 'info', persist: true });\n contextText = true;\n };\n if (reactData.columnForms[reactData.selectedColumn][form_index].existingWIP) {\n enqueueSnackbar(

    WIP Document
    \n 1. DocID: {reactData.columnForms[reactData.selectedColumn][form_index].existingWIP.document_id}
    \n 2. FormID: {reactData.columnForms[reactData.selectedColumn][form_index].form_id}
    \n 3. PersonID: {reactData.familyMembers[reactData.selectedColumn].person_id}
    \n 4. Date Started: {reactData.columnForms[reactData.selectedColumn][form_index].existingWIP.date_started}

    ,\n { variant: 'info', persist: true });\n contextText = true;\n }\n if (!contextText) {\n enqueueSnackbar(
    Nothing started yet
    ,\n { variant: 'info', persist: true });\n }\n }}\n style={AVATextStyle({\n size: 1.5,\n bold: true,\n margin: { left: 1 },\n color: ((reactData.columnForms[reactData.selectedColumn][form_index].existingComplete) ? null : 'red')\n })}\n >\n {this_form.form_name}\n \n \n {reactData.columnForms[reactData.selectedColumn][form_index].isChecked &&\n reactData.columnForms[reactData.selectedColumn][form_index].asForm &&\n {\n reactData.columnForms[reactData.selectedColumn][form_index].isChecked = false;\n if (statusObj.document_status === 'complete') {\n reactData.columnForms[reactData.selectedColumn][form_index].existingComplete = statusObj.recWritten;\n }\n updateReactData({\n columnForms: reactData.columnForms,\n showCompleted: false\n }, true);\n }}\n />\n }\n \n \n ))}\n \n }\n \n \n \n\n {\n reactData.addNewAccountDoc &&\n {\n if (statusObj.document_status !== 'aborted') {\n let newLength = reactData.familyMembers.push(Object.assign({}, reactData.familyMembers[0],\n statusObj.recWritten,\n {\n record_type: 'person',\n role: reactData.roleToAdd,\n nickname: (statusObj.recWritten?.name?.first || `New ${reactData.roleToAdd}`)\n }));\n await makeFormList({\n selectedColumn: newLength - 1,\n client_id: state.session.client_id,\n role: reactData.roleToAdd\n });\n }\n updateReactData({\n addNewAccountDoc: false\n }, true);\n }}\n />\n }\n {\n reactData.addDocPrompt &&\n {\n return `[checkbox]${this_one.label}`;\n })}\n valueText={[\n '', ''\n ]}\n buttonText={'Select'}\n onCancel={() => {\n updateReactData({\n addDocPrompt: false\n }, true);\n }}\n onSave={async (response) => {\n let checkNum = response.findIndex(this_response => { return this_response === 'checked'; });\n if (checkNum === -1) {\n updateReactData({\n addDocPrompt: false\n }, true);\n }\n else {\n let roleToAdd = reactData.accountTypeList[checkNum].value;\n updateReactData({\n addDocPrompt: false,\n addNewAccountDoc: true,\n roleToAdd\n\n }, true);\n }\n }}\n />\n }\n\n { /* Command Area */}\n \n \n { onClose(); }}\n startIcon={}\n >\n {'Exit'}\n \n {\n await editColumn({ selectedColumn: reactData.selectedColumn });\n await saveAndClose();\n }}\n startIcon={}\n >\n {'Finish & Save'}\n \n \n \n \n \n );\n};\n","import React from 'react';\n\nimport { dbClient, cl, recordExists, deepCopy, makeArray, s3, isEmpty, isObject } from '../../util/AVAUtilities';\nimport { AVAclasses, AVATextStyle, AVADefaults } from '../../util/AVAStyles';\nimport { formatPhone, makeName, getPerson, getImage } from '../../util/AVAPeople';\nimport { makeDate } from '../../util/AVADateTime';\nimport AVAConfirm from './AVAConfirm';\nimport { printDocument } from '../../util/AVAMessages';\nimport { getGroupMembers } from '../../util/AVAGroups';\nimport SignatureCanvas from 'react-signature-canvas';\nimport Select from \"react-dropdown-select\";\nimport { useGeolocated } from \"react-geolocated\";\n\nimport { SearchPlaceIndexForPositionCommand, LocationClient } from '@aws-sdk/client-location';\nimport { withAPIKey } from '@aws/amazon-location-utilities-auth-helper';\n\nimport Box from '@material-ui/core/Box';\nimport { Dialog, DialogContent } from '@material-ui/core';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport { FormGroup, FormControlLabel, FormControl, FormLabel } from '@material-ui/core';\n\nimport TextField from '@material-ui/core/TextField';\nimport Button from '@material-ui/core/Button';\n\nimport useSession from '../../hooks/useSession';\nimport { useIdleTimer } from 'react-idle-timer';\n\nconst useStyles = makeStyles(theme => ({\n dialogBox: {\n paddingTop: 0,\n paddingLeft: 0,\n paddingBottom: theme.spacing(1),\n overflowX: 'hidden',\n marginLeft: theme.spacing(2),\n },\n buttonArea: {\n justifyContent: 'space-around',\n minWidth: '100%',\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center'\n },\n formControl: {\n margin: 0,\n paddingTop: 0,\n paddingBottom: 0,\n },\n formControlCheckGroup: {\n marginTop: 0,\n paddingTop: 0,\n },\n formControlTitle: {\n margin: 0,\n marginLeft: 0,\n marginRight: '2px',\n paddingTop: '16px',\n paddingBottom: 0,\n height: 1,\n fontSize: theme.typography.fontSize * 0.8,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: 0,\n marginBottom: 0,\n },\n imageArea: {\n minWidth: '150px',\n maxWidth: '150px'\n },\n formControlDays: {\n margin: 0,\n marginLeft: '-8px',\n marginRight: '2px',\n paddingTop: '16px',\n height: 1,\n fontSize: theme.typography.fontSize * 0.8,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: '10px',\n marginBottom: '25px',\n },\n radioDays: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: '-8px',\n marginRight: '16px',\n '&.MuiInputBase-input': {\n paddingBottom: '0px'\n }\n },\n clientBackground: {\n borderRadius: '30px',\n maxWidth: '95%',\n paddingLeft: '4px',\n paddingRight: '4px',\n marginLeft: '4px',\n marginRight: '4px'\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n inputDisplay: {\n root: {\n '&.MuiInputBase-input': {\n paddingBottom: '0px',\n color: 'red'\n },\n '&.MuiInput-input': {\n paddingBottom: '22px',\n color: 'red'\n },\n '&.Mui-disabled': {\n color: 'black'\n },\n }\n }\n}));\n\nexport default ({ request = {}, onClose }) => {\n const classes = useStyles();\n const AVAClass = AVAclasses();\n const signatureRef = [React.useRef(null), React.useRef(null), React.useRef(null)];\n\n const { state } = useSession();\n\n let options = {};\n if (Array.isArray(request)) {\n request.forEach((req) => {\n if (typeof (req) === 'string') {\n let [key, value] = req.split('=');\n options[key] = value;\n }\n else {\n Object.assign(options, req);\n }\n });\n }\n else if (typeof (request) === 'string') {\n options.form_id = request;\n }\n else {\n options = Object.assign({}, request);\n }\n if (!options.form_id && options.document_id) {\n let docParts = options.document_id.split('%%');\n options.form_id = docParts[1];\n }\n\n /* \n if options.changeMode, then\n - expect options.document_id\n - the form_id comes from the document_id (person %% form_id %% version)\n - all defaults in form_id are ignored; values from incoming document_id are used as defaults\n - if saved, add replaced_by = to the incoming document_id and update that document\n\n if (viewOnly()), then\n - expect options.document_id\n - the form_id comes from the document_id (person %% form_id %% version)\n - all fields rendered in view mode, including signature\n - do not show \"save\" button\n\n if options.printMode, then\n - expect options.document_id\n - the form_id comes from the document_id (person %% form_id %% version)\n - all fields rendered in view mode, including signature\n - do not show \"save\" button\n\n */\n\n const [reactData, setReactData] = React.useState({\n form_id: options.form_id,\n formRec: {},\n peopleList: {},\n initialized: false,\n storedSignature: null,\n stage: 'initialize',\n version__number: 0,\n mode: options.mode || 'new',\n assign_to: options.assign_to,\n savePending: options.mode ? (options.mode === 'incomplete') : (!!options.incompleteMode),\n document: {},\n lastActiveTime: new Date(),\n values: {\n sampleField: {\n valueList: [],\n valueText: ''\n }\n }\n });\n\n const [reactValues, setReactValues] = React.useState({\n defaultObj: {\n valueList: [],\n valueText: '',\n value: ''\n }\n });\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) {\n setForceRedisplay(!forceRedisplay);\n }\n };\n\n const [valuesChangedSinceLastSave, setValuesChangedSinceLastSave] = React.useState(false);\n const updateReactValues = (newData, force = false) => {\n setReactValues((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n setValuesChangedSinceLastSave(true);\n if (force) {\n setForceRedisplay(!forceRedisplay);\n }\n };\n\n const newDocument = () => {\n return !(['view', 'incomplete', 'change', 'print', 'not_started'].includes(reactData.mode));\n };\n\n const viewOnly = () => {\n return (['view', 'print'].includes(reactData.mode));\n };\n\n const loadInitialOptions = () => {\n return (newDocument() || (reactData.mode === 'not_started'));\n };\n\n const oneMinute = 1000 * 60;\n const msBeforeSleeping = 1 * oneMinute;\n\n function onAction() {\n let now = new Date();\n if ((reactData.idleState) || ((now.getTime() - reactData.lastActiveTime.getTime()) > oneMinute)) {\n cl(`Action/Update at ${now.toLocaleString()}. Last active at ${reactData.lastActiveTime.toLocaleString()}`);\n updateReactData({\n lastActiveTime: now,\n idleState: false,\n }, false);\n }\n reset();\n };\n\n const onIdle = async () => {\n let now = new Date();\n let minutesSinceActive = 0;\n let reactUpdObj = {\n idleState: true,\n enteredIdleStateTime: now,\n };\n if (!reactData.idleState) {\n if (!viewOnly()\n && (reactData.stage !== 'initialize')\n && (reactData.stage !== 'still_initializing')\n && valuesChangedSinceLastSave\n ) {\n cl(`Auto save at ${now.toLocaleString()}.`);\n let saveCallObj = {\n save_continue: true\n };\n if (reactData.document_id) {\n saveCallObj.document_id = reactData.document_id;\n }\n let response = await handleSave(saveCallObj);\n reactUpdObj.document_id = response.document_id;\n reactUpdObj.savePending = true;\n\n }\n updateReactData(reactUpdObj, true);\n }\n else {\n minutesSinceActive = Math.floor((now.getTime() - reactData.enteredIdleStateTime.getTime()) / oneMinute);\n cl(`Still idle at ${new Date().toLocaleString()}. Idle for ${minutesSinceActive} minutes.`);\n }\n if (minutesSinceActive > 5) {\n onClose('timeout');\n }\n reset();\n };\n\n const { start, reset } = useIdleTimer({\n onIdle,\n onAction,\n timeout: msBeforeSleeping,\n throttle: 500\n });\n\n const {\n coords,\n getPosition,\n isGeolocationAvailable,\n isGeolocationEnabled,\n positionError,\n } = useGeolocated({\n positionOptions: {\n enableHighAccuracy: true,\n },\n userDecisionTimeout: 5000,\n watchLocationPermissionChange: true,\n });\n\n const reverseGeo = async ({ latitude, longitude, accuracy }) => {\n const authHelper =\n await withAPIKey(\"v1.public.eyJqdGkiOiJiOTFjN2E0My1mZTNlLTQxMzctYTIyMy00YWI2YTE2NjUxZDUifToPc5592CrSHhW1JSbATtnjGoJDzqJYD-7AK7ExQpcAtmfRb-ofIy9TciExqtsveXreYKYPBoGKj8IIpESh8jhu8WcHmPHzYyPwjdMLEj2oc78daTQeGqw41QI-okSYoUMVCRBwO9eGiLsU2adjFXwSNlcs85lz_XAaYLAAKZODPOFTKk4sgI2kJ5queq9aHj4HjOOJfPwWmJZAqP-oTs2TLp-N95yBVllyU7-_6S3QXOI97rSAy5ABj-7fJMZTtXRrb6zw6sv8pJPKjZegaeM8V2oP4fQBMC4bC746aYaNT6SiVtTzIU8tdmrYgHmgkzbSxw_VZSp-UF8_OQIiNwQ.ZWU0ZWIzMTktMWRhNi00Mzg0LTllMzYtNzlmMDU3MjRmYTkx\");\n const locationClient = new LocationClient({\n region: \"us-east-1\",\n ...authHelper.getLocationClientConfig() // sets up the Location client to use the API Key defined above\n });\n let response = await locationClient.send(new SearchPlaceIndexForPositionCommand({\n IndexName: \"explore.place.Here\", // Place index resource to use\n Position: [longitude, latitude], // position to search near\n MaxResults: 3 // number of results to return\n }));\n if (!response || !response.Results || (response.Results.length === 0)) {\n return `at ${formatDegrees(latitude, false)}, ${formatDegrees(longitude, true)}`;\n }\n else {\n let selectedResponse = response.Results.find(result => {\n return (result.Place.AddressNumber);\n });\n if (!selectedResponse) {\n selectedResponse = response.Results[0];\n }\n let textResponse = 'At';\n let netAccuracy = selectedResponse.Distance + accuracy;\n if (netAccuracy > 10) {\n let calcAccuracyFeet = netAccuracy * 3.28;\n if (calcAccuracyFeet > 1000) {\n textResponse = `Within ${Math.round((calcAccuracyFeet / 5280) * 10) / 10} miles of`;\n }\n else {\n textResponse = `Within ${Math.round(calcAccuracyFeet)} feet of`;\n }\n }\n textResponse += ` ${selectedResponse.Place.Label} ${makeDate(new Date()).oaDate}`;\n return textResponse;\n }\n };\n\n // **************************\n\n const makeDefault = async (this_field) => {\n if (!reactData.formRec.fields.hasOwnProperty(this_field)) {\n cl(`${this_field} missing from Form entry`);\n return '';\n }\n let default_peopleList;\n let defaultText = '';\n let defaultValue;\n let default_source, default_ref, prompt_ref;\n if (reactData.formRec.fields[this_field].choose) {\n if (!reactData.peopleList.hasOwnProperty(reactData.formRec.fields[this_field].choose.ref)) {\n if (reactData.formRec.fields[this_field].choose.ref.startsWith('%%resp')) {\n if (!state.session.responsible_for || (state.session.responsible_for.length === 0)) {\n default_peopleList = await getGroupMembers({\n groupList: state.user.person_id,\n short: true\n });\n }\n else {\n default_peopleList = await getGroupMembers({\n groupList: [...state.session.responsible_for, state.user.person_id],\n short: true\n });\n }\n }\n else {\n default_peopleList = await getGroupMembers({\n group_id: reactData.formRec.fields[this_field].choose.ref,\n short: true\n });\n }\n if (default_peopleList && (default_peopleList.length > 0)) {\n reactData.peopleList[reactData.formRec.fields[this_field].choose.ref] =\n default_peopleList.map(person => {\n return {\n value: person.person_id,\n label: person.display_name\n };\n });\n updateReactData({\n peopleList: reactData.peopleList\n }, false);\n }\n }\n else {\n default_peopleList = reactData.peopleList[reactData.formRec.fields[this_field].choose.ref];\n }\n }\n if (!reactData.formRec.fields[this_field].default) {\n if (loadInitialOptions()) {\n return ''; // there is no default specified for this field (in change mode, ignore this - use value instead)\n }\n else {\n default_source = 'form';\n default_ref = reactData.form_id;\n }\n }\n else if (reactData.formRec.fields?.[this_field]?.default?.ref === 'image') {\n default_source = reactData.formRec.fields[this_field].default.source;\n default_ref = 'image';\n }\n else if (!loadInitialOptions()) {\n default_source = 'form';\n default_ref = reactData.form_id;\n if (reactData.formRec.fields[this_field].default.source === 'form' && reactData.formRec.fields[this_field].default.ref !== 'recent') {\n prompt_ref = reactData.formRec.fields[this_field].default.ref;\n }\n }\n else {\n default_source = reactData.formRec.fields[this_field].default.source;\n if (reactData.formRec.fields[this_field].default.ref === 'recent') {\n default_ref = reactData.form_id;\n }\n else {\n default_ref = reactData.formRec.fields[this_field].default.ref;\n }\n }\n // if (reactData.formRec.fields?.[this_field]?.default\n // && reactData.formRec.fields?.[this_field]?.default.hasOwnProperty('assigned_to')) {\n // default_ref += reactData.formRec.fields[this_field].default.assigned_to;\n // }\n if (!default_source) {\n defaultText = (default_ref || '');\n }\n else {\n switch (default_source) {\n case 'form': {\n if (!reactData?.document.hasOwnProperty(default_ref)) {\n let documentsObj = await loadDocument({\n form_id: default_ref,\n recent: true\n });\n updateReactData({\n document: documentsObj\n }, true);\n }\n if (prompt_ref && (prompt_ref !== default_ref) && !reactData.document.hasOwnProperty(prompt_ref)) {\n let documentsObj = await loadDocument({\n form_id: prompt_ref,\n fuzzy_search: `${options.document_id.split('%%')[0]}%%${prompt_ref}%%`,\n });\n updateReactData({\n document: documentsObj\n }, true);\n }\n if (!reactData.document[default_ref]) {\n // no op - the refererenced form doesn't exist\n handleChangeValue({\n newList: [],\n prop: this_field\n });\n return;\n }\n else if ((reactData?.formRec?.fields?.[this_field]?.default?.type === 'assigned_to')\n && (reactData.document[default_ref].hasOwnProperty('assigned__to'))) {\n handleChangeValue({\n newList: reactData.document[default_ref].assigned__to,\n prop: this_field\n });\n return;\n }\n else if (!reactData.document[default_ref][this_field] && loadInitialOptions()) {\n // no op - the refererenced form field has no value on that form\n let newPrompt = reactData.formRec.fields[this_field].prompt.ref.replace('%%default%%', `** None **`);\n reactData.formRec.fields[this_field].prompt.ref = newPrompt;\n handleChangeValue({\n newList: [],\n prop: this_field\n });\n return;\n }\n else {\n if (isObject(reactData.document[default_ref][this_field])) {\n if (reactData.document[default_ref][this_field].hasOwnProperty('timestamp')) {\n let readableTime = makeDate(reactData.document[default_ref][this_field].timestamp).absolute;\n defaultText = `Time: ${readableTime}; Info: ${reactData.document[default_ref][this_field].textDescription}`\n }\n else {\n defaultText = reactData.document[default_ref][this_field].textDescription;\n }\n }\n else {\n defaultText = reactData.document[default_ref][this_field];\n }\n let defaultType = reactData.formRec.fields[this_field]?.default?.type;\n if (!defaultType) {\n defaultType = reactData.formRec.fields[this_field]?.value?.type;\n }\n if (Array.isArray(defaultText)) {\n defaultType = 'selection';\n }\n switch (defaultType) {\n case 'selection': { // special handling here for checkbox selections\n if (reactData.formRec.fields[this_field].value.type.includes('view')) {\n defaultValue = defaultText;\n defaultText = defaultText.join('; ');\n }\n else {\n if (reactData.formRec.fields.hasOwnProperty(this_field)) {\n if (reactData.formRec.fields[this_field].prompt.ref.includes('%%default%%')) {\n if (prompt_ref && (prompt_ref !== default_ref)) {\n let promptText = '';\n if (isObject(reactData.document[prompt_ref][this_field])) {\n promptText = reactData.document[prompt_ref][this_field].textDescription;\n }\n else {\n promptText = reactData.document[prompt_ref][this_field];\n }\n if (!promptText) {\n promptText = '* no value *';\n }\n reactData.formRec.fields[this_field].prompt.ref =\n reactData.formRec.fields[this_field].prompt.ref.replace('%%default%%', makeArray(promptText).join('; '));\n }\n else {\n if (!defaultText) {\n defaultText = '* no value *';\n }\n reactData.formRec.fields[this_field].prompt.ref =\n reactData.formRec.fields[this_field].prompt.ref.replace('%%default%%', makeArray(defaultText).join('; '));\n }\n }\n if (reactData.formRec.fields[this_field].prompt.ignore_if) {\n let ignoreList = makeArray(reactData.formRec.fields[this_field].prompt.ignore_if);\n if ((ignoreList.includes('%%no_data%%') && (defaultText.length === 0))\n || (ignoreList.some(ignore_me => {\n return defaultText.includes(ignore_me);\n }))) {\n delete reactData.formRec.fields[this_field];\n return;\n }\n }\n }\n if (defaultText.length === 0) {\n return '';\n }\n let defaultSelections = defaultText;\n let defaultSelectionList = [];\n let bonusList = [];\n let selectionList = reactData.formRec.fields[this_field]?.value?.selection?.selectionList || [];\n defaultSelections.forEach(this_selection => {\n if (selectionList.includes(this_selection)) {\n defaultSelectionList.push(this_selection);\n }\n else {\n bonusList.push(this_selection);\n }\n });\n if (bonusList.length > 0) {\n handleChangeListText({\n newText: bonusList.join('; '),\n prop: this_field\n });\n }\n if (defaultSelectionList.length === 0) {\n return '';\n }\n handleChangeValue({\n newList: defaultSelectionList,\n prop: this_field\n });\n return defaultSelectionList;\n }\n break;\n }\n case 'signature': {\n updateReactData({\n storedSignature: reactData.document[default_ref][this_field]\n }, false);\n defaultText = `${reactData.formRec.fields[this_field].prompt.ref}: ${defaultText}`;\n defaultValue = reactData.document[default_ref][this_field];\n break;\n }\n case 'geolocation': {\n if (defaultText) {\n defaultText = `${reactData.formRec.fields[this_field].prompt.ref}: ${defaultText}`;\n defaultValue = reactData.document[default_ref][this_field];\n }\n break;\n }\n case 'phone': {\n defaultText = formatPhone(defaultText);\n defaultValue = `+1${defaultText.replace(/\\D/g, '')}`;\n break;\n }\n case 'date': {\n let defaultDate = makeDate(defaultText, { noTime: true, noYearCorrection: true });\n if (defaultDate.error) {\n return '';\n }\n defaultText = defaultDate.absolute;\n defaultValue = defaultDate.numeric$;\n break;\n }\n case 'time': {\n let defaultDate = makeDate(defaultText, { noYearCorrection: true });\n if (defaultDate.error) {\n return '';\n }\n defaultText = defaultDate.absolute;\n defaultValue = defaultDate.timestamp;\n break;\n }\n case 'id': {\n defaultValue = reactData?.document[default_ref][this_field];\n if ((reactData.formRec.fields[this_field].choose)\n && (!viewOnly())) {\n let foundPerson = default_peopleList.find(person => {\n return (person.person_id === defaultValue);\n });\n if (foundPerson) {\n defaultText = foundPerson.display_name;\n }\n else {\n defaultText = '';\n defaultValue = '';\n }\n }\n else {\n let whoIS = await makeName(defaultValue);\n defaultText = whoIS || defaultValue;\n }\n break;\n }\n default: { }\n }\n }\n break;\n }\n case 'date': {\n let defaultDate = makeDate(default_ref, { noTime: true, noYearCorrection: true });\n if (defaultDate.error) {\n return '';\n }\n defaultText = defaultDate.absolute;\n defaultValue = defaultDate.numeric$;\n break;\n }\n case 'time': {\n let defaultDate = makeDate(default_ref, {});\n if (defaultDate.error) {\n return '';\n }\n defaultText = defaultDate.absolute;\n defaultValue = defaultDate.timestamp;\n break;\n }\n\n case 'selection':\n case 'selections':\n case 'values':\n case 'value': {\n let defaultSelections = makeArray(default_ref);\n if (defaultSelections.length === 0) {\n return '';\n }\n let defaultSelectionList = [];\n let bonusList = [];\n defaultSelections.forEach(this_selection => {\n if (reactData.formRec.fields[this_field].value.selection.selectionList.includes(this_selection)) {\n defaultSelectionList.push(this_selection);\n }\n else {\n bonusList.push(this_selection);\n }\n });\n if (bonusList.length > 0) {\n handleChangeListText({\n newText: bonusList.join('; '),\n prop: this_field\n });\n }\n if (defaultSelectionList.length === 0) {\n return '';\n }\n handleChangeValue({\n newList: defaultSelectionList,\n prop: this_field\n });\n return defaultSelectionList;\n }\n case 'user':\n case 'person':\n case 'session':\n case 'userRec':\n case 'sessionRec':\n case 'personRec': {\n let recordID = 'patient';\n if (default_source.startsWith('user')) {\n recordID = 'user';\n }\n else if (default_source.startsWith('session')) {\n recordID = 'session';\n }\n switch (default_ref) {\n case 'display_name': {\n if (recordID === 'patient') {\n defaultText = `${reactData.selectedPersonRec.name?.first} ${reactData.selectedPersonRec.name?.last}`;\n }\n else {\n defaultText = `${state[recordID]?.name?.first} ${state[recordID]?.name?.last}`;\n }\n break;\n }\n case 'image': {\n if (recordID === 'patient') {\n defaultText = getImage(reactData.selectedPersonRec.person_id);\n }\n else {\n defaultText = getImage(state[recordID]?.person_id);\n }\n break;\n }\n case 'phone': {\n let phone;\n if (recordID === 'patient') {\n phone = reactData.selectedPersonRec?.messaging?.voice || reactData.selectedPersonRec?.messaging?.sms;\n }\n else {\n phone = state[recordID]?.messaging?.voice || state[recordID]?.messaging?.sms;\n }\n if (phone) {\n defaultText = formatPhone(phone);\n defaultValue = `+1${defaultText.replace(/\\D/g, '')}`;\n }\n else {\n return '';\n }\n break;\n }\n default: {\n if (recordID === 'patient') {\n defaultText = reactData.selectedPersonRec[default_ref] || '';\n }\n else {\n defaultText = state[recordID][default_ref] || '';\n }\n if ((reactData.formRec.fields[this_field].default.type === 'date') && defaultText) {\n let defaultDate = makeDate(defaultText, { noTime: true, noYearCorrection: true });\n if (defaultDate.error) {\n return '';\n }\n defaultText = defaultDate.absolute;\n defaultValue = defaultDate.numeric$;\n }\n else if ((reactData.formRec.fields[this_field].default.type === 'time') && defaultText) {\n let defaultDate = makeDate(defaultText, {});\n if (defaultDate.error) {\n return '';\n }\n defaultText = defaultDate.absolute;\n defaultValue = defaultDate.timestamp;\n }\n else if ((reactData.formRec.fields[this_field].default.type === 'phone') && defaultText) {\n defaultText = formatPhone(defaultText);\n defaultValue = `+1${defaultText.replace(/\\D/g, '')}`;\n }\n }\n }\n break;\n }\n case 'local': {\n defaultText = state.patient.local_data[default_ref] || '';\n if ((reactData.formRec.fields[this_field].default.type === 'date') && defaultText) {\n let defaultDate = makeDate(defaultText, { noTime: true, noYearCorrection: true });\n if (defaultDate.error) {\n return '';\n }\n defaultText = defaultDate.absolute;\n defaultValue = defaultDate.numeric$;\n }\n else if ((reactData.formRec.fields[this_field].default.type === 'phone') && defaultText) {\n defaultText = formatPhone(defaultText);\n defaultValue = `+1${defaultText.replace(/\\D/g, '')}`;\n }\n break;\n }\n default: {\n defaultText = (default_ref || '');\n }\n }\n }\n if (reactData.formRec.fields[this_field].prompt.ignore_if) {\n let ignoreList = makeArray(reactData.formRec.fields[this_field].prompt.ignore_if);\n if ((ignoreList.includes('%%no_data%%') && (!defaultText || (defaultText.trim() === '')))\n || (ignoreList.some(ignore_me => {\n return (Array.isArray(defaultValue) ? defaultValue.includes(ignore_me) : (defaultValue === ignore_me));\n }))) {\n delete reactData.formRec.fields[this_field];\n return;\n }\n }\n if (reactData.formRec.fields[this_field]?.prompt?.ref\n && reactData.formRec.fields[this_field].prompt.ref.includes('%%default%%')\n ) {\n reactData.formRec.fields[this_field].prompt.ref =\n reactData.formRec.fields[this_field].prompt.ref.replace('%%default%%', defaultText);\n }\n handleChangeValue({\n newText: defaultText,\n newValue: defaultValue,\n prop: this_field\n });\n };\n\n const getDirection = (degrees, isLongitude) =>\n degrees > 0 ? (isLongitude ? \"E\" : \"N\") : isLongitude ? \"W\" : \"S\";\n\n const formatDegrees = (degrees, isLongitude) =>\n `${0 | degrees}° ${0 | (((degrees < 0 ? (degrees = -degrees) : degrees) % 1) * 60)\n }' ${0 | (((degrees * 60) % 1) * 60)}\" ${getDirection(\n degrees,\n isLongitude,\n )}`;\n\n const handleChangeValue = ({ newText, newValue, newList, prop, sentenceCase }) => {\n if (sentenceCase && newText && (newText.length === 1)) {\n newText = newText.toUpperCase();\n }\n let tempObj = {};\n if (reactValues.hasOwnProperty(prop)) {\n tempObj = deepCopy(reactValues[prop]) || {};\n }\n else {\n tempObj = deepCopy(reactValues.defaultObj) || {};\n }\n tempObj.valueText = newText;\n tempObj.valueList = newList;\n tempObj.value = newValue || newList || newText;\n updateReactValues({\n [prop]: tempObj\n }, true);\n if (reactData.formRec.fields[prop].value.assign_to) {\n updateReactData({\n assign_to: tempObj.value\n }, true);\n }\n };\n\n const handleChangeListText = ({ newText, prop }) => {\n let tempObj = {};\n if (reactValues.hasOwnProperty(prop)) {\n tempObj = deepCopy(reactValues[prop]);\n }\n else {\n tempObj = deepCopy(reactValues.defaultObj);\n }\n tempObj.bonusText = newText;\n updateReactValues({\n [prop]: tempObj\n }, true);\n };\n\n const handleClick = (props) => {\n if (!reactValues[props.prop]) {\n if (!props.forceClickOff) {\n reactValues[props.prop] = {\n valueList: [props.clickText]\n };\n }\n }\n else if (!reactValues[props.prop].hasOwnProperty('valueList')) {\n if (!props.forceClickOff) {\n reactValues[props.prop].valueList = [props.clickText];\n }\n }\n else {\n if (props.ogText) {\n let ogAt = reactValues[props.prop].valueList.indexOf(props.ogText);\n if (ogAt > -1) {\n reactValues[props.prop].valueList.splice(ogAt, 1);\n }\n }\n if (!reactValues[props.prop].valueList) {\n reactValues[props.prop].valueList = [];\n }\n let foundAt = reactValues[props.prop].valueList.indexOf(props.clickText);\n if (foundAt < 0) {\n reactValues[props.prop].valueList.push(props.clickText);\n if (reactData.formRec.fields[props.prop].value.selection.max) {\n if (reactValues[props.prop].valueList.length > reactData.formRec.fields[props.prop].value.selection.max) {\n reactValues[props.prop].valueList.shift();\n }\n }\n }\n else {\n if (!props.forceClickOn) {\n if (reactData.formRec.fields[props.prop].value.selection.min) {\n if (reactValues[props.prop].valueList.length > reactData.formRec.fields[props.prop].value.selection.min) {\n reactValues[props.prop].valueList.splice(foundAt, 1);\n }\n }\n else {\n reactValues[props.prop].valueList.splice(foundAt, 1);\n }\n }\n }\n }\n handleChangeValue({\n newList: reactValues[props.prop].valueList,\n prop: props.prop\n });\n };\n\n // **************************\n\n const AVACheckBoxGroup = (props) => {\n // props should contain\n // prop\n // text - an array of options, each can independently go true or false\n return (\n \n \n {reactData.formRec.fields[props.prop].prompt.ref}\n \n \n {(props.text).map((text, tIndex) => (\n {\n handleClick({\n clickText: text,\n prop: props.prop\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n }\n label={{text}}\n labelPlacement='end'\n />\n ))}\n {reactData.formRec.fields[props.prop].value.type.includes('other') &&\n {\n handleClick({\n clickText: reactValues[props.prop].valueText,\n prop: props.prop\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n }\n label={ {\n let ogText = ((reactValues[props.prop] && reactValues[props.prop].valueText)\n ? reactValues[props.prop].valueText\n : ''\n );\n handleChangeValue({\n newText: event.target.value,\n prop: props.prop,\n sentenceCase: false\n });\n if (!reactValues[props.prop].valueText) {\n handleClick({\n clickText: '',\n prop: props.prop,\n ogText,\n forceClickOff: true\n });\n }\n else {\n handleClick({\n clickText: reactValues[props.prop].valueText,\n prop: props.prop,\n ogText,\n forceClickOn: true\n });\n }\n if (event.relatedTarget) {\n event.relatedTarget.focus({ focusVisible: true });\n if (event.relatedTarget.type !== 'button') {\n event.relatedTarget.click();\n }\n }\n }}\n helperText={reactData.formRec.fields[props.prop].prompt.other || 'Other'}\n />}\n labelPlacement='right'\n />\n }\n {reactData.formRec.fields[props.prop].value.type.includes('text') &&\n {\n handleChangeListText({\n newText: event.target.value,\n prop: props.prop,\n });\n if (event.relatedTarget) {\n event.relatedTarget.focus({ focusVisible: true });\n if (event.relatedTarget.type !== 'button') {\n event.relatedTarget.click();\n }\n }\n }}\n helperText={reactData.formRec.fields[props.prop].prompt.other || 'Other'}\n />\n }\n />\n }\n \n \n );\n };\n\n // **************************\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n const handleAbort = () => {\n onClose();\n };\n\n const handleReview = async () => {\n let messageList = ['There are problems with this form'];\n let errorFields = [];\n reactData.formRec.sections.forEach(this_section => {\n this_section.fields.forEach(this_field => {\n if (reactData.formRec.fields.hasOwnProperty(this_field)) {\n if (reactData.formRec.fields[this_field].value.type === 'signature') {\n if (signatureRef[reactData.formRec.fields[this_field].sigRefNumber || 0].current.isEmpty()) {\n if (reactData.formRec.fields[this_field].value.required) {\n messageList.push(`${reactData.formRec.fields[this_field].prompt.ref || 'Signature'} is required`);\n errorFields.push(this_field);\n }\n }\n else {\n if (!reactValues.hasOwnProperty(this_field)) {\n reactValues[this_field] = {};\n }\n let sigImage = signatureRef[reactData.formRec.fields[this_field].sigRefNumber || 0].current.getTrimmedCanvas().toDataURL('image/png');\n reactValues[this_field].image = sigImage;\n reactValues[this_field].value = sigImage;\n }\n }\n else if (reactData.formRec.fields[this_field].value.required\n && (!reactValues.hasOwnProperty(this_field) || !reactValues[this_field].value)) {\n messageList.push(`${reactData.formRec.fields[this_field].prompt.ref} is required`);\n errorFields.push(this_field);\n }\n else if ((reactData.formRec.fields[this_field].value.type.startsWith('select'))\n && (reactData.formRec.fields[this_field].value?.selection?.min > 0)) {\n if (!reactValues.hasOwnProperty(this_field) || !reactValues[this_field].value || (reactValues[this_field].value.length === 0)) {\n messageList.push(`Please make a selection for ${reactData.formRec.fields[this_field].prompt.ref}`);\n errorFields.push(this_field);\n }\n else if (reactValues[this_field].value.length < reactData.formRec.fields[this_field].value.selection.min) {\n messageList.push(`You must make at least ${reactData.formRec.fields[this_field].value.selection.min} selections for ${reactData.formRec.fields[this_field].prompt.ref}`);\n errorFields.push(this_field);\n }\n }\n }\n });\n });\n if (errorFields.length === 0) {\n messageList = ['This form is complete!', 'Tap \"Save\" below to save it'];\n }\n updateReactData({\n messageList,\n errorFields,\n stage: 'confirm'\n }, true);\n };\n\n const handleSave = async ({ document_id, save_continue }) => {\n let documentRec = {\n client_id: state.session.client_id,\n };\n if (document_id) {\n let foundDoc = await dbClient\n .get({\n Key: {\n client_id: state.session.client_id,\n document_id\n },\n TableName: \"Documents\"\n })\n .promise()\n .catch(error => {\n cl(`Error reading Documents as part of handleSave: ${error}`, document_id);\n });\n if (!recordExists(foundDoc)) {\n documentRec = {\n client_id: state.session.client_id,\n document_id\n };\n }\n else {\n documentRec = foundDoc.Item;\n }\n }\n documentRec.completed_by = state.session.user_id;\n if (reactData.assign_to) {\n if (!documentRec.assigned_to) {\n documentRec.assigned_to = [reactData.assign_to];\n }\n else if (!Array.isArray(documentRec.assigned_to)) {\n documentRec.assigned_to = [documentRec.assigned_to];\n }\n else {\n documentRec.assigned_to.push(reactData.assign_to);\n }\n }\n if (reactData.formRec.title && !reactData.document[reactData.form_id].document__title) {\n let titleFields = reactData.formRec.title.split('%%');\n let results = '';\n titleFields.forEach(titleWord => {\n if (reactData.formRec.fields.hasOwnProperty(titleWord)) {\n results += ' ' + ((reactValues[titleWord] && reactValues[titleWord].valueText)\n ? reactValues[titleWord].valueText\n : reactData.formRec.fields[titleWord].defaultText\n );\n }\n else {\n results += ' ' + titleWord;\n }\n });\n documentRec.title = results;\n }\n else {\n if (reactData?.document?.[reactData.form_id]?.document__title) {\n documentRec.title = reactData.document[reactData.form_id].document__title;\n }\n else {\n documentRec.title = `${reactData.formRec.form_name} - completed ${makeDate(new Date()).absolute}`;\n }\n }\n if (document_id) {\n let docParts = document_id.split('%%');\n documentRec.form_id = docParts[1];\n documentRec.person_id = docParts[0];\n documentRec.completed_timestamp = new Date().getTime();\n documentRec.document_id = document_id;\n }\n else {\n documentRec.form_id = reactData.form_id;\n documentRec.person_id = options.person_id || state.patient.person_id;\n documentRec.completed_timestamp = new Date().getTime();\n documentRec.document_id = `${documentRec.person_id}%%${documentRec.form_id}%%${documentRec.completed_timestamp}`;\n }\n documentRec.incomplete = !!save_continue;\n documentRec.values = {};\n delete reactValues.defaultObj;\n let putError = [];\n for (let this_field in reactValues) {\n if (reactData.formRec.fields?.[this_field]?.value?.type === 'signature') {\n if (reactValues[this_field].image) {\n await s3\n .upload({\n Bucket: 'theseus-medical-storage',\n Key: `${documentRec.completed_by}_signature`,\n Body: reactValues[this_field].image,\n ACL: 'public-read-write',\n ContentType: 'image/png'\n })\n .promise()\n .catch(err => {\n putError.push(err);\n });\n documentRec.values[this_field] = reactValues[this_field].image;\n if (!documentRec.signature_field) {\n documentRec.signature_field = [];\n }\n documentRec.signature_field[reactData.formRec.fields[this_field].sigRefNumber || 0] = this_field;\n }\n }\n else if (reactValues[this_field].bonusText) {\n let valueArray = makeArray(reactValues[this_field].value);\n valueArray.push(reactValues[this_field].bonusText);\n documentRec.values[this_field] = valueArray;\n }\n else {\n documentRec.values[this_field] = reactValues[this_field].value;\n }\n }\n await dbClient\n .put({\n Item: documentRec,\n TableName: \"Documents\",\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating Documents; error is:`, error);\n putError.push(error);\n });\n if (reactData.mode === 'change') {\n await dbClient\n .update({\n Key: {\n client_id: state.session.client_id,\n document_id: options.document_id\n },\n UpdateExpression: 'set #s = :s',\n ExpressionAttributeValues: {\n ':s': documentRec.document_id\n },\n ExpressionAttributeNames: {\n '#s': 'replaced_by'\n },\n TableName: \"Documents\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Documents; error is: `, error);\n });\n }\n setValuesChangedSinceLastSave(false);\n return {\n goodPut: (putError.length === 0),\n putError,\n document_id: documentRec.document_id\n };\n };\n\n // **************************\n\n async function loadForm(form_id) {\n let formRec = await dbClient\n .get({\n Key: {\n client_id: state.session.client_id,\n form_id\n },\n TableName: \"Forms\"\n })\n .promise()\n .catch(error => {\n cl(`***ERR reading Groups*** caught error is: ${error}`, form_id);\n });\n if (!recordExists(formRec)) {\n return {};\n }\n else {\n return formRec.Item;\n }\n }\n\n async function loadDocument({ recent, form_id, specific_document, fuzzy_search, assigned_to }) {\n let queryObj = { TableName: 'Documents' };\n queryObj.KeyConditionExpression = 'client_id = :c';\n queryObj.ExpressionAttributeValues = { ':c': state.session.client_id };\n if (!form_id || (form_id === 'recent')) {\n form_id = reactData.form_id;\n }\n if (recent && !assigned_to) { // recent refers to the most recent version of the requested form\n queryObj.KeyConditionExpression += ' and begins_with(document_id, :dID)';\n queryObj.ExpressionAttributeValues[':dID'] = `${options.person_id || state.patient.person_id}%%${form_id}%%`;\n queryObj.ScanIndexForward = false;\n queryObj.Limit = 1;\n }\n else if (fuzzy_search) { // fuzzy deliversmost recent version of the requested document without knowing its exact id\n queryObj.KeyConditionExpression += ' and begins_with(document_id, :dID)';\n queryObj.ExpressionAttributeValues[':dID'] = fuzzy_search;\n queryObj.ScanIndexForward = false;\n queryObj.Limit = 1;\n }\n else if (specific_document) { // something other than most recent version\n queryObj.KeyConditionExpression += ' and document_id = :dID';\n let splitDoc = specific_document.split('%%');\n if (splitDoc.length === 1) {\n queryObj.ExpressionAttributeValues[':dID'] = `${options.person_id || state.patient.person_id}%%${form_id}%%${splitDoc[0]}`;\n }\n else if (splitDoc.length === 2) {\n form_id = splitDoc[0];\n queryObj.ExpressionAttributeValues[':dID'] = `${options.person_id || state.patient.person_id}%%${splitDoc[0]}%%${splitDoc[1]}`;\n }\n else {\n form_id = splitDoc[1];\n queryObj.ExpressionAttributeValues[':dID'] = `${splitDoc[0]}%%${splitDoc[1]}%%${splitDoc[2]}`;\n }\n }\n let queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n let documentsObj = deepCopy(reactData.document);\n if (!recordExists(queryResult)) {\n queryResult.Items = [{ values: {} }];\n }\n if (assigned_to) {\n if (queryResult.Items.length > 1) {\n queryResult.Items.sort((a, b) => {\n return ((a.completed_timestamp < b.completed_timestamp) ? 1 : -1);\n });\n }\n let foundIt = 0;\n let foundDoc = [{ values: {} }];\n queryResult.Items.forEach(this_document => {\n if ((this_document.completed_timestamp > foundIt)\n && (this_document.form_id === form_id)) {\n foundIt = this_document.completed_timestamp;\n foundDoc = this_document;\n }\n });\n queryResult.Items[0] = foundDoc;\n form_id += `%%${assigned_to}`;\n }\n documentsObj[form_id] = queryResult.Items[0].values;\n if (queryResult.Items[0].title) {\n documentsObj[form_id].document__title = queryResult.Items[0].title;\n }\n if (queryResult.Items[0].assigned_to) {\n documentsObj[form_id].assigned__to = queryResult.Items[0].assigned_to;\n }\n return documentsObj;\n };\n\n React.useEffect(() => {\n async function initialize() {\n let user_fontSize = AVADefaults({ fontSize: 'get' }) || 1.5;\n let response = await loadForm(reactData.form_id);\n if (isEmpty(response)) {\n onClose();\n }\n // do I have permission to update this form?\n if (response.hasOwnProperty('may_update')) {\n\n }\n let documentsObj;\n if (!newDocument() && options.document_id) {\n documentsObj = await loadDocument({\n specific_document: options.document_id,\n });\n }\n else {\n documentsObj = await loadDocument({\n recent: true\n });\n }\n let this_form = (documentsObj ? Object.keys(documentsObj)[0] : options.form_id);\n let selectedPersonRec;\n if (options.person_id) {\n selectedPersonRec = await getPerson(options.person_id);\n }\n else {\n selectedPersonRec = deepCopy(state.patient);\n }\n let reactObj = {\n form_id: this_form,\n formRec: response,\n selectedPersonRec,\n document: documentsObj || { [this_form]: {} }\n };\n if (!newDocument()) {\n reactObj.document_id = options.document_id;\n }\n updateReactData(reactObj, true);\n for (let sN = 0; sN < reactData.formRec.sections.length; sN++) {\n let this_section = reactData.formRec.sections[sN];\n for (let fN = 0; fN < this_section.fields.length; fN++) {\n await makeDefault(this_section.fields[fN]);\n }\n }\n updateReactData({\n formRec: reactData.formRec, // makeDefault may have updated this\n user_fontSize,\n initialized: true,\n stage: 'fill'\n }, true);\n setForceRedisplay('ready');\n if (reactData.mode === 'print') {\n printDocument(\n {\n docData: reactData.formRec,\n docValues: reactValues,\n docDocument: reactData.document[reactData.form_id],\n docID: reactData.form_id,\n client_id: state.session.client_id,\n title: reactData.document[reactData.form_id].document__title || reactData.formRec.form_name\n }\n );\n onClose();\n }\n start(); // idle timer\n }\n if (reactData.stage === 'initialize') {\n updateReactData({\n stage: 'still_initializing'\n }, true);\n initialize();\n }\n }, [reactData.form_id, reactData.document_id]); // eslint-disable-line react-hooks/exhaustive-deps\n\n // **************************\n\n return (\n 0) || true}\n key={`wholeScreen__${reactData?.formRec?.form_name || 'notReady'}`}\n onClose={handleAbort}\n classes={{ paper: classes.clientBackground }}\n >\n {(reactData.stage !== 'initialize') && (reactData.stage !== 'still_initializing') &&\n \n \n \n {reactData.document[reactData.form_id].document__title || reactData.formRec.form_name}\n \n \n \n {reactData.formRec.sections.map((sectionObj, sectionNdx) => (\n \n \n {sectionObj.section_name}\n \n {sectionObj.fields.map((this_field, fieldNdx) => (\n \n {reactData.formRec.fields.hasOwnProperty(this_field) &&\n \n {(reactData.formRec.fields[this_field].value.type === 'text') &&\n {\n handleChangeValue({\n newText: event.target.value,\n prop: this_field,\n sentenceCase: true\n });\n }}\n helperText={reactData.formRec.fields[this_field].prompt.ref}\n />\n }\n {(reactData.formRec.fields[this_field].value.type === 'image') &&\n \n }\n {(reactData.formRec.fields[this_field].value.type === 'phone') &&\n {\n if (event.target.value) {\n let fPhone = formatPhone(event.target.value);\n handleChangeValue({\n newText: fPhone,\n newValue: `+1${fPhone.replace(/\\D/g, '')}`,\n prop: this_field,\n sentenceCase: false\n });\n }\n if (event.relatedTarget) {\n event.relatedTarget.focus({ focusVisible: true });\n if (event.relatedTarget.type !== 'button') {\n event.relatedTarget.click();\n }\n }\n }}\n helperText={reactData.formRec.fields[this_field].prompt.ref}\n disabled={(viewOnly())}\n />\n }\n {((reactData.formRec.fields[this_field].value.type === 'date')\n || (reactData.formRec.fields[this_field].value.type === 'time')) &&\n {\n if (event.target.value) {\n let dObj = makeDate(event.target.value, { noTime: (reactData.formRec.fields[this_field].value.type === 'date'), noYearCorrection: true });\n if (!dObj.error) {\n handleChangeValue({\n newText: dObj.absolute,\n newValue: ((reactData.formRec.fields[this_field].value.type === 'date')\n ? dObj.numeric$\n : dObj.timestamp),\n prop: this_field,\n sentenceCase: false\n });\n }\n }\n if (event.relatedTarget) {\n event.relatedTarget.focus({ focusVisible: true });\n if (event.relatedTarget.type !== 'button') {\n event.relatedTarget.click();\n }\n }\n }}\n helperText={reactData.formRec.fields[this_field].prompt.ref}\n disabled={(viewOnly())}\n />\n }\n {(reactData.formRec.fields[this_field].value.type.startsWith('select')) &&\n \n \n \n }\n {(reactData.formRec.fields[this_field].value.type.includes('view')) &&\n \n {((!reactData.formRec.fields[this_field].prompt.type)\n || (reactData.formRec.fields[this_field].prompt.type === 'text')) &&\n \n {reactData.formRec.fields[this_field].prompt.ref}\n \n }\n {(reactData.formRec.fields[this_field].prompt.type === 'html') &&\n \n }\n {(reactData.formRec.fields[this_field].prompt.type === 'image') &&\n \n }\n {(reactData.formRec.fields[this_field].prompt.type === 'url') &&\n \n \n {reactData.formRec.fields[this_field].prompt.helper || `Tap here for ${reactData.formRec.fields[this_field].prompt.ref}`}\n \n \n }\n \n }\n {(reactData.formRec.fields[this_field].value.type === 'signature') &&\n (!viewOnly()) &&\n \n \n \n {reactData.formRec.fields[this_field].prompt.ref}\n \n \n {signatureRef[reactData.formRec.fields[this_field].sigRefNumber || 0].current &&\n {\n signatureRef[reactData.formRec.fields[this_field].sigRefNumber || 0].current.clear();\n setForceRedisplay(!forceRedisplay);\n }}\n >\n {'Clear'}\n \n }\n \n \n }\n {(reactData.formRec.fields[this_field].value.type === 'signature') &&\n (viewOnly()) &&\n \n \n \n {reactData.formRec.fields[this_field].prompt.ref}\n \n \n }\n\n {(reactData.formRec.fields[this_field].value.type === 'id') &&\n \n {(!viewOnly()) &&\n \n {\n return {\n label: (reactData.peopleList[reactData.formRec.fields[this_field].choose.ref].find(this_person => {\n return (this_person.value === this_value);\n })).label,\n value: this_value\n };\n })\n : []\n )\n ) : []\n }\n placeholder={``}\n onChange={async (values) => {\n if (values.length > 0) {\n handleChangeValue({\n newText: values[0].label,\n newValue: values[0].value,\n prop: this_field,\n sentenceCase: false\n });\n }\n }}\n />\n \n \n {reactData.formRec.fields[this_field].prompt.ref}\n \n \n \n }\n {(viewOnly()) &&\n \n \n {reactValues[this_field].valueText}\n \n \n }\n \n }\n {(reactData.formRec.fields[this_field].value.type === 'geolocation') &&\n \n \n {(!viewOnly()) &&\n {\n getPosition();\n let newText;\n let newValue = {};\n if (!isEmpty(positionError)) {\n newText = `Location Error ${JSON.stringify(positionError)}`;\n }\n else if (!isGeolocationAvailable) {\n newText = \"Device doesn't support location ID\";\n }\n else if (!isGeolocationEnabled) {\n newText = `User blocked location ID`;\n }\n else {\n newText = await reverseGeo({\n latitude: coords.latitude,\n longitude: coords.longitude,\n accuracy: coords.accuracy\n });\n newValue = {\n latitude: coords.latitude,\n longitude: coords.longitude,\n speed: coords.speed,\n };\n }\n newValue.timestamp = new Date().getTime();\n newValue.textDescription = newText;\n handleChangeValue({\n newText,\n newValue,\n prop: this_field\n });\n }}\n >\n {reactData.formRec.fields[this_field].prompt.ref}\n \n }\n {reactValues[this_field] && reactValues[this_field].value &&\n \n \n {reactValues[this_field].valueText}\n \n \n }\n \n \n }\n \n }\n \n ))}\n \n ))}\n \n \n {\n if (viewOnly()) {\n onClose();\n }\n else {\n updateReactData({\n stage: 'exit'\n }, true);\n }\n }}\n >\n {'Exit'}\n \n {(!viewOnly()) &&\n \n {\n let saveCallObj = {\n save_continue: true\n };\n if (reactData.document_id) {\n saveCallObj.document_id = reactData.document_id;\n }\n let response = await handleSave(saveCallObj);\n updateReactData({\n document_id: response.document_id,\n savePending: true,\n }, true);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'lightcyan', color: 'black' }}\n size='small'\n >\n {'Save/Continue'}\n \n {\n await handleReview();\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n >\n {'Finish'}\n \n \n }\n \n \n }\n {(reactData.stage === 'confirm') &&\n 0))\n ? '*none*'\n : 'Save'\n }\n onCancel={() => {\n updateReactData({\n stage: 'fill'\n }, true);\n }}\n onConfirm={async () => {\n let saveCallObj = {\n save_continue: false\n };\n if (reactData.document_id) {\n saveCallObj.document_id = reactData.document_id;\n }\n let response = await handleSave(saveCallObj);\n if (!response.goodPut) {\n updateReactData({\n stage: 'error',\n errorMessage: response.putError\n }, true);\n }\n else {\n onClose('docAdded');\n }\n }}\n />\n }\n {(reactData.stage === 'exit') &&\n {\n updateReactData({\n stage: 'fill'\n }, true);\n }}\n onConfirm={async () => {\n if (reactData.savePending) {\n updateReactData({\n stage: 'keepAutoSave'\n }, true);\n }\n else {\n onClose((reactData.savePending) ? 'docAdded' : '');\n }\n }}\n allowCancel={true}\n />\n }\n {(reactData.stage === 'keepAutoSave') &&\n {\n await dbClient\n .delete({\n Key: {\n client_id: state.session.client_id,\n document_id: reactData.document_id\n },\n TableName: \"Documents\",\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating Documents; error is:`, error);\n });\n onClose('docAdded');\n }}\n onConfirm={async () => {\n onClose('docAdded');\n }}\n allowCancel={true}\n />\n }\n {(reactData.stage === 'error') &&\n {\n updateReactData({\n stage: 'fill'\n }, true);\n }}\n />\n }\n \n );\n};\n","import React from 'react';\nimport useSession from '../../hooks/useSession';\nimport { useSnackbar } from 'notistack';\n\nimport { dbClient, cl, makeArray, recordExists, getDb, array_in_array, listFromArray, switchActiveAccount } from '../../util/AVAUtilities';\nimport { makeDate } from '../../util/AVADateTime';\nimport AVATextInput from '../forms/AVATextInput';\nimport { getPerson } from '../../util/AVAPeople';\nimport FormFillB from '../forms/FormFillB';\n\nimport { Typography } from '@material-ui/core';\n\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport Button from '@material-ui/core/Button';\nimport EditIcon from '@material-ui/icons/Edit';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport CloudUploadIcon from '@material-ui/icons/CloudUpload';\nimport PrintIcon from '@material-ui/icons/Print';\nimport RadioButtonUncheckedIcon from '@material-ui/icons/RadioButtonUnchecked';\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle';\nimport AddCircleIcon from '@material-ui/icons/AddCircle';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport TextureIcon from '@material-ui/icons/Texture';\n\nimport { AVAclasses, AVATextStyle } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n pageHead: {\n paddingTop: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n fontWeight: 'bold'\n },\n subDescriptionText: {\n marginLeft: theme.spacing(3),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n },\n freeInput: {\n width: '100%',\n marginLeft: 0,\n marginBottom: '10px',\n marginRight: '32px',\n paddingLeft: 0,\n paddingRight: 0,\n verticalAlign: 'middle',\n minHeight: theme.typography.fontSize * 2.8,\n },\n editInput: {\n width: '100%',\n color: 'black',\n marginLeft: 0,\n marginRight: '8px',\n paddingLeft: 0,\n paddingRight: 0,\n minHeight: theme.typography.fontSize * 2.8,\n },\n rowButton: {\n marginRight: theme.spacing(1),\n fontSize: '1rem',\n marginBottom: theme.spacing(1),\n },\n rowButtonGreen: {\n marginRight: theme.spacing(1),\n fontSize: '1rem',\n marginBottom: theme.spacing(1),\n color: 'green'\n },\n inputDisplay: {\n '&.Mui-disabled': {\n color: 'black'\n },\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.reject[theme.palette.type],\n },\n dialogBox: {\n paddingTop: 0,\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n overflowX: 'auto',\n // overflowY: 'hidden'\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n load: {\n backgroundColor: theme.palette.warning[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n}));\n\nexport default ({ request, onClose }) => {\n\n const { state } = useSession();\n const { enqueueSnackbar } = useSnackbar();\n\n let options = {};\n if (Array.isArray(request)) {\n request.forEach((req) => {\n if (typeof (req) === 'string') {\n let [key, value] = req.split('=');\n options[key] = value;\n }\n else {\n Object.assign(options, req);\n }\n });\n }\n else if (typeof (request) === 'string') {\n options.document_id = request;\n options.form_id = request;\n }\n else {\n options = Object.assign({}, request);\n }\n\n var rowsWritten;\n var completed_and_displayed = [];\n\n const formType_filter = makeArray(options.formTypes);\n\n const [reactData, setReactData] = React.useState({\n filter: {\n formType: (formType_filter.includes('*all') || (formType_filter.length === 0)) ? false : formType_filter,\n title_words: false,\n document_status: false,\n time_frame: false,\n person: false\n },\n filtered_results: (!formType_filter.includes('*all') && (formType_filter.length > 0)),\n filter_description: 'Documents',\n client_id: options.client || options.client_id || state.session.client_id,\n formList: [],\n initialized: false,\n docObj: {},\n options: options || {},\n deletePending: false,\n nameObj: {},\n recentlyExpandedForm: null,\n textInput: {},\n setFilter: false,\n documentStatusOptions: [\n { label: 'Complete', value: 'complete%%Complete' },\n { label: 'In Process', value: 'work_in_process%%In Process' },\n { label: 'Not Started', value: 'assigned%%Not Started' },\n ],\n filterTimeFrames: [\n { label: 'This Week', value: 'sunday - 7' },\n { label: 'Last 10 days', value: 'today - 10' },\n { label: 'This Month', value: '1st' },\n ]\n });\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n const formRowRef = React.useRef(null);\n\n async function setFormList() {\n // get all Form Types\n let formList = [];\n let formResult = await dbClient\n .query({\n TableName: 'Forms',\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': reactData.client_id }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading Forms id ${error}`);\n });\n if (recordExists(formResult)) {\n formResult.Items.forEach(this_form => {\n if (this_form.active || reactData.options.viewInactive) {\n formList.push(Object.assign({}, (this_form), {\n isExpanded: false\n }));\n }\n });\n if (formList.length === 1) {\n formList[0].isExpanded = true;\n }\n else {\n formList.sort((a, b) => {\n if (a.sequence === b.sequence) {\n return ((a.form_name < b.form_name) ? 1 : -1);\n }\n else {\n return (((a.sequence || 10) < (b.sequence || 10)) ? 1 : -1);\n }\n });\n }\n }\n return { formList };\n }\n\n async function printAll({ document_list }) {\n let w = [];\n document_list.forEach((this_document, ndx) => {\n try {\n w[ndx] = window.open(\n this_document,\n `Print Document ${ndx}`,\n `name=Print Document - ${ndx + 1} of ${document_list.length}, left=${(ndx * 40) + 10}, top=${(ndx * 20) + 10}, height=400, width=600`\n );\n w[ndx].addEventListener(\"afterprint\", (e) => {\n console.log(\"After print\");\n });\n w[ndx].print();\n w[ndx].focus();\n w[ndx].onafterprint = (e) => {\n console.log(\"onAfterprint\");\n };\n }\n catch (er) {\n console.log(`caught error ${er} on ${ndx}`);\n }\n });\n }\n\n async function setDocObj({ formTypes, options }) {\n // get Documents for a form type\n // list will look in DocumentXRef \n /*\n {\n person_id: '*status',\n client_id: state.session.client_id,\n document_id,\n status: 'work_in_process',\n formType: reactData.form_id,\n last_update: new Date().getTime()\n },\n */\n let formList = [];\n if (formTypes) {\n formList = formTypes.map(this_form => {\n return this_form.form_id;\n });\n }\n let docResult = await dbClient\n .query({\n TableName: 'DocumentXRef',\n IndexName: 'client-person-index',\n KeyConditionExpression: 'client_id = :c and person_id = :p',\n ExpressionAttributeValues: { ':p': '*status', ':c': state.session.client_id },\n // FilterExpression: 'client_id = :c'\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading DocumentXRef status records ${error}`);\n });\n if (recordExists(docResult)) {\n var loadTrigger = 0;\n for (const this_docXRef of docResult.Items) {\n if (!this_docXRef.formType) { continue; }\n if (this_docXRef.status !== 'deleted') {\n let this_docRec = await getDocRec({\n document_id: this_docXRef.document_id,\n doc_status: this_docXRef.status\n });\n if (!this_docRec) { continue; }\n if ((formList.length > 0) && !formList.includes(this_docXRef.formType)) { continue; }\n if (!reactData.docObj.hasOwnProperty(this_docXRef.formType)) {\n reactData.docObj[this_docXRef.formType] = [];\n }\n // determine pertains_to and pertains_to_name;\n // we will insert a new pertains_to in the formType array in alphabetical sequence by name\n // does pertains_to exist already?\n // while we're looking, keep track of the index of the first name that comes AFTER my name\n this_docRec.pertains_to_name = await getName(this_docRec.pertains_to);\n let insert_before = -1;\n let myPersonObj_index = reactData.docObj[this_docXRef.formType].findIndex((this_personObj, ndx) => {\n if (this_personObj.pertains_to === this_docRec.pertains_to) {\n return true;\n }\n else if (insert_before > -1) {\n return false;\n }\n else if (this_personObj.pertains_to_name > this_docRec.pertains_to_name) {\n insert_before = ndx;\n return false;\n }\n return false;\n });\n if (myPersonObj_index === -1) { // this person not in the list already; insert it at insert_before location\n if (insert_before === -1) {\n myPersonObj_index = reactData.docObj[this_docXRef.formType].push({\n pertains_to: this_docRec.pertains_to,\n pertains_to_name: this_docRec.pertains_to_name,\n docList: [],\n isExpanded: false\n }) - 1;\n }\n else {\n reactData.docObj[this_docXRef.formType].splice(insert_before, 0, {\n pertains_to: this_docRec.pertains_to,\n pertains_to_name: this_docRec.pertains_to_name,\n docList: [],\n isExpanded: false\n });\n myPersonObj_index = insert_before;\n }\n }\n\n {\n // docList will be ordered by Date\n // we will attempt to extract a date from the document_id; if none is found, use last_update\n const temp = this_docRec.document_id.split('#');\n let attemptedDate;\n do {\n attemptedDate = makeDate(temp.pop());\n }\n while ((temp.length > 0) && (attemptedDate.error));\n if (!attemptedDate.error) {\n this_docRec.docDate = attemptedDate.numeric;\n }\n else {\n this_docRec.docDate = makeDate(this_docXRef.last_update).numeric;\n }\n const recToPush = Object.assign({}, this_docRec, this_docXRef);\n const put_before = reactData.docObj[this_docXRef.formType][myPersonObj_index].docList.findIndex(this_doc => {\n return (this_doc.docDate < recToPush.docDate);\n });\n if (put_before < 0) {\n reactData.docObj[this_docXRef.formType][myPersonObj_index].docList.push(recToPush);\n }\n else {\n reactData.docObj[this_docXRef.formType][myPersonObj_index].docList.splice(put_before, 0, recToPush);\n }\n if (loadTrigger === 10) {\n updateReactData({\n docObj: reactData.docObj\n }, true);\n loadTrigger = 0;\n }\n else {\n loadTrigger++;\n }\n }\n }\n };\n }\n\n return {\n docObj: reactData.docObj,\n nameObj: reactData.nameObj\n };\n }\n\n const getName = async (person_id) => {\n if (!reactData.nameObj.hasOwnProperty[person_id]) {\n let personRec = await getPerson(person_id);\n if (!personRec) { \n reactData.nameObj[person_id] = `Person ID ${person_id}`;\n }\n else if (!personRec.name) {\n reactData.nameObj[person_id] = personRec.display_name || `Person ID ${person_id}`;\n }\n else if (reactData.options.sortByLastName) {\n reactData.nameObj[person_id] = (`${personRec.name.last}, ${personRec.name.first}`).trim();\n }\n else {\n reactData.nameObj[person_id] = (`${personRec.name.first} ${personRec.name.last}`).trim();\n }\n }\n return reactData.nameObj[person_id];\n };\n\n React.useEffect(() => {\n if (formRowRef && formRowRef.current) {\n formRowRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n });\n }\n }, [reactData.recentlyExpandedForm, formRowRef]);\n\n const okToShowForm = (this_form) => {\n if (!reactData.filtered_results) { return true; }\n if (!reactData.filter.formType || (reactData.filter.formType.includes(this_form.form_id))) {\n // there is a filter, but it isn't formType; we need to figure out if ANY documents will display for this formType\n return reactData.docObj[this_form.form_id].some((this_personObj, person_index) => {\n return okToShowPerson(this_form.form_id, this_personObj.pertains_to, person_index);\n });\n }\n return true;\n };\n\n const okToShowPerson = (form_id, this_person, person_index) => {\n if (!reactData.filtered_results) { return true; }\n if (reactData.filter.person && (this_person !== reactData.filter.person.id)) {\n return false;\n }\n if (!reactData.filter.person) {\n // there is a filter, but it isn't on this Person; we need to figure out if ANY documents will display for this person\n return reactData.docObj[form_id][person_index].docList.some(this_doc => {\n return okToShowDoc(this_doc);\n });\n }\n return true;\n };\n\n const okToShowDoc = (this_doc) => {\n if (!reactData.filtered_results) { return true; }\n /* \n title_words: false,\n document_status: false,\n time_frame: false,\n person: false\n */\n if (reactData.filter.title_words && (!(this_doc.document_title || this_doc.title || ' ').toLowerCase().includes(reactData.filter.title_words))) {\n return false;\n }\n if (reactData.filter.document_status && (!reactData.filter.document_status.includes(this_doc.status))) {\n return false;\n }\n if (reactData.filter.time_frame) {\n if (this_doc.docDate < reactData.filter.time_frame.fromDate.numeric) {\n return false;\n }\n if (this_doc.docDate > reactData.filter.time_frame.toDate.numeric) {\n return false;\n }\n }\n if (reactData.filter.person && (this_doc.pertains_to !== reactData.filter.person.id)) {\n return false;\n }\n return true;\n };\n\n const getDocRec = async ({ document_id, doc_status }) => {\n let docFile;\n if (doc_status === 'complete') {\n docFile = 'CompletedDocuments';\n }\n else if (doc_status === 'work_in_process') {\n docFile = 'DocumentsInProcess';\n }\n else if (doc_status === 'assigned') {\n docFile = 'DocumentsAssigned';\n }\n var this_doc = await getDb({\n Key: {\n client_id: state.session.client_id,\n document_id: document_id\n },\n TableName: docFile\n });\n return this_doc;\n };\n\n // **************************\n\n React.useEffect(() => {\n async function initialize() {\n let { formList } = await setFormList();\n let docObj = {};\n formList.forEach(this_form => {\n docObj[this_form.form_id] = [];\n });\n updateReactData({\n formList,\n docObj,\n initialized: true\n }, true);\n var response = await setDocObj({ formTypes: formList });\n updateReactData({\n docObj: response.docObj,\n nameObj: response.nameObj\n }, true);\n }\n if (!reactData.initialized) {\n initialize();\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n (reactData.initialized &&\n {\n onClose();\n }}\n className={classes.pageHead}\n fullScreen\n >\n \n \n \n {`Document Management`}\n \n {reactData.filtered_results &&\n \n {reactData.filter_description}\n \n }\n \n \n\n \n \n { /* Data rows */}\n \n \n {rowsWritten = 0}\n {completed_and_displayed = []}\n \n {reactData.formList.map((this_form, formNdx) => (\n (okToShowForm(this_form) &&\n \n { /* Form Name */}\n 0) ? 2 : 4}\n justifyContent='space-between'\n alignItems='center'\n ref={(this_form.form_id === reactData.recentlyExpandedForm) ? formRowRef : null}\n >\n {\n reactData.formList[formNdx].isExpanded = !reactData.formList[formNdx].isExpanded;\n updateReactData({\n formList: reactData.formList,\n docObj: reactData.docObj,\n recentlyExpandedForm: this_form.form_id\n }, true);\n }}\n >\n \n {this_form.form_name}\n \n \n {rowsWritten++}\n \n \n \n {\n updateReactData({\n uploadDoc: true,\n pendingInstructions: {\n action: 'upload',\n selectedPerson: (reactData.filter.person ? `${reactData.filter.person.id}%%${reactData.filter.person.name}` : null),\n formType: this_form.form_id,\n formName: this_form.form_name,\n formRec: reactData.formList.find(l => { return (l.form_id === this_form.form_id); })\n }\n }, true);\n }}\n edge=\"start\"\n />\n {\n if (this_form?.options?.anonymous) {\n updateReactData({\n addDocPrompt: false,\n addDocForm: true,\n pendingInstructions: {\n action: 'addNew',\n formType: this_form.form_id,\n selectedPerson: null,\n formName: this_form.form_name,\n formRec: reactData.formList.find(l => { return (l.form_id === this_form.form_id); })\n }\n }, true);\n }\n else {\n updateReactData({\n addDocPrompt: true,\n pendingInstructions: {\n action: 'addNew',\n formType: this_form.form_id,\n formName: this_form.form_name,\n formRec: reactData.formList.find(l => { return (l.form_id === this_form.form_id); })\n }\n }, true);\n }\n }}\n edge=\"start\"\n />\n {\n updateReactData({\n printEmptyForm: true,\n pendingInstructions: {\n action: 'printEmpty',\n formType: this_form.form_id,\n formRec: reactData.formList.find(l => { return (l.form_id === this_form.form_id); })\n }\n }, true);\n }}\n edge=\"start\"\n />\n \n \n {(this_form.isExpanded || reactData.filtered_results) &&\n \n \n { /* Array of People - ordered by Name */}\n {reactData.docObj[this_form.form_id].map((this_personObj, personNdx) => (\n (okToShowPerson(this_form.form_id, this_personObj.pertains_to, personNdx) &&\n \n \n \n \n {\n e.preventDefault();\n enqueueSnackbar(
    \n 1. Form ID {this_form.form_id}
    \n 2. Pertains to {this_personObj.pertains_to}
    ,\n { variant: 'info', persist: true });\n }}\n onClick={async () => {\n reactData.docObj[this_form.form_id][personNdx].isExpanded = !reactData.docObj[this_form.form_id][personNdx].isExpanded;\n updateReactData({\n docObj: reactData.docObj,\n }, true);\n }}\n >\n \n {this_personObj.pertains_to_name}\n \n
    \n
    \n
    \n \n {(this_personObj.isExpanded || reactData.filtered_results) &&\n \n \n { /* Existing documents for this form/person */}\n {reactData.docObj[this_form.form_id][personNdx].docList.map((this_doc, docNdx) => (\n (okToShowDoc(this_doc) &&\n \n {(this_doc.status === 'complete') && (reactData.filtered_results) &&\n \n {completed_and_displayed.push(this_doc.file_location || this_doc.location)}\n \n }\n \n \n {this_doc.file_location &&\n \n {\n let nowJ = new Date().getTime();\n window.open(`${this_doc.file_location}?qt=${nowJ.toString()}`, this_doc.document_title);\n }}\n />\n {\n printAll({\n document_list: ([this_doc.file_location || this_doc.location]).concat(\n this_doc.amendments\n ? this_doc.amendments.map(this_amendment => {\n return this_amendment.file_location;\n })\n : null\n )\n });\n }}\n />\n {\n updateReactData({\n addDocPrompt: false,\n addDocForm: true,\n pendingInstructions: {\n selectedPerson: this_doc.pertains_to,\n selectedPerson_index: personNdx,\n action: 'amendment',\n parentFormType: this_form.form_id,\n docIndex: docNdx,\n formType: this_form.amedment_form_id || 'amendment_1',\n formData: {\n document_id: this_doc.document_id,\n doc_reference: `${this_doc.document_title} for ${this_doc.pertains_to_name}; completed on ${makeDate(this_doc.last_update).absolute}`\n }\n }\n }, true);\n }}\n />\n \n }\n {!this_doc.file_location &&\n \n {\n updateReactData({\n editDoc: true,\n pendingInstructions: {\n action: 'edit',\n formType: this_form.form_id,\n formName: this_form.form_name,\n formRec: reactData.formList.find(l => { return (l.form_id === this_form.form_id); }),\n document_id: this_doc.document_id,\n document_title: this_doc.title || this_doc.document_title,\n person_id: this_doc.pertains_to,\n person_index: personNdx,\n docIndex: docNdx\n }\n }, true);\n }}\n />\n {\n await dbClient\n .update({\n Key: {\n person_id: '*status',\n document_id: this_doc.document_id\n },\n UpdateExpression: 'set #s = :d',\n ExpressionAttributeValues: { ':d': 'deleted' },\n ExpressionAttributeNames: { '#s': 'status' },\n TableName: 'DocumentXRef'\n })\n .promise()\n .catch(error => { cl(`caught error updating Documents; error is: `, error); });\n reactData.docObj[this_form.form_id][personNdx].docList.splice(docNdx, 1);\n updateReactData({\n docObj: reactData.docObj\n }, true);\n }}\n />\n {\n updateReactData({\n uploadDoc: true,\n pendingInstructions: {\n action: 'upload',\n document_id: this_doc.document_id,\n doc_index: docNdx,\n selectedPerson: this_doc.pertains_to,\n formType: this_form.form_id,\n formName: this_form.form_name,\n formRec: reactData.formList.find(l => { return (l.form_id === this_form.form_id); })\n }\n }, true);\n }}\n edge=\"start\"\n />\n \n }\n {\n e.preventDefault();\n enqueueSnackbar(
    \n 1. Form ID {this_form.form_id}
    \n 2. Doc ID {this_doc.document_id}
    \n 3. Pertains to {this_doc.pertains_to}
    ,\n { variant: 'info', persist: true });\n }}\n onClick={async () => {\n if (this_doc.file_location) {\n let nowJ = new Date().getTime();\n window.open(`${this_doc.file_location}?qt=${nowJ.toString()}`, this_doc.document_title);\n }\n else {\n updateReactData({\n editDoc: true,\n pendingInstructions: {\n action: 'edit',\n formType: this_form.form_id,\n formName: this_form.form_name,\n formRec: reactData.formList.find(l => { return (l.form_id === this_form.form_id); }),\n document_id: this_doc.document_id,\n document_title: this_doc.title || this_doc.document_title,\n person_id: this_doc.pertains_to,\n person_index: personNdx,\n docIndex: docNdx\n }\n }, true);\n }\n }}\n >\n \n {this_doc.pertains_to_name}\n \n \n {makeDate(this_doc.docDate).dateOnly}\n \n
    \n
    \n {this_doc.amendments && this_doc.amendments.map((this_amendment, amendment_number) => (\n {\n let nowJ = new Date().getTime();\n window.open(`${this_amendment.file_location}?qt=${nowJ.toString()}`, this_amendment.document_title);\n }}\n >\n {`Amendment ${this_doc.amendments.length - amendment_number} - ${makeDate(this_amendment.last_update).absolute}`}\n \n ))}\n
    \n \n )\n ))\n }\n \n \n }\n \n )\n ))\n }\n\n \n \n }\n
    \n )\n ))}\n {(rowsWritten === 0) &&\n \n \n {reactData.filtered_results\n ? `No Documents match that search`\n : `Nothing found`\n }\n \n \n }\n \n {reactData.setFilter &&\n { return (reactData.filter.document_status.includes(d.value.split('%%')[0])); })\n .map(d => { return d.value; })\n : false\n ),\n (reactData.filter.person\n ? `${reactData.filter.person.id}%%${reactData.filter.person.name}`\n : false\n ),\n (reactData.filter.time_frame\n ? reactData.filter.time_frame.selectValue.value\n : false\n )\n ]}\n selectionList={[\n '',\n reactData.documentStatusOptions,\n state.accessList[state.session.client_id].list.map(a => {\n const label = (!a.name ? a.display_name : (`${a.name.last} ${a.name.first}`).trim());\n return {\n label,\n value: `${a.person_id}%%${label}`\n };\n }),\n reactData.filter.time_frame.selectValue \n ? reactData.filterTimeFrames.concat([reactData.filter.time_frame.selectValue])\n : reactData.filterTimeFrames\n ]}\n onCancel={() => {\n updateReactData({\n setFilter: false\n }, true);\n }}\n onSave={async (response, buttonPressed) => {\n let reactUpdObj = {\n setFilter: false,\n filter: {\n title_words: false,\n document_status: false,\n time_frame: false,\n person: false,\n },\n filtered_results: !!reactData.filter.formType,\n filter_description: ''\n };\n if (buttonPressed !== 2) {\n reactUpdObj.filter_description = 'Documents';\n if (!!response[0]) {\n reactUpdObj.filter.title_words = response[0].toLowerCase();\n reactUpdObj.filtered_results = true;\n }\n if (!!response[1]) {\n reactUpdObj.filter.document_status = [];\n let wordList = [];\n makeArray(response[1]).forEach(status_response => {\n let [status_key, status_descripition] = status_response.split('%%');\n reactUpdObj.filter.document_status.push(status_key);\n wordList.push(status_descripition);\n });\n reactUpdObj.filter_description = `${listFromArray(wordList)} ${reactUpdObj.filter_description}`;\n reactUpdObj.filtered_results = true;\n }\n if (!!response[2]) {\n let [id, name] = response[2].split('%%');\n reactUpdObj.filter.person = {\n id,\n name\n };\n reactUpdObj.filtered_results = true;\n reactUpdObj.filter_description += ` for ${name}`;\n }\n if (!!response[3]) {\n let fromDate;\n let toDate;\n if (reactData.filterTimeFrames.some(this_one => {\n return (this_one.value === response[3]);\n })) {\n fromDate = makeDate(response[3], { noFuture: true });\n toDate = makeDate('today', { noFuture: true });\n }\n else { \n response[3] = response[3].replace(/(since|from|after)/g, '');\n let result = response[3].split(/(thru|through|-|to)/g);\n fromDate = makeDate(result[0].trim(), { noFuture: true });\n toDate = makeDate((result[2] ? result[2].trim() : 'today'), { noFuture: true });\n }\n reactUpdObj.filter.time_frame = {\n fromDate,\n toDate, \n selectValue: { value: response[3], label: response[3] }\n };\n reactUpdObj.filtered_results = true;\n reactUpdObj.filter_description += ` from ${fromDate.absolute} through ${toDate.relative}`;\n }\n }\n updateReactData(reactUpdObj, true);\n }}\n />\n }\n {reactData.uploadDoc &&\n {\n return (!reactData.pendingInstructions.formRec.valid_for\n || reactData.pendingInstructions.formRec.valid_for.includes('ALL')\n || (array_in_array(p.groups, reactData.pendingInstructions.formRec.valid_for)));\n }).map(a => {\n const label = (!a.name ? a.display_name : (`${a.name.first} ${a.name.last}`).trim());\n return {\n label,\n value: a.person_id\n };\n })\n ]}\n buttonText={'Load'}\n onCancel={() => {\n updateReactData({\n uploadDoc: false\n }, true);\n }}\n onSave={async (response) => {\n if (response[1]) {\n const [selectedPerson, selectedName] = response[0].split('%%');\n const nowTime = makeDate(new Date());\n const document_id = reactData.pendingInstructions.document_id || `${response[0]}_${reactData.pendingInstructions.formType}_${nowTime.timestamp}`;\n let document_title;\n if (selectedName) {\n document_title = `${reactData.pendingInstructions.formName} for ${selectedName} - ${nowTime.absolute}`;\n }\n else {\n document_title = `${reactData.pendingInstructions.formName} - ${nowTime.absolute}`;\n }\n let goodPut = true;\n const completedDocRec = {\n client_id: state.session.client_id,\n document_id,\n document_title,\n pertains_to: selectedPerson,\n date_completed: nowTime.timestamp,\n formType: reactData.form_id,\n formType_date: `${reactData.form_id}%%${new Date().getTime()}`,\n fields: reactData.fields,\n save_info: {\n s3Bucket: 'theseus-medical-storage',\n s3Key: response[1].split('/').pop(),\n s3Location: response[1]\n },\n file_location: response[1]\n };\n await dbClient\n .put({\n Item: completedDocRec,\n TableName: 'CompletedDocuments'\n })\n .promise()\n .catch(error => {\n cl(`Bad put to CompletedDocuments. Error is: ${error}`);\n goodPut = false;\n });\n if (goodPut) {\n await dbClient\n .put({\n Item: {\n person_id: state.session.user_id,\n document_id,\n role: 'completed_by',\n },\n TableName: 'DocumentXRef'\n })\n .promise()\n .catch(error => {\n const messageText = `Bad put to DocumentXRef (completed_by). Error is: ${error}`;\n cl(messageText);\n goodPut = false;\n });\n await dbClient\n .put({\n Item: {\n person_id: selectedPerson,\n document_id,\n role: 'pertains_to',\n },\n TableName: 'DocumentXRef'\n })\n .promise()\n .catch(error => {\n const messageText = `Bad put to DocumentXRef (pertains_to). Error is: ${error}`;\n cl(messageText);\n goodPut = false;\n });\n var docXRefRec = {\n person_id: '*status',\n client_id: state.session.client_id,\n document_id,\n status: 'complete',\n formType: reactData.pendingInstructions.formType,\n last_update: nowTime.timestamp\n };\n await dbClient\n .put({\n Item: docXRefRec,\n TableName: 'DocumentXRef'\n })\n .promise()\n .catch(error => {\n const messageText = `Bad put to DocumentXRef (status). Error is: ${error}`;\n cl(messageText);\n goodPut = false;\n });\n }\n // find the selectedPerson (or add them)\n let personNdx = reactData.docObj[reactData.pendingInstructions.formType].findIndex(this_personObj => {\n return (this_personObj.pertains_to === selectedPerson);\n });\n if (personNdx < 0) {\n reactData.docObj[reactData.pendingInstructions.formType].unshift({\n pertains_to: selectedPerson,\n pertains_to_name: selectedName,\n docList: [],\n isExpanded: true\n });\n personNdx = 0;\n }\n if (reactData.pendingInstructions.doc_index) {\n reactData.docObj[reactData.pendingInstructions.formType][personNdx].docList[reactData.pendingInstructions.doc_index] =\n Object.assign({},\n reactData.docObj[reactData.pendingInstructions.formType][personNdx].docList[reactData.pendingInstructions.doc_index],\n docXRefRec,\n completedDocRec\n );\n }\n else {\n reactData.docObj[reactData.pendingInstructions.formType][personNdx].docList.unshift(\n Object.assign({}, docXRefRec, completedDocRec, {\n pertains_to_name: selectedName\n })\n );\n }\n updateReactData({\n docObj: reactData.docObj,\n uploadDoc: false,\n pendingInstructions: false\n }, true);\n }\n }}\n />\n }\n {reactData.addDocPrompt &&\n {\n return (!reactData.pendingInstructions.formRec.valid_for\n || reactData.pendingInstructions.formRec.valid_for.includes('ALL')\n || (array_in_array(p.groups, reactData.pendingInstructions.formRec.valid_for)));\n }).map(a => {\n const label = (!a.name ? a.display_name : (`${a.name.first} ${a.name.last}`).trim());\n return {\n label,\n value: a.person_id\n };\n })\n ]}\n buttonText={'Load'}\n onCancel={() => {\n updateReactData({\n addDocPrompt: false\n }, true);\n }}\n onSave={async (response) => {\n reactData.pendingInstructions.selectedPerson = response[0];\n updateReactData({\n addDocPrompt: false,\n addDocForm: true,\n pendingInstructions: reactData.pendingInstructions\n }, true);\n }}\n />\n }\n {reactData.addDocForm &&\n {\n if (statusObj.document_status !== 'aborted') {\n // if there is no person_index in pending instructions, we didn't know who this belonged to before\n // it was being added. Perhaps now we do. That would likely be in statusObj.pertains_to\n if (!reactData.pendingInstructions.hasOwnProperty('selectedPerson_index')) {\n let foundIt = reactData.docObj[reactData.pendingInstructions.formType].findIndex(this_personObj => {\n return (this_personObj.pertains_to === statusObj.pertains_to);\n });\n if (foundIt > -1) {\n reactData.pendingInstructions.selectedPerson_index = foundIt;\n }\n else {\n reactData.docObj[reactData.pendingInstructions.formType].unshift({\n pertains_to: statusObj.pertains_to,\n pertains_to_name: await getName(statusObj.pertains_to),\n docList: [],\n isExpanded: true\n });\n reactData.pendingInstructions.selectedPerson_index = 0;\n }\n }\n if (reactData.pendingInstructions.action === 'amendment') {\n if (!reactData.docObj[reactData.pendingInstructions.parentFormType][reactData.pendingInstructions.selectedPerson_index].docList[reactData.pendingInstructions.docIndex].hasOwnProperty('amendments')) {\n reactData.docObj[reactData.pendingInstructions.parentFormType][reactData.pendingInstructions.selectedPerson_index].docList[reactData.pendingInstructions.docIndex].amendments = [];\n }\n reactData.docObj[reactData.pendingInstructions.parentFormType][reactData.pendingInstructions.selectedPerson_index].docList[reactData.pendingInstructions.docIndex].amendments.unshift({\n document_id: statusObj.document_id,\n document_title: statusObj.document_title,\n file_location: statusObj.recWritten.file_location || null,\n formType: reactData.pendingInstructions.formType,\n last_update: new Date().getTime(),\n status: statusObj.document_status\n });\n await dbClient\n .update({\n Key: {\n client_id: state.session.client_id,\n document_id: reactData.pendingInstructions.formData.document_id\n },\n UpdateExpression: 'set #a = :a',\n ExpressionAttributeValues: { ':a': reactData.docObj[reactData.pendingInstructions.parentFormType][reactData.pendingInstructions.selectedPerson_index].docList[reactData.pendingInstructions.docIndex].amendments },\n ExpressionAttributeNames: { '#a': 'amendments' },\n TableName: 'CompletedDocuments'\n })\n .promise()\n .catch(error => { cl(`caught error adding amendment to Completed Documents; error is: `, error); });\n }\n else {\n if (!reactData.docObj.hasOwnProperty(reactData.pendingInstructions.formType)) {\n reactData.docObj[reactData.pendingInstructions.formType] = [];\n reactData.docObj[reactData.pendingInstructions.formType].push = ({\n pertains_to: reactData.pendingInstructions.selectedPerson,\n pertains_to_name: await getName(reactData.pendingInstructions.selectedPerson),\n docList: [],\n isExpanded: true\n });\n reactData.pendingInstructions.selectedPerson_index = 0;\n }\n reactData.docObj[reactData.pendingInstructions.formType][reactData.pendingInstructions.selectedPerson_index].docList.unshift(\n {\n document_id: statusObj.document_id,\n document_title: statusObj.document_title,\n file_location: statusObj.file_location || null,\n formType: reactData.pendingInstructions.formType,\n last_update: new Date().getTime(),\n status: statusObj.document_status,\n pertains_to_name: await getName(reactData.pendingInstructions.selectedPerson)\n }\n );\n }\n if (statusObj.nextAction) {\n if (statusObj.nextAction.action === 'switchTo') {\n await switchActiveAccount(\n state.session,\n state.session.client_id,\n {\n id: statusObj.nextAction.target,\n }\n );\n }\n else if (statusObj.nextAction.action === 'logIn') {\n sessionStorage.removeItem('AVASessionData');\n let jumpTo = `${window.location.href.replace('refresh', 'theseus')}?user=${statusObj.nextAction.target}`;\n window.location.replace(jumpTo);\n }\n }\n }\n updateReactData({\n docObj: reactData.docObj,\n addDocPrompt: false,\n addDocForm: false,\n pendingInstructions: false\n }, true);\n }}\n />\n }\n {reactData.printEmptyForm &&\n {\n updateReactData({\n printEmptyForm: false,\n }, true);\n }}\n />\n }\n {reactData.editDoc &&\n {\n if (statusObj.document_status !== 'aborted') {\n if (statusObj.recWritten) {\n reactData.docObj[reactData.pendingInstructions.formType][reactData.pendingInstructions.person_index].docList[reactData.pendingInstructions.docIndex] =\n Object.assign({},\n reactData.docObj[reactData.pendingInstructions.formType][reactData.pendingInstructions.person_index].docList[reactData.pendingInstructions.docIndex],\n statusObj.recWritten || {},\n { last_update: new Date().getTime(), status: statusObj.document_status }\n );\n }\n if (statusObj.nextAction) {\n if (statusObj.nextAction.action === 'switchTo') {\n await switchActiveAccount(\n state.session,\n state.session.client_id,\n {\n id: statusObj.nextAction.target,\n }\n );\n }\n }\n }\n updateReactData({\n docObj: reactData.docObj,\n editDoc: false,\n pendingInstructions: false\n }, true);\n\n }}\n />\n }\n \n
    \n\n \n {\n onClose();\n }}\n >\n {'Exit'}\n \n }\n onClick={() => {\n updateReactData({\n setFilter: true,\n }, true);\n }}\n >\n {'Filter'}\n \n {(completed_and_displayed.length > 0) &&\n {\n await printAll({ document_list: completed_and_displayed });\n }}\n startIcon={}\n >\n {`Print ${completed_and_displayed.length}`}\n \n }\n \n\n \n )\n );\n};\n","import React from 'react';\n\nimport { dbClient, getMarqueeMessage } from '../../util/AVAUtilities';\nimport { AVAclasses, AVATextStyle } from '../../util/AVAStyles';\nimport { makeDate } from '../../util/AVADateTime';\nimport { getGroup } from '../../util/AVAGroups';\nimport AVAConfirm from '../forms/AVAConfirm';\n\nimport { Checkbox, List, TextField, Button, Typography, Paper, Box } from '@material-ui/core';\nimport { RadioGroup, Radio } from '@material-ui/core';\nimport { FormControl, FormControlLabel } from '@material-ui/core';\nimport { Dialog, DialogActions, DialogContent } from '@material-ui/core';\n\nimport { useSnackbar } from 'notistack';\n\nimport CloseIcon from '@material-ui/icons/Close';\nimport DeleteIcon from '@material-ui/icons/TimerOff';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport useSession from '../../hooks/useSession';\n\nconst useStyles = makeStyles(theme => ({\n formControlDays: {\n margin: 0,\n marginLeft: '-8px',\n marginRight: '2px',\n paddingTop: 0,\n height: 1,\n fontSize: theme.typography.fontSize * 0.8,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: '10px',\n marginBottom: '25px',\n },\n radius_rounded: {\n },\n centerCenter: {\n alignItems: 'center',\n justifyContent: 'center',\n marginBottom: -12\n },\n radioDays: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 2,\n marginLeft: 0,\n },\n titlePersonSelect: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n formControl: {\n margin: 0,\n paddingTop: 0,\n },\n rowButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small'\n },\n formControlLbl: {\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n },\n picture: {\n width: theme.spacing(16),\n height: theme.spacing(16),\n [theme.breakpoints.down('xs')]: {\n width: theme.spacing(8),\n height: theme.spacing(8),\n },\n },\n photoButton: {\n alignSelf: 'center',\n size: 'sm',\n variant: 'outlined',\n verticalAlign: 'middle',\n },\n defaultButton: {\n alignSelf: 'end',\n marginTop: 20,\n textTransform: 'none',\n verticalAlign: 'center',\n color: theme.palette.confirm[theme.palette.type],\n },\n topButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n resetButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n marginRight: 10,\n },\n infoButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.info[theme.palette.type],\n marginRight: 10,\n paddingRight: 10,\n marginLeft: 10,\n paddingLeft: 10,\n },\n freeInput: {\n marginLeft: theme.spacing(1),\n marginTop: '15px',\n marginRight: 2,\n marginBottom: '10px',\n paddingLeft: 0,\n paddingRight: 0,\n width: '90%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n minHeight: theme.typography.fontSize * 2.8,\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n listItemAVA: {\n fontSize: theme.typography.fontSize * 1.5,\n },\n listItemHighlighted: {\n fontSize: theme.typography.fontSize * 1.5,\n backgroundColor: 'yellow'\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n noRow: {\n marginLeft: 0,\n marginTop: 0,\n marginBottom: 0,\n paddingTop: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n dialogBox: {\n paddingTop: 0,\n paddingLeft: 0,\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n overflowX: 'hidden',\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 5,\n },\n}));\n\nexport default ({ patient, peopleList, picture, showNewEvent, onClose }) => {\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const { state } = useSession();\n\n const { closeSnackbar, enqueueSnackbar } = useSnackbar();\n\n const [reactData, setReactData] = React.useState({\n groupList: [],\n restrictToGroups: [],\n slotObjList: [],\n selectedGroups: [],\n messageList: [],\n deleteKeyPending: false,\n description: '',\n eventStartDisplayDate: '',\n StartAsADateObj: {},\n EndAsADateObj: {},\n specificPeople: '',\n criticalMessage: false,\n priorityMessage: false\n });\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n React.useEffect(() => {\n if (patient) {\n }\n }, [patient]);\n\n const handleAbort = () => {\n onClose();\n };\n\n const handleUpdate = async () => {\n let putMarquee = {\n \"client_id\": state.session.client_id,\n \"message_key\": new Date().getTime(),\n \"start_time\": reactData.StartAsADateObj.timestamp,\n \"end_time\": reactData.EndAsADateObj.timestamp,\n \"groups\": (reactData.selectedGroups ? Object.keys(reactData.selectedGroups) : []),\n \"message\": reactData.description,\n \"style\": (reactData.criticalMessage ? { color: 'red' } : \"\"),\n \"author\": state.session.user_id,\n \"criticalMessage\": reactData.criticalMessage,\n \"priorityMessage\": reactData.priorityMessage\n };\n let goodPut = true;\n await dbClient\n .put({\n Item: putMarquee,\n TableName: \"MarqueeMessages\",\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating MarqueeMessages; error is:`, error);\n goodPut = false;\n });\n closeSnackbar();\n if (goodPut) {\n putMarquee.groupNames = [];\n for (let g = 0; g < putMarquee.groups.length; g++) {\n let gObj = await getGroup(putMarquee.groups[g]);\n putMarquee.groupNames.push(gObj.name);\n }\n reactData.messageList.push(putMarquee);\n updateReactData({\n messageList: reactData.messageList,\n description: '',\n }, true);\n }\n else {\n enqueueSnackbar(`Sorry. AVA could not save this message!`, { variant: 'error' });\n }\n };\n\n async function stopMessage(messageKey) {\n let response = true;\n dbClient\n .update({\n Key: {\n client_id: state.session.client_id,\n message_key: messageKey\n },\n UpdateExpression: 'set end_time = :now',\n ExpressionAttributeValues: {\n ':now': new Date().getTime()\n },\n TableName: \"MarqueeMessages\",\n })\n .promise()\n .catch(error => {\n response = false;\n });\n return response;\n }\n\n\n React.useEffect(() => {\n async function initialize() {\n let options = {\n futureOK: true,\n rawData: true\n };\n let marqueeData = await getMarqueeMessage(state.session.client_id, options);\n for (let m = 0; m < marqueeData.length; m++) {\n if (marqueeData[m].groups && (marqueeData[m].groups.length > 0)) {\n marqueeData[m].groupNames = [];\n for (let g = 0; g < marqueeData[m].groups.length; g++) {\n let gObj = await getGroup(marqueeData[m].groups[g]);\n marqueeData[m].groupNames.push(gObj.name);\n }\n }\n }\n updateReactData({\n messageList: marqueeData\n }, true);\n }\n initialize();\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n // **************************\n\n function OK2Save() {\n return ((reactData.description.trim() !== '')\n && (reactData.StartAsADateObj && !reactData.StartAsADateObj.error)\n && (reactData.EndAsADateObj && !reactData.EndAsADateObj.error));\n }\n\n const handleChangeDescription = vCheck => {\n updateReactData({\n description: vCheck\n }, true);\n };\n\n const handleChangeDateFrom = vCheck => {\n updateReactData({\n eventStartDisplayDate: (vCheck.length === 0 ? '' : vCheck)\n }, true);\n };\n\n const resolveFromDate = vCheck => {\n let goodDate = makeDate(vCheck);\n if (!goodDate.error) {\n updateReactData({\n eventStartDisplayDate: goodDate.absolute,\n StartAsADateObj: goodDate\n }, true);\n }\n };\n\n const handleChangeDateTo = vCheck => {\n updateReactData({\n eventEndDisplayDate: (vCheck.length === 0 ? '' : vCheck)\n }, true);\n };\n\n const resolveToDate = vCheck => {\n let goodDate = makeDate(vCheck);\n if (!goodDate.error) {\n updateReactData({\n eventEndDisplayDate: goodDate.absolute,\n EndAsADateObj: goodDate\n }, true);\n }\n };\n\n const handleChangePeopleToggle = event => {\n updateReactData({\n specificPeople: event.target.value\n }, true);\n };\n\n const handleChangeCriticalToggle = event => {\n updateReactData({\n criticalMessage: (event.target.value === 'true')\n }, true);\n };\n\n const handleChangePriorityToggle = event => {\n updateReactData({\n priorityMessage: (event.target.value === 'true')\n }, true);\n };\n\n // **************************\n\n return (\n \n \n \n \n {'Manage Marquee Messages'}\n \n \n \n \n \n \n \n Create a New Message\n \n \n \n \n \n
    \n
    \n (handleChangeDescription(event.target.value))}\n />\n
    \n
    \n {\n resolveFromDate(event.target.value);\n }}\n onChange={(event) => {\n handleChangeDateFrom(event.target.value);\n }}\n />\n
    \n
    \n {\n resolveToDate(event.target.value);\n }}\n onChange={(event) => {\n handleChangeDateTo(event.target.value);\n }}\n />\n
    \n \n \n {`Critical message? This will display in red, and be the only message on the screen.`}\n \n \n \n }\n label={\n \n No\n }\n />\n }\n label={\n \n Yes\n }\n />\n \n \n \n \n \n {`When displayed, should this message suppress weather and other greetings?`}\n \n \n \n }\n label={\n \n No\n }\n />\n }\n label={\n \n Yes\n }\n />\n \n \n \n \n Do you wish to restrict this event to specific groups only?\n \n \n }\n label={\n \n No\n }\n />\n }\n label={\n \n Yes\n }\n />\n \n \n \n \n
    \n {(reactData.specificPeople === 'yes') &&\n \n \n {`Administrative Groups`}\n \n {state.groups.adminHierarchy.map((gObj, ndx) => (\n {\n e.preventDefault();\n enqueueSnackbar(`Group ID=${gObj.id}`, { variant: 'info', persist: true });\n }}\n >\n \n {\n if (reactData.selectedGroups.hasOwnProperty(gObj.id)) {\n delete reactData.selectedGroups[gObj.id];\n }\n else {\n reactData.selectedGroups[gObj.id] = true;\n }\n updateReactData({\n selectedGroups: reactData.selectedGroups\n }, true);\n }}\n checked={reactData.selectedGroups.hasOwnProperty(gObj.id)}\n />\n {gObj.name}\n \n \n ))}\n \n \n {`Public (optional) Groups`}\n \n \n {Object.keys(state.groups.publicGroups).map((gID, ndx) => (\n {\n e.preventDefault();\n enqueueSnackbar(`Group ID=${gID}`, { variant: 'info', persist: true });\n }}\n >\n \n {\n if (reactData.selectedGroups.hasOwnProperty(gID)) {\n delete reactData.selectedGroups[gID];\n }\n else {\n reactData.selectedGroups[gID] = true;\n }\n updateReactData({\n selectedGroups: reactData.selectedGroups\n }, true);\n }\n }\n checked={reactData.selectedGroups.hasOwnProperty(gID)}\n />\n {state.groups.publicGroups[gID].group_name}\n \n \n ))}\n \n \n {`Private Groups`}\n \n \n {Object.keys(state.groups.privateGroups).map((gID, ndx) => (\n {\n e.preventDefault();\n enqueueSnackbar(`Group ID=${gID}`, { variant: 'info', persist: true });\n }}\n >\n \n {\n if (reactData.selectedGroups.hasOwnProperty(gID)) {\n delete reactData.selectedGroups[gID];\n }\n else {\n reactData.selectedGroups[gID] = true;\n }\n updateReactData({\n selectedGroups: reactData.selectedGroups\n }, true);\n }\n }\n checked={reactData.selectedGroups.hasOwnProperty(gID)}\n />\n {state.groups.privateGroups[gID].group_name || gID}\n \n \n ))}\n \n \n \n }\n \n
    \n \n \n \n \n Current and Upcoming Messages\n \n \n \n \n \n {reactData.messageList.map((this_message, index) => (\n \n\n \n \n {\n updateReactData({\n deleteKeyPending: this_message.message_key,\n deleteTextPending: this_message.message\n }, true);\n }}\n />\n \n \n {this_message.criticalMessage &&\n \n {`*** Critical Message - All others hidden ***`}\n \n }\n {this_message.priorityMessage &&\n \n {`Weather and greetings hidden while this message is displayed`}\n \n }\n \n {this_message.message}\n \n \n {`Start: ${makeDate(this_message.start_time).absolute}`}\n \n \n {`End: ${makeDate(this_message.end_time).absolute}`}\n \n {this_message.groups && (this_message.groups.length > 0) &&\n \n {`Restricted to: ${this_message.groupNames.sort().join(', ')}`}\n \n }\n \n \n \n ))}\n \n \n \n
    \n \n \n \n { onClose(); }}\n startIcon={}\n >\n {'Exit'}\n \n {OK2Save() &&\n {\n await handleUpdate();\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n >\n {'Save'}\n \n }\n \n \n \n\n
    \n {reactData.deleteKeyPending &&\n {\n updateReactData({\n deleteKeyPending: false\n }, true);\n }}\n onConfirm={async () => {\n let removed = await stopMessage(reactData.deleteKeyPending);\n if (removed) {\n let foundAt = reactData.messageList.findIndex(m => {\n return (m.message_key === reactData.deleteKeyPending);\n });\n if (foundAt > -1) {\n reactData.messageList.splice(foundAt, 1);\n }\n }\n updateReactData({\n messageList: reactData.messageList,\n deleteKeyPending: false\n }, true);\n }}\n >\n \n }\n \n );\n};\n","import React from 'react';\n\nimport { makeName, getImage, getPerson } from '../../util/AVAPeople';\nimport { deepCopy, titleCase, sentenceCase, makeArray, s3, isObject, isEmpty } from '../../util/AVAUtilities';\nimport { getActivity } from '../../util/AVAObservations';\nimport { makeDate } from '../../util/AVADateTime';\nimport { buildDisplayRows, buildQualifiers } from '../../util/AVAActivityLoader';\nimport { putServiceRequest, getServiceRequests, updateServiceRequest, formatServiceRequestDetails, validRequestStatus } from '../../util/AVAServiceRequest';\nimport PersonFilter from './PersonFilter';\nimport { useSnackbar } from 'notistack';\n\nimport SignatureCanvas from 'react-signature-canvas';\n\nimport useSession from '../../hooks/useSession';\nimport TextField from '@material-ui/core/TextField';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Typography from '@material-ui/core/Typography';\nimport Button from '@material-ui/core/Button';\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport CheckIcon from '@material-ui/icons/Check';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport GroupAddIcon from '@material-ui/icons/GroupAdd';\nimport CloudUploadIcon from '@material-ui/icons/CloudUpload';\nimport LinearProgress from '@material-ui/core/LinearProgress';\n\nimport HomeIcon from '@material-ui/icons/Home';\nimport AutorenewIcon from '@material-ui/icons/Autorenew';\n\nimport Avatar from '@material-ui/core/Avatar';\nimport Menu from '@material-ui/core/Menu';\nimport MenuList from '@material-ui/core/MenuList';\nimport MenuItem from '@material-ui/core/MenuItem';\n\nimport Radio from '@material-ui/core/Radio';\n\nimport AVAConfirm from './AVAConfirm';\nimport { mealTicketFormat, prepareMessage, sendMessages, resolveMessageVariables } from '../../util/AVAMessages';\n\nimport { AVAclasses, AVADefaults, AVATextStyle } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n smallTextLine: {\n fontSize: theme.typography.fontSize * 1.0,\n flexGrow: 0,\n lineHeight: 1.25,\n whiteSpace: 'break-spaces'\n },\n messageArea: {\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n popUpFooter: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 1,\n },\n freeInput: {\n marginLeft: theme.spacing(1),\n paddingLeft: 0,\n paddingRight: 0,\n flexGrow: 2,\n fontSize: theme.typography.fontSize * 1.3,\n },\n confirm: {\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n rootNoPadding: {\n paddingBottom: 0,\n paddingTop: 0,\n },\n inputRow: {\n marginTop: theme.spacing(1.5),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n },\n listItem: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n hiddenItem: {\n display: 'none',\n visibility: 'hidden'\n },\n listTopRow: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n listItemSticky: { // keep\n position: 'sticky',\n top: 0,\n opacity: 1,\n zIndex: 1,\n width: '100%',\n },\n page: {\n // height: 950,\n },\n buttonArea: {\n maxWidth: 1000,\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n }\n}));\n\nexport default ({ fact, factName, defaultValue, prompt, pClient, qualifiers, listValues, onSave, onClose }) => {\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n const { state } = useSession();\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const [cancelPending, setCancelPending] = React.useState(false);\n const [confirmStatus, setConfirmStatus] = React.useState('');\n const [confirmPrompt, setConfirmPrompt] = React.useState(false);\n const [confirmDelete, setConfirmDelete] = React.useState(false);\n const [morePeople, setMorePeople] = React.useState(false);\n\n const [reactData, setReactData] = React.useState({\n initialLoadComplete: false,\n defaultPerson: null,\n defaultQualSelections: {},\n defaultRequestType: null,\n titleName: {\n display: null,\n remembered: []\n },\n columnList: [],\n loadProgress: [],\n attachmentList: [],\n allowAttachments: false,\n errorOnScreen: false,\n factName: factName\n });\n\n const [records2Update, setRecords2Update] = React.useState([]);\n const [allowAddPeople, setAllowAddPeople] = React.useState(false);\n const [allowRemovePeople, setAllowRemovePeople] = React.useState(true);\n\n const [popupMenuOpen, setPopupMenuOpen] = React.useState(false);\n const [anchorEl, setAnchorEl] = React.useState(null);\n\n const [selectedColumn, setSelectedColumn] = React.useState(0);\n\n const factType = fact.activity_key.split('.')[0];\n\n const handleClick = async (event) => {\n setAnchorEl(event.currentTarget);\n };\n\n /* value | meaning | example */\n /* --------- | ---------- | ------------- */\n\n /* headers...\n /* ~~ | section header | ~~Entree Choices */\n\n /* check boxes...\n /* | selection/check box | Filet Mignon */\n\n /* instructions...\n /* ~[checkbox=off] | Stop rendering check boxes, render value only\n /* ~[checkbox=on] | Begin rendering check boxes AND values\n /* ~[display=off] | Do not display anything until display=on is encountered\n /* ~[display=on] | Begin showing lines again\n /* ~[required=on] | Text fields between these tags must not be left blank\n /* ~[required=off] | Stop requiring entry in text fields\n /* ~[displayIF=test] | only show this row if the test is true, will keep test on until endif encountered\n /* ~[endif] | stop testing rows\n\n \n /* prompt for response...\n /* ~other: | prompt for text response with | ~other:What is your name? */\n /* ~time: | prompt for time response with | ~time:What time would you like your meal? */\n /* ~date: | prompt for date response with | ~date:What date would you like your meal? */\n\n /* special cases...\n /* ~+~ | use value only when is selected | ~+Filet Mignon~~!How would you like your filet cooked? */\n\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n async function extractRequestType(aKey) {\n let activityParts = aKey.split('//');\n let activityCode = activityParts.pop();\n let activityClient = ((activityParts.length > 0) ? activityParts[0] : state.session.client_id);\n let activityRec = await getActivity(activityClient, activityCode);\n return activityRec.request_type || activityRec.name;\n }\n\n async function initialLoad() {\n let defaultObj = buildDefaults(defaultValue);\n let paymentInfo = defaultObj.collectPayment\n || defaultValue.collectPayment\n || (defaultValue.global_defaults && defaultValue.global_defaults.collectPayment);\n if (paymentInfo) {\n if (typeof (paymentInfo) === 'string') {\n paymentInfo = {\n allow: true\n };\n }\n updateReactData({\n collectPayment: paymentInfo,\n }, false);\n }\n let defaultColumnList = [];\n let localData_maxDName = 0;\n // eslint-disable-next-line\n { // build defaultColumns object from passed in activities for this request\n if (!defaultValue || !defaultValue.hasOwnProperty('activities')) {\n if (!fact.activity_code && fact.activity_key) {\n fact.activity_code = fact.activity_key;\n }\n let this_requestType = defaultValue.requestType || defaultValue.request_type || await extractRequestType(fact.activity_code) || 'noRType';\n let this_requestName = state.session.service_request_types.hasOwnProperty(this_requestType) ? state.session.service_request_types[this_requestType].description : titleCase(this_requestType);\n let this_foreignKey = defaultValue.foreignKey || defaultValue.foreign_key || 'noFKey';\n let fDate = makeDate(this_foreignKey);\n let dName = ([' ', ' ', ' '].concat(this_requestName.split(' ').slice(-3)).concat(fDate.error ? [] : ((fDate.absolute).split(','))));\n localData_maxDName = Math.max((localData_maxDName || 0), dName.length);\n defaultColumnList.push({\n rowDetails: await buildDisplayRows(listValues, defaultObj, qualifiers),\n activity_key: fact.activity_code,\n foreignKey: this_foreignKey,\n requestType: this_requestType,\n requestName: this_requestName,\n defaultValues: defaultObj,\n column_id: `${this_requestType}_${this_foreignKey}`,\n dName: dName\n });\n }\n else {\n for (let a = 0; a < defaultValue.activities.length; a++) {\n // merge global defaults and column_defaults into a single object; column_defaults will override globals\n let defaultsToUse = deepCopy(Object.assign({}, defaultObj, defaultValue.activities[a].column_defaults || {}));\n // if this activity carries qualifiers with it, add those to the qualifiers object that was passed in\n if (defaultsToUse.hasOwnProperty('collectPayment')) {\n if (typeof (defaultsToUse.collectPayment) === 'string') {\n updateReactData({\n collectPayment: {\n allow: true\n }\n }, false);\n }\n else {\n updateReactData({\n collectPayment: defaultsToUse.collectPayment,\n }, false);\n }\n }\n if (defaultValue.activities[a].hasOwnProperty('qualifiers')) {\n Object.assign(qualifiers, defaultValue.activities[a].qualifiers);\n }\n let this_activityKey = defaultValue.activities[a].column_defaults.activity_code || defaultValue.activities[a].activityRec.activity_code || fact.activity_code;\n let this_requestType = defaultValue.activities[a].column_defaults.requestType || defaultValue.requestType || defaultValue.request_type || await extractRequestType(this_activityKey) || 'noRType';\n let this_requestName = state.session.service_request_types.hasOwnProperty(this_requestType) ? state.session.service_request_types[this_requestType].description : titleCase(this_requestType);\n let this_foreignKey = defaultValue.activities[a].column_defaults.foreignKey || defaultValue.foreignKey || defaultValue.foreign_key || 'noFKey';\n let fDate = makeDate(this_foreignKey);\n let dName = ([' ', ' ', ' '].concat(this_requestName.split(' ').slice(-3)).concat(fDate.error ? [] : ((fDate.absolute).split(/,\\s*/))));\n localData_maxDName = Math.max((localData_maxDName || 0), dName.length);\n defaultColumnList.push({\n rowDetails: await buildDisplayRows(defaultValue.activities[a].activityRec.valid_values_list, defaultsToUse, qualifiers),\n activity_key: this_activityKey,\n foreignKey: this_foreignKey,\n requestType: this_requestType,\n requestName: this_requestName,\n defaultValues: defaultsToUse,\n column_id: `${this_requestType}_${this_foreignKey}`,\n dName: dName\n\n });\n }\n }\n }\n\n updateReactData({\n defaultColumns: defaultColumnList,\n maxDName: localData_maxDName,\n columnList: []\n }, false);\n\n // columns are created for each person_id, foreignKey, requestType combination\n // The person is assigned in one of three ways: \n // 1. selected - a selectList will be passed in the defaultValue.selectList\n // 2. pre-assigned - a peopleList will be passed in the defaultValue.peopleList\n // 3. default - if neither of the above, use the current session.patient_id\n\n if (defaultValue.peopleList && defaultValue.peopleList.peopleList && (defaultValue.peopleList.peopleList.length > 0)) {\n for (let p = 0; p < defaultValue.peopleList.peopleList.length; p++) {\n await addColumns(defaultValue.peopleList.peopleList[p].person_id);\n }\n }\n else if (defaultValue.selectList) {\n updateReactData({\n selectionList: defaultValue.selectList.selectionList || defaultValue.selectList.shortList\n }, false);\n }\n else {\n await addColumns(state.session.patient_id);\n }\n\n updateReactData({\n initialLoadComplete: true,\n columnList: reactData.columnList,\n titleName: reactData.titleName\n }, true);\n\n function buildDefaults(defaultValue) {\n let returnObj = {};\n if (defaultValue) {\n for (let dKey in defaultValue) {\n switch (dKey) {\n case ('importTypes'): {\n break;\n }\n case ('allowAddPeople'): {\n setAllowAddPeople(defaultValue.allowAddPeople);\n break;\n }\n case ('allowAttachment'):\n case ('allowAttachments'): {\n updateReactData({ allowAttachments: true }, false);\n break;\n }\n case ('allowRemovePeople'): {\n setAllowRemovePeople(defaultValue.allowRemovePeople);\n break;\n }\n case ('selectList'): {\n if (defaultValue.selectList.addPeople) {\n setAllowAddPeople(defaultValue.selectList.addPeople);\n }\n break;\n }\n case ('peopleList'): {\n if (defaultValue.peopleList.addPeople) {\n setAllowAddPeople(defaultValue.peopleList.addPeople);\n }\n break;\n }\n case ('activities'): {\n break;\n }\n default: {\n if (typeof defaultValue[dKey] === 'string') {\n returnObj[dKey] = defaultValue[dKey];\n }\n }\n };\n }\n }\n return returnObj;\n }\n\n };\n\n React.useEffect(() => {\n async function initialize() {\n await initialLoad();\n }\n if (!reactData.initialLoadComplete) {\n initialize();\n }\n }, [defaultValue]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n function columnUniqueName(my_column) {\n let commonRows = ([' ', ' ', ' ', ' ', ' '].concat(reactData.columnList[0].dName)).slice(-10);\n reactData.columnList.forEach(this_column => {\n let testName = ([' ', ' ', ' ', ' ', ' '].concat(this_column.dName)).slice(-10);\n testName.forEach((dN, dX) => {\n if (dN !== commonRows[dX]) {\n commonRows[dX] = false;\n }\n });\n });\n let testName = ([' ', ' ', ' ', ' ', ' '].concat(my_column.dName)).slice(-10);\n let showName = testName.filter((n, x) => {\n return !commonRows[x];\n });\n let returnData = {\n string: showName.slice(-7).join(' ').trim(),\n array: showName\n };\n return returnData;\n }\n\n function columnCommonName() {\n let commonRows = ([' ', ' ', ' ', ' ', ' '].concat(reactData.columnList[0].dName)).slice(-1 * reactData.maxDName);\n reactData.columnList.forEach(this_column => {\n let testName = ([' ', ' ', ' ', ' ', ' '].concat(this_column.dName)).slice(-1 * reactData.maxDName);\n testName.forEach((dN, dX) => {\n if (dN !== commonRows[dX]) {\n commonRows[dX] = false;\n }\n });\n });\n let commonText = '';\n commonRows.forEach(c => {\n if (c && !reactData.columnList[0].display_name.includes(c)) { commonText += (c + ' '); };\n });\n updateReactData({\n commonText,\n commonRows\n }, false);\n return;\n }\n\n const onCheckEnter = (event, columnNumber, rowNumber) => {\n if (event.key === 'Enter' || event.type === 'blur') {\n if (reactData.columnList[columnNumber].rowDetails[rowNumber].input === 'date') {\n handleDateExit(event.target.value, columnNumber, rowNumber);\n }\n else if (reactData.columnList[columnNumber].rowDetails[rowNumber].input === 'time') {\n handleTimeExit(event.target.value, columnNumber, rowNumber);\n }\n else if (reactData.columnList[columnNumber].rowDetails[rowNumber].input.toLowerCase() === 'promptall') {\n handleTextAll(event.target.value, reactData.columnList[columnNumber].rowDetails[rowNumber].text);\n }\n else {\n if ((reactData.columnList[columnNumber].rowDetails[rowNumber].obo_line)\n || (reactData.columnList[columnNumber].rowDetails[rowNumber].input.toLowerCase() === 'obo')) {\n handleOBOText(event.target.value, columnNumber, rowNumber);\n }\n else {\n handleTextExit(event.target.value, columnNumber, rowNumber);\n if (reactData.columnList[columnNumber].rowDetails[rowNumber].required) {\n if (!event.target.value) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].error = 'This information is required';\n }\n else {\n reactData.columnList[columnNumber].rowDetails[rowNumber].error = '';\n }\n }\n }\n }\n }\n setForceRedisplay(!forceRedisplay);\n };\n\n const signatureRef = React.useRef(null);\n\n const hiddenFileInput = React.useRef(null);\n const handleFileUpload = event => {\n hiddenFileInput.current.click();\n };\n\n let upload;\n async function handleSaveFile(pTarget) {\n let pType = pTarget.type;\n upload = s3.upload({\n partSize: 10 * 1024 * 1024,\n queueSize: 4,\n Bucket: 'theseus-medical-storage',\n Key: pTarget.name,\n Body: pTarget,\n ACL: 'public-read-write',\n ContentType: pType\n });\n let reactData_index = reactData.attachmentList.push({\n Key: pTarget.name\n }) - 1;\n reactData.loadProgress[reactData_index] = {\n loading: true,\n fileName: '',\n total: 1,\n progress: 0\n };\n updateReactData({ loadProgress: reactData.loadProgress }, true);\n let s3Resp = await performUpload();\n reactData.attachmentList[reactData_index] = s3Resp;\n if (!reactData.textInput) { reactData.textInput = { 's3file': s3Resp.Location }; }\n else { reactData.textInput.s3file = s3Resp.Location; }\n reactData.loadProgress[reactData_index] = {\n loading: false,\n fileName: '',\n total: 1,\n progress: 0\n };\n updateReactData({\n loadProgress: reactData.loadProgress,\n attachmentList: reactData.attachmentList,\n textInput: reactData.textInput\n }, true);\n return s3Resp;\n\n function performUpload() {\n return new Promise(function (resolve, reject) {\n upload\n .send((err, good) => {\n if (err) {\n if (err.code === 'RequestAbortedError') {\n enqueueSnackbar(`AVA stopped loading at your request.`, { variant: 'error', persist: false });\n }\n else {\n enqueueSnackbar(`Uh oh! AVA couldn't save your file. The reason is ${err.message}`, { variant: 'error', persist: true });\n }\n reject({});\n }\n else {\n resolve(good);\n }\n });\n upload.on('httpUploadProgress', progress => {\n if (reactData.loadProgress[reactData_index].loading === 'abort') {\n upload.abort();\n reactData.loadProgress.splice(reactData_index, 1);\n }\n else {\n let pFactor = 1000;\n do {\n pFactor *= 10;\n }\n while (progress.total > (1000 * pFactor));\n reactData.loadProgress[reactData_index] = {\n loading: true,\n fileName: progress.key,\n total: (progress.total / pFactor),\n progress: ((progress.loaded * 100) / progress.total)\n };\n }\n updateReactData({ loadProgress: reactData.loadProgress }, true);\n });\n });\n };\n };\n\n const handleChangeTextField = (vText, columnNumber, rowNumber) => {\n reactData.columnList[columnNumber].columnActivated = true;\n if (!reactData.columnList[columnNumber].rowDetails[rowNumber].hasOwnProperty('textValue')) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].textValue = {};\n }\n if (!vText || (vText === '')) {\n handleTextExit(vText, columnNumber, rowNumber);\n }\n else {\n if (reactData.columnList[columnNumber].rowDetails[rowNumber].input.toLowerCase() === 'promptall') {\n handleTextAll(vText, reactData.columnList[columnNumber].rowDetails[rowNumber].text);\n }\n else {\n handleTextExit(vText.replace(/[\\r\\n]+/gm, ''), columnNumber, rowNumber);\n }\n }\n setForceRedisplay(!forceRedisplay);\n return;\n };\n\n function handleDateExit(vText, columnNumber, rowNumber) {\n let AVAdate = makeDate(vText, reactData.columnList[columnNumber].rowDetails[rowNumber].row_qualifier);\n if (AVAdate.error) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].error = AVAdate.absolute;\n }\n else {\n reactData.columnList[columnNumber].rowDetails[rowNumber].error = '';\n reactData.columnList[columnNumber].rowDetails[rowNumber].textValue = AVAdate.absolute_full;\n }\n // reactData.errorOnScreen = (AVAdate.error && !!AVAdate.absolute);\n updateReactData({ columnList: reactData.columnList }, true);\n };\n\n function handleTimeExit(vText, columnNumber, rowNumber) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].error = '';\n let ampm = null;\n if (vText.includes('p')) { ampm = 'pm'; }\n else if (vText.includes('a')) { ampm = 'am'; };\n let [hh$, mm$] = vText.split(':');\n let hh = Number(hh$.replace(/\\D+/g, ''));\n let mm = 0;\n if (hh > 100) {\n if (!mm$) { mm = hh % 100; }\n hh = Math.floor(hh / 100);\n }\n if (mm$) { mm = Number(mm$.replace(/\\D+/g, '')); }\n if (mm > 59) {\n let hAdd = Math.floor(mm / 60);\n mm -= (hAdd * 60);\n hh += hAdd;\n }\n if (hh >= 23) {\n hh = hh % 24;\n }\n if (hh >= 12) {\n hh -= 12;\n ampm = 'pm';\n }\n if (hh === 0) {\n hh = 12;\n ampm = 'pm';\n }\n if (!ampm) { ampm = ((hh > 6) && (hh < 12)) ? 'am' : 'pm'; }\n reactData.columnList[columnNumber].rowDetails[rowNumber].textValue = `${hh}:${mm < 10 ? ('0' + mm) : mm} ${ampm}`;\n updateReactData({ columnList: reactData.columnList }, true);\n };\n\n function handleTextExit(vText, columnNumber, rowNumber) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].textValue = vText;\n updateReactData({ columnList: reactData.columnList }, true);\n };\n\n function handleOBOText(vText, columnNumber, rowNumber) {\n let inactiveAssignment = state?.session?.group_assignments?.inactive;\n let inactiveGroup = [];\n if (!inactiveAssignment) {\n inactiveGroup = ['inactive'];\n }\n else if (Array.isArray(inactiveAssignment)) {\n inactiveGroup.push(...inactiveAssignment);\n }\n else {\n inactiveGroup = [inactiveAssignment];\n }\n let prohibitedGroups = inactiveGroup;\n if (defaultValue.obo_prohibited) {\n let prohibitedList = makeArray(defaultValue.obo_prohibited);\n prohibitedList.forEach(p => {\n prohibitedGroups.push(...makeArray(state?.session?.group_assignments?.[p]));\n });\n };\n let guestAssignment = state?.session?.group_assignments?.guest;\n let guestGroups = [];\n if (!guestAssignment) {\n guestGroups = ['guest'];\n }\n else if (Array.isArray(guestAssignment)) {\n guestGroups.push(...guestAssignment);\n }\n else {\n guestGroups = [guestAssignment];\n }\n let typed_in_words = vText.toLowerCase().split(/\\s+/);\n let hits = [];\n let hitCount = [];\n let errorText = null;\n let winner = false;\n let winner_at;\n let winnerList = [];\n if (!state?.accessList?.[state.session.client_id]?.list) {\n errorText = `AVA is still loading names. Please wait a few seconds and try again.`;\n }\n else {\n hits = state.accessList[state.session.client_id].list.filter(accessList_person => {\n if (prohibitedGroups.includes(accessList_person.member_of)) {\n return false;\n }\n // if any word in the display_name matches a typed in word, it is a \"hit\"\n let wordsMatched = accessList_person.display_name.toLowerCase().split(/\\s+/).reduce((total_matches, name_word) => { // for every word in the display_name...\n if (typed_in_words.some(typed_in_word => { // check for any typed in word that exactly matches\n return (typed_in_word === name_word);\n })) {\n total_matches++;\n };\n return total_matches;\n }, 0);\n if (wordsMatched > 0) {\n hitCount.push(wordsMatched);\n return true;\n }\n return false;\n });\n if (hits.length === 0) {\n errorText = `Nobody found to match that name`;\n }\n else if (hits.length === 1) {\n winner = true;\n winner_at = 0;\n let newDName = `${hits[winner_at].name?.first} ${hits[winner_at].name?.last}`.trim() || hits[winner_at].display_name;\n winnerList = [{\n person_id: hits[winner_at].id,\n dName: newDName,\n display: `${newDName}${guestGroups.includes(hits[winner_at].member_of) ? ' (Guest)' : ' (' + hits[winner_at].location + ')'}`,\n type: 'checkbox'\n }];\n }\n else if (hits.length > 1) {\n // is there a clear winner in the hit_count array?\n let maxHits = 0;\n let maxHitCount = 0;\n hitCount.forEach((h, x) => {\n if (h > maxHits) {\n winner_at = x;\n winner = true;\n maxHits = h;\n maxHitCount = 1;\n let newDName = `${hits[winner_at].name?.first} ${hits[winner_at].name?.last}`.trim() || hits[winner_at].display_name;\n let dText = `${newDName}${guestGroups.includes(hits[winner_at].member_of) ? ' (Guest)' : ' (' + hits[winner_at].location + ')'}`;\n winnerList = [{\n default: dText,\n max_allowed: 1,\n min_required: 1,\n option: [{\n person_id: hits[winner_at].id,\n location: hits[winner_at].location,\n dName: newDName,\n display: dText,\n type: 'checkbox'\n }],\n }];\n }\n else if (h === maxHits) {\n winner = false;\n maxHitCount++;\n let newDName = `${hits[x].name?.first} ${hits[x].name?.last}`.trim() || hits[x].display_name;\n winnerList[0].option.push({\n person_id: hits[x].id,\n location: hits[x].location,\n dName: newDName,\n display: `${newDName}${guestGroups.includes(hits[x].member_of) ? ' (Guest)' : ' (' + hits[x].location + ')'}`,\n type: 'checkbox'\n });\n }\n });\n if (!winner) {\n winnerList[0].title = `AVA found ${maxHitCount} people to match that name.`;\n }\n }\n }\n let targetColumns = [];\n if (!defaultValue.selectList) {\n reactData.columnList.forEach((c, x) => {\n targetColumns.push(x);\n });\n }\n else {\n targetColumns.push(columnNumber);\n }\n targetColumns.forEach(c => {\n reactData.columnList[c].rowDetails[rowNumber].error = '';\n reactData.columnList[c].rowDetails[rowNumber].qualData = [];\n reactData.columnList[c].rowDetails[rowNumber].qualSelections = {};\n if (winner) {\n reactData.columnList[c].person_id = hits[winner_at].id;\n let newDName = `${hits[winner_at].name?.first} ${hits[winner_at].name?.last}`.trim() || hits[winner_at].display_name;\n reactData.columnList[c].display_name = newDName;\n reactData.columnList[c].dName.splice(-3, 3, ...([' ', ' ', ' '].concat(newDName.split(/\\s+/).splice(-3))));\n vText = `${newDName}`;\n if (guestGroups.includes(hits[winner_at].member_of)) {\n vText += ` (Guest)`;\n }\n resetTitleName();\n reactData.columnList[c].rowDetails.forEach((checkRow, r) => {\n if (checkRow.location_line) {\n reactData.columnList[c].rowDetails[r].textValue = hits[winner_at].location || '';\n }\n });\n }\n else if (errorText) {\n reactData.columnList[c].rowDetails[rowNumber].error = errorText;\n }\n else {\n reactData.columnList[c].person_id = winnerList[0].option[0].person_id;\n reactData.columnList[c].display_name = winnerList[0].option[0].dName;\n reactData.columnList[c].dName.splice(-3, 3, ...([' ', ' ', ' '].concat(winnerList[0].option[0].dName.split(/\\s+/).splice(-3))));\n resetTitleName();\n reactData.columnList[c].rowDetails[rowNumber].isChecked = true;\n reactData.columnList[c].rowDetails[rowNumber].qualData = winnerList;\n reactData.columnList[c].rowDetails[rowNumber].qualSelections = {\n [winnerList[0].title]: {\n [winnerList[0].option[0].display]: true\n }\n };\n vText = winnerList[0].option[0].dName;\n reactData.columnList[c].rowDetails.forEach((checkRow, r) => {\n if (checkRow.location_line) {\n reactData.columnList[c].rowDetails[r].textValue = winnerList[0].option[0].location || '';\n }\n });\n }\n reactData.columnList[c].rowDetails[rowNumber].textValue = titleCase(vText);\n });\n updateReactData({ columnList: reactData.columnList }, true);\n };\n\n function loadingInProgress(index = 'all') {\n if (!reactData.loadProgress) {\n return false;\n }\n if (index !== 'all') {\n return (reactData.loadProgress[index] && reactData.loadProgress[index].loading);\n }\n else {\n return (reactData.loadProgress.some(i => {\n return (i.loading);\n }));\n }\n }\n\n function resetTitleName() {\n let workingTitle = {};\n reactData.columnList.forEach(this_person => {\n let nameWords = this_person.display_name.split(/\\s+/);\n let this_lastName = nameWords.pop();\n let this_firstName = nameWords.join(' ');\n if (!workingTitle || !workingTitle.remembered || (workingTitle.remembered.length === 0)) {\n workingTitle = {\n first: this_firstName,\n last: this_lastName.trim(),\n display: this_person.display_name,\n remembered: [this_person.display_name]\n };\n }\n else if (workingTitle.last.toLowerCase() !== this_lastName.trim().toLowerCase()) {\n if (!workingTitle.remembered.includes(this_person.display_name)) {\n workingTitle.display = `${workingTitle.remembered.push(this_person.display_name)} people`;\n }\n workingTitle.first = '_multi_';\n workingTitle.last = '_multi_';\n }\n else { // same last name as all others so far\n if (!workingTitle.remembered.includes(this_person.display_name)) {\n workingTitle.remembered.push(this_person.display_name);\n workingTitle.display = `${workingTitle.first} and ${this_person.display_name}`;\n workingTitle.first = `${workingTitle.first}, ${this_firstName.trim()}`;\n }\n }\n });\n updateReactData({ titleName: workingTitle }, false);\n }\n\n function handleTextAll(vText, this_item) {\n reactData.columnList.forEach((this_column, columnNumber) => {\n let rowNumber = this_column.rowDetails.findIndex(r => {\n return (r.text === this_item);\n });\n if (rowNumber >= 0) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].textValue = vText;\n }\n });\n updateReactData({ columnList: reactData.columnList }, true);\n };\n\n function isQualChecked(rowData, pOption, pSelection) {\n if (!rowData.qualSelections) { return false; }\n if (!rowData.qualSelections.hasOwnProperty(pOption)) { return false; }\n return !!rowData.qualSelections[pOption][pSelection];\n }\n\n async function itemSelected(columnNumber, rowNumber) {\n let this_row = reactData.columnList[columnNumber].rowDetails[rowNumber];\n this_row.isChecked = !this_row.isChecked;\n if (this_row.isChecked && this_row.observationKey && !this_row.qualData) {\n // let [myQualSelections, myQualData] = await buildQualifiers(this_row.observationKey);\n let qualResponse = await buildQualifiers(this_row.observationKey);\n if (Object.keys(qualResponse.selections).length > 0) {\n this_row.qualSelections = deepCopy(qualResponse.selections);\n }\n if (Object.keys(qualResponse.data).length > 0) {\n this_row.qualData = deepCopy(qualResponse.data);\n }\n if (Object.keys(qualResponse.moreInfo).length > 0) {\n this_row.moreInfo = deepCopy(qualResponse.moreInfo);\n }\n }\n reactData.columnList[columnNumber].columnActivated = true;\n reactData.columnList[columnNumber].rowDetails[rowNumber] = this_row;\n updateReactData({ columnList: reactData.columnList }, true);\n }\n\n function getQualTextValue(rowData, qOpt, qChoice) {\n if (rowData.qualSelections && rowData.qualSelections[qOpt]) {\n return rowData.qualSelections[qOpt][qChoice] || '';\n }\n else {\n return '';\n }\n }\n\n function optSelected(rowData, qOpt, qChoice, qValueText) {\n // reactData.columnList[columnNumber].rowDetails[rowNumber].qualSelections[pText][pOption][pSelection]\n if (!rowData.hasOwnProperty('qualData')) {\n return;\n }\n // which entry in qualData contains the qOpt information?\n let optionAt = rowData.qualData.findIndex(opt => {\n return (opt.title === qOpt);\n });\n if (optionAt < 0) {\n return;\n }\n let qualRules = rowData.qualData[optionAt];\n // which option in rowData.qualData[optionAt] contains the qChoice information?\n\n // reactData.columnList[columnNumber].rowDetails[rowNumber].hasOwnProperty('qualSelections').qualSelections[pText][pOption][pSelection]\n if (!rowData.hasOwnProperty('qualSelections')) {\n rowData.qualSelections = {\n };\n }\n if (!rowData.qualSelections.hasOwnProperty(qOpt)) {\n rowData.qualSelections[qOpt] = {\n [qChoice]: (qValueText || true)\n };\n }\n else {\n if (rowData.qualSelections[qOpt].hasOwnProperty(qChoice)) {\n if (typeof (rowData.qualSelections[qOpt][qChoice]) === 'boolean') {\n rowData.qualSelections[qOpt][qChoice] = !rowData.qualSelections[qOpt][qChoice];\n }\n else { rowData.qualSelections[qOpt][qChoice] = qValueText; }\n }\n else { rowData.qualSelections[qOpt][qChoice] = (qValueText || true); }\n }\n\n let optionsSelected = [];\n for (let choice in rowData.qualSelections[qOpt]) {\n if (rowData.qualSelections[qOpt][choice]) {\n optionsSelected.push(choice);\n }\n }\n let numberOfSelections = optionsSelected.length;\n if (qualRules.max_allowed && (numberOfSelections > qualRules.max_allowed)) {\n for (let o = 0; ((o < optionsSelected.length) && (numberOfSelections > qualRules.max_allowed)); o++) {\n // too many selections? turn off the first one we find that isn't the one requested in the function call\n if (optionsSelected[o] !== qChoice) {\n rowData.qualSelections[qOpt][optionsSelected[o]] = false;\n numberOfSelections--;\n }\n }\n }\n if (qualRules.min_required && (numberOfSelections < qualRules.min_required)) { // not enough selections\n if (qualRules.default && !rowData.qualSelections[qOpt][qualRules.default]) { // and the default is not selected \n rowData.qualSelections[qOpt][qualRules.default] = true;\n numberOfSelections++;\n }\n for (let o = 0; ((o < qualRules.option.length) && (numberOfSelections < qualRules.min_required)); o++) {\n // start turning things on until we have enough; but don't touch the one requested in the function call\n if ((!rowData.qualSelections[qOpt][qualRules.option[o].display])\n && (qualRules.option[o].display !== qOpt)\n && (qualRules.option[o].type === 'checkbox')\n ) {\n rowData.qualSelections[qOpt][qualRules.option[o].display] = true;\n numberOfSelections++;\n }\n }\n }\n return rowData;\n }\n\n async function addColumns(this_id) {\n let this_person = await getPerson(this_id);\n let this_name = (`${this_person.name.first} ${this_person.name.last}`).trim();\n if (!reactData.titleName || !reactData.titleName.remembered || (reactData.titleName.remembered.length === 0)) {\n reactData.titleName = {\n first: this_person.name.first.trim(),\n last: this_person.name.last.trim(),\n display: this_name,\n remembered: [this_name]\n };\n }\n else if (reactData.titleName.last.toLowerCase() !== this_person.name.last.trim().toLowerCase()) {\n if (!reactData.titleName.remembered.includes(this_name)) {\n reactData.titleName.display = `${reactData.titleName.remembered.push(this_name)} people`;\n }\n reactData.titleName.first = '_multi_';\n reactData.titleName.last = '_multi_';\n }\n else { // same last name as all others so far\n if (!reactData.titleName.remembered.includes(this_name)) {\n reactData.titleName.remembered.push(this_name);\n reactData.titleName.display = `${reactData.titleName.first} and ${this_name}`;\n reactData.titleName.first = `${reactData.titleName.first}, ${this_person.name.first.trim()}`;\n }\n }\n let myDefaultColumns = deepCopy(reactData.defaultColumns);\n for (let c = 0; c < myDefaultColumns.length; c++) { // for each column\n let column = myDefaultColumns[c];\n for (let dKey in column.defaultValues) {\n if (column.defaultValues[dKey] === '[person.location]') {\n myDefaultColumns[c].defaultValues[dKey] = this_person.location;\n }\n else if (column.defaultValues[dKey] === '[person.name]') {\n myDefaultColumns[c].defaultValues[dKey] = `${this_person.first} ${this_person.last}`;\n }\n else if ((typeof (column.defaultValues[dKey]) === 'string') && (column.defaultValues[dKey].startsWith('[person.'))) {\n let pKey = column.defaultValues[dKey].split('.')[1];\n if (this_person.hasOwnProperty(pKey)) {\n myDefaultColumns[c].defaultValues[dKey] = this_person[pKey];\n }\n }\n }\n myDefaultColumns[c].columnActivated = false;\n myDefaultColumns[c].rowDetails.forEach((dRow, r) => {\n if (dRow.textValue) {\n if (dRow.textValue === '[person.location]') {\n myDefaultColumns[c].rowDetails[r].textValue = this_person.location;\n }\n else if (dRow.textValue === '[person.name]') {\n myDefaultColumns[c].rowDetails[r].textValue = `${this_person.first} ${this_person.last}`;\n }\n else if (dRow.textValue.startsWith('[person.')) {\n let pKey = dRow.textValue.split('.')[1];\n if (this_person.hasOwnProperty(pKey)) {\n myDefaultColumns[c].rowDetails[r].textValue = this_person[pKey];\n }\n }\n }\n });\n myDefaultColumns[c].person_id = this_id;\n myDefaultColumns[c].column_id = `${column.column_id}_${this_id}`;\n myDefaultColumns[c].display_name = this_name;\n // add three elements for the name at the end of the dName array (regardless of whether you have 2 or 3 words in your name)\n let nameElements = [' ', ' '].concat((`${this_person.name.first} ${this_person.name.last}`).trim().split(/[\\s-]+/));\n myDefaultColumns[c].dName.push(...(nameElements.slice(-3)));\n if (myDefaultColumns[c].dName.length > reactData.maxDName) {\n updateReactData({\n maxDName: myDefaultColumns[c].dName.length\n }, false);\n }\n if (!defaultValue.suppressDuplicateCheck) {\n let existingRequest = await checkExistingRequests({\n client_id: state.session.client_id,\n foreign_key: myDefaultColumns[c].foreign_key || myDefaultColumns[c].foreignKey,\n request_type: defaultValue.importTypes || myDefaultColumns[c].request_type || myDefaultColumns[c].requestType,\n requestor: this_id,\n requestor_name: `${this_person.name.first} ${this_person.name.last}`,\n defaultValue\n });\n if (existingRequest.status === 'use existing') {\n await applyExistingRequest(existingRequest, myDefaultColumns[c], c);\n }\n }\n };\n reactData.columnList.push(...myDefaultColumns);\n if (reactData.columnList.length > 1) {\n columnCommonName();\n }\n };\n\n function OKtoShow(this_item) {\n let response = true;\n if (this_item.rowTest.length > 0) {\n response = this_item.rowTest.every(thisTest => {\n let test;\n let display = true;\n if (isObject(thisTest)) {\n test = thisTest.test;\n display = (thisTest.type === 'display');\n }\n else {\n test = thisTest;\n display = true;\n };\n let [checkField, checkValue, qualSelected] = test.split('%%');\n let checkRow = reactData.columnList[selectedColumn].rowDetails.find(row => {\n return (row.text === checkField);\n });\n let innerResponse;\n if (checkRow) {\n if (checkRow.checkbox || checkRow.isChecked) { // checkbox \n if (!checkValue) {\n innerResponse = checkRow.isChecked;\n }\n else if (!checkRow.isChecked || !qualSelected || !checkRow.qualSelections) {\n innerResponse = false;\n }\n else {\n innerResponse = (checkRow.qualSelections.hasOwnProperty(checkValue) && checkRow.qualSelections[checkValue][qualSelected]);\n }\n }\n else if (!checkValue) { // not a checkbox... if we don't care if there is a vlue type in or not? \n innerResponse = !!checkRow.textValue;\n }\n else { // if we do care...\n innerResponse = checkRow.textValue.toLowerCase().includes(checkValue.toLowerCase());\n }\n }\n else if (reactData.columnList[selectedColumn].defaultValues.hasOwnProperty(checkField)) {\n // no row matched this test field; perhaps a default value does?\n innerResponse = (reactData.columnList[selectedColumn].defaultValues[checkField] === checkValue);\n }\n if (display) {\n return innerResponse;\n }\n else {\n return !innerResponse;\n }\n /* return reactData.columnList[selectedColumn].rowDetails.every(checkRow => {\n if (checkRow.text !== checkField) { // this test doesn't apply\n return true;\n }\n else {\n let innerResponse;\n if (checkRow.checkbox || checkRow.isChecked) { // checkbox \n if (!checkValue) {\n innerResponse = checkRow.isChecked;\n }\n else if (!checkRow.isChecked || !qualSelected || !checkRow.qualSelections) {\n innerResponse = false;\n }\n else {\n innerResponse = (checkRow.qualSelections.hasOwnProperty(checkValue) && checkRow.qualSelections[checkValue][qualSelected]);\n }\n }\n else if (!checkValue) { // not a checkbox... if we don't care if there is a vlue type in or not? \n innerResponse = !!checkRow.textValue;\n }\n else { // if we do care...\n innerResponse = checkRow.textValue.toLowerCase().includes(checkValue.toLowerCase());\n }\n if (display) {\n return innerResponse;\n }\n else {\n return !innerResponse;\n }\n }\n }); */\n });\n }\n return response;\n }\n\n async function applyExistingRequest(existingRequest, this_column, this_column_index) {\n this_column.request_to_update = existingRequest.requestToUse;\n this_column.columnActivated = true;\n if (!existingRequest.requestToUse.hasOwnProperty('current_request')) {\n existingRequest.requestToUse.current_request = deepCopy(existingRequest.requestToUse.original_request);\n }\n for (let sX = 0; sX < existingRequest.requestToUse.current_request.selections.length; sX++) {\n let s = existingRequest.requestToUse.current_request.selections[sX];\n let selection = s.split('(').shift().trim();\n let rowNumber = this_column.rowDetails.findIndex(r => {\n return (r.text === selection);\n });\n if (rowNumber > -1) {\n this_column.rowDetails[rowNumber].isChecked = true;\n if (this_column.rowDetails[rowNumber].observationKey && !this_column.rowDetails[rowNumber].qualData) {\n let qualResponse = await buildQualifiers(this_column.rowDetails[rowNumber].observationKey);\n if (Object.keys(qualResponse.selections).length > 0) {\n this_column.rowDetails[rowNumber].qualSelections = deepCopy(qualResponse.selections);\n }\n if (Object.keys(qualResponse.data).length > 0) {\n this_column.rowDetails[rowNumber].qualData = deepCopy(qualResponse.data);\n }\n if (Object.keys(qualResponse.moreInfo).length > 0) {\n this_column.rowDetails[rowNumber].moreInfo = deepCopy(qualResponse.moreInfo);\n }\n }\n if ((existingRequest.requestToUse.current_request.hasOwnProperty('options'))\n && (existingRequest.requestToUse.current_request.options.hasOwnProperty(selection))) {\n if (!this_column.rowDetails[rowNumber].qualData) {\n // [this_column.rowDetails[rowNumber].defaultSelections, this_column.rowDetails[rowNumber].qualData] = await buildQualifiers(this_column.rowDetails[rowNumber].observationKey);\n let qualResponse = await buildQualifiers(this_column.rowDetails[rowNumber].observationKey);\n this_column.rowDetails[rowNumber].defaultSelections = deepCopy(qualResponse.selections);\n this_column.rowDetails[rowNumber].qualData = deepCopy(qualResponse.data);\n this_column.rowDetails[rowNumber].moreInfo = deepCopy(qualResponse.moreInfo);\n }\n this_column.rowDetails[rowNumber].qualSelections = deepCopy(existingRequest.requestToUse.current_request.options[selection]);\n }\n if ((existingRequest.requestToUse?.current_request.hasOwnProperty('textInput'))\n && (existingRequest.requestToUse?.current_request?.options?.hasOwnProperty(selection))) {\n this_column.rowDetails[rowNumber].textValue = deepCopy(existingRequest.requestToUse.current_request.textInput[selection]);\n }\n if ((this_column.rowDetails[rowNumber].input === 'signature')\n && (existingRequest.requestToUse.current_request.hasOwnProperty('images') || existingRequest.requestToUse?.current_request.hasOwnProperty('image_location'))) {\n if (existingRequest.requestToUse.current_request.image_location?.[this_column.rowDetails[rowNumber].text]) {\n\n updateReactData({\n storedSignature: existingRequest.requestToUse?.current_request.image_location[this_column.rowDetails[rowNumber].text]\n }, false);\n }\n else {\n updateReactData({\n storedSignature: existingRequest.requestToUse?.current_request.images[this_column.rowDetails[rowNumber].text]\n }, false);\n }\n }\n }\n };\n if (existingRequest.requestToUse.current_request.hasOwnProperty('textInput')) {\n for (let selection in existingRequest.requestToUse.current_request.textInput) {\n let rowNumber = this_column.rowDetails.findIndex(r => {\n return (r.text === selection);\n });\n if (rowNumber < 0) {\n continue;\n };\n this_column.rowDetails[rowNumber].textValue = deepCopy(existingRequest.requestToUse.current_request.textInput[selection]);\n }\n }\n if (existingRequest.requestToUse.current_request.hasOwnProperty('qualifiers')) {\n /*\n current_request.qualifiers come in as qualifiers.[][][]\n example \n [Coffee][How do you like your coffee?][cream, sugar]\n \n and are stored in qualSelections as [][][][pSelection]\n example \n [Coffee][rsteele][How do you like your coffee?][cream] = true\n [Coffee][rsteele][How do you like your coffee?][sugar] = true\n */\n for (let selection in existingRequest.requestToUse.current_request.qualifiers) {\n let rowNumber = this_column.rowDetails.findIndex(r => {\n return (r.qualData && r.qualData.qualSelections && r.qualData.qualSelections.hasOwnProperty(selection));\n });\n if (rowNumber < 0) {\n continue;\n };\n for (let option in existingRequest.requestToUse.current_request.qualifiers[selection]) {\n if (!this_column.rowDetails.qualData.qualSelections[selection].hasOwnProperty(option)) {\n this_column.rowDetails.qualData.qualSelections[selection][option] = {};\n }\n if (Array.isArray(existingRequest.requestToUse.current_request.qualifiers[selection][option])) {\n existingRequest.requestToUse.current_request.qualifiers[selection][option].forEach(choice => {\n this_column.rowDetails.qualData.qualSelections[selection][option][choice] = true;\n });\n }\n }\n }\n }\n };\n\n async function checkExistingRequests(request_key) {\n // Does this person already have a request for this requestype and foreignkey?\n if (!request_key.foreign_key || (request_key.foreign_key === 'noFKey')) {\n return {\n 'status': 'make new'\n };\n }\n let existingRequest = await getServiceRequests(request_key);\n if (existingRequest.length > 0) {\n if (request_key.defaultValue.useExisting) {\n return {\n 'status': 'use existing',\n 'requestToUse': existingRequest[0]\n };\n }\n else {\n let requestAction = await orderWarning(request_key);\n let rTime = makeDate(new Date().getTime());\n switch (requestAction) {\n case 'use': {\n let lastRec = records2Update.push(existingRequest[0]) - 1;\n records2Update[lastRec].history.unshift(`Imported by ${state.session.user_id} on ${rTime.oaDate}`);\n records2Update[lastRec].last_update = rTime.timestamp;\n setRecords2Update(records2Update);\n return {\n 'status': 'use existing',\n 'requestToUse': existingRequest[0]\n };\n }\n case 'delete': {\n let lastRec = records2Update.push(existingRequest[0]) - 1;\n records2Update[lastRec].history.unshift(`Replaced on ${rTime.oaDate}`);\n records2Update[lastRec].last_update = rTime.timestamp;\n setRecords2Update(records2Update);\n break;\n }\n default: { }\n }\n }\n }\n return {\n 'status': 'make new'\n };\n\n async function orderWarning(pKey) {\n const showWarning = new Promise((resolve, reject) => {\n let response = '';\n const snackAction = (\n \n \n \n \n \n );\n let phrase = `${state.session.service_request_types[pKey.request_type]?.description || 'This'} already exists for ${pKey.requestor_name}`;\n if (pKey.foreign_key) {\n let fKdate = makeDate(pKey.foreign_key);\n if (!fKdate.error) {\n phrase += ` dated for ${fKdate.relative}`;\n }\n }\n enqueueSnackbar(\n `${phrase}. What would you like to do?`,\n { variant: 'warning', persist: true, action: snackAction }\n );\n });\n let rValue = await showWarning;\n closeSnackbar();\n return rValue;\n }\n };\n\n async function sendRequests(pData) {\n let everyoneText = {};\n if (pData.textValue && pData.textValue.hasOwnProperty('*all*')) {\n Object.keys(pData.textValue['*all*']).forEach(prompt => {\n everyoneText[prompt] = pData.textValue['*all*'][prompt];\n });\n }\n let writtenRecords = [];\n let local_key = null;\n let message_body;\n\n for (let columnNumber = 0; columnNumber < pData.length; columnNumber++) {\n let currentTime = makeDate(new Date());\n let selections = [];\n let options = {};\n let textInput = {};\n let images = {};\n let image_location = {};\n let oBo;\n let this_column = pData[columnNumber];\n if (this_column.columnActivated) {\n if (this_column.person_id) {\n oBo = await makeName(this_column.person_id);\n }\n else {\n oBo = await makeName(reactData.defaultPerson ? reactData.defaultPerson.person_id : state.patient.person_id);\n }\n for (let rowNumber = 0; rowNumber < this_column.rowDetails.length; rowNumber++) {\n let this_row = this_column.rowDetails[rowNumber];\n if (this_row.isChecked) {\n let choices_list = [];\n if (this_row.input === 'signature') {\n let s3Response = await s3\n .upload({\n Bucket: 'theseus-medical-storage',\n Key: `${this_column.person_id || reactData.defaultPerson.person_id || state.patient.person_id}_signature`,\n Body: this_row.image,\n ACL: 'public-read-write',\n ContentType: 'image/png'\n })\n .promise()\n .catch(err => {\n enqueueSnackbar(`Uh oh! AVA couldn't save your file. The reason is ${err.message}`, { variant: 'error', persist: true });\n });\n image_location[this_row.text] = s3Response.Location;\n images[this_row.text] = this_row.image;\n }\n else {\n for (let this_option in this_row.qualSelections) {\n for (let this_choice in this_row.qualSelections[this_option]) {\n if (!options.hasOwnProperty(this_row.text)) {\n options[this_row.text] = {};\n }\n if (!options[this_row.text].hasOwnProperty(this_option)) {\n options[this_row.text][this_option] = {};\n }\n options[this_row.text][this_option][this_choice] = this_row.qualSelections[this_option][this_choice];\n if (typeof (this_row.qualSelections[this_option][this_choice]) === 'boolean') {\n if (this_row.qualSelections[this_option][this_choice]) {\n choices_list.push(this_choice);\n }\n }\n else {\n choices_list.push(this_row.qualSelections[this_option][this_choice]);\n }\n }\n }\n }\n let pushText = this_row.text;\n if (choices_list.length > 0) {\n pushText += ` (${choices_list.join('; ')})`;\n }\n selections.push(pushText);\n }\n if (this_row.textValue) {\n // special Values/\n if ((this_column.defaultValues.hasOwnProperty('onBehalfOf') && (this_column.defaultValues['onBehalfOf'] === this_row.text))\n || (this_row.input === 'obo')) {\n oBo = this_row.textValue;\n }\n else {\n textInput[this_row.text] = this_row.textValue;\n }\n }\n }\n if ((selections.length > 0) || (Object.keys(textInput).length > 0)) {\n // We are ready to save this service request\n let svc_messaging = null;\n if (!fact.new_messaging && fact.messaging) {\n if ((Array.isArray(fact.messaging) && (fact.messaging.every(m => { return (m.format && (m.format.type !== 'mealTicket')); })))\n || (!Array.isArray(fact.messaging) && (fact.messaging.format && (fact.messaging.format.type !== 'mealTicket')))) {\n svc_messaging = fact.messaging;\n local_key = null;\n }\n }\n let putSR = {};\n if (this_column.request_to_update) {\n putSR = deepCopy(this_column.request_to_update);\n }\n Object.assign(putSR, {\n client: state.session.client_id,\n author: this_column.person_id || state.session.patient_id,\n proxy_user: state.session.user_id,\n requestType: this_column.requestType,\n activity_key: this_column.activity_key,\n request: {},\n onBehalfOf: oBo,\n messaging: svc_messaging\n });\n if (local_key) {\n putSR.local_key = local_key;\n }\n if (this_column.request_to_update) {\n if (putSR.history.length === 0) {\n putSR.history = [];\n };\n putSR.history.unshift(`Request updated ${currentTime.oaDate}`);\n // putSR.original_request = {\n putSR.current_request = {\n selections,\n options,\n textInput,\n image_location,\n images\n };\n await updateServiceRequest(putSR);\n writtenRecords.push(putSR);\n }\n else {\n putSR.history = [`Request submitted ${currentTime.oaDate}`];\n putSR.request = {\n selections,\n options,\n textInput,\n image_location,\n images\n };\n putSR.foreign_key = await resolveMessageVariables(this_column.foreignKey, textInput);\n if (fact?.value?.freeText?.assign_to) {\n // if there is an assign_to value, we'll assigne this SR to that ID\n putSR.assign_to = fact?.value?.freeText?.assign_to;\n let this_name = await getPerson(fact?.value?.freeText?.assign_to, 'name');\n putSR.history.unshift(`Auto-Assigned to ${this_name}`);\n if (validRequestStatus(this_column.requestType, 'assigned', state.session)) {\n putSR.requestStatus = 'assigned';\n }\n }\n else {\n putSR.assign_to = 'unassigned';\n }\n if (reactData.attachmentList && (reactData.attachmentList.length > 0)) {\n putSR.attachments = reactData.attachmentList;\n if (defaultValue.requestType === 'file') {\n }\n }\n let result = await putServiceRequest(putSR);\n local_key = result.requestRec.local_key;\n message_body = result.body;\n writtenRecords.push(result.requestRec);\n }\n }\n }\n };\n // meal tickets print here combining all completed requests...\n let formatCallObj = {\n local_key,\n client_id: pClient,\n client_name: state.session.client_name\n };\n if (fact.messaging && (fact.messaging?.format?.method !== 'hold')) {\n let factMessagingList = [];\n if (Array.isArray(fact.messaging)) {\n factMessagingList.push(...fact.messaging);\n }\n else {\n factMessagingList.push(fact.messaging);\n }\n for (let m = 0; m < factMessagingList.length; m++) {\n if (!factMessagingList[m].format.hasOwnProperty('logo') || factMessagingList[m].format.logo) {\n formatCallObj.logo = state.session.client_logo;\n formatCallObj.logo_dimensions = state.session.logo_dimensions;\n }\n if (!factMessagingList[m].format.hasOwnProperty('initials') || factMessagingList[m].format.initials) {\n formatCallObj.initials = true;\n }\n let html, plain, attachment;\n switch (factMessagingList[m].format.type) {\n case 'mealTicket':\n {\n [html, plain, attachment] = await mealTicketFormat(formatCallObj);\n break;\n }\n default: { }\n }\n if (html) { // if there is a message to send, send it and update all the Service Request records to show that it was sent\n // prepare message that contains the tickets (one for the whole group)\n message_body.messaging = deepCopy(factMessagingList[m]);\n message_body.messaging.format = { 'type': 'inBody', 'subject': 'Meal Ticket' };\n message_body.htmlText = html;\n message_body.messageText = plain;\n let preparedMessages = await prepareMessage(message_body);\n // send the message\n if (preparedMessages.length > 0) {\n preparedMessages.forEach((m, x) => {\n preparedMessages[x].thread_id = `svc_${message_body.requestType}/${local_key}`;\n if (attachment) {\n preparedMessages[x].attachments = [attachment.Location];\n if (message_body.messaging.hasOwnProperty('attachment_method')\n && (message_body.messaging.attachment_method === 'file')) {\n if (attachment.data) {\n preparedMessages[x].attachment_data = {\n filename: `MealTicket-${local_key}.pdf`,\n content: attachment.data,\n type: 'application/pdf',\n disposition: 'attachment',\n content_id: local_key\n };\n }\n }\n }\n });\n let rTime = makeDate(new Date().getTime());\n let rMsg;\n let last_status;\n if (message_body.messaging?.format?.method === 'hold') {\n last_status = 'Prepared & Held';\n rMsg = `Held for future processing ${rTime.oaDate}`;\n }\n else {\n let sendResults = (await sendMessages(preparedMessages)).pop();\n if (!sendResults.sent) {\n last_status = 'Failed to send';\n rMsg = `Failed to send ${rTime.oaDate}`;\n }\n else {\n if (validRequestStatus(message_body.requestType, 'sent', state.session)) {\n last_status = 'Sent';\n }\n rMsg = `Sent for processing ${rTime.oaDate}`;\n }\n }\n writtenRecords.forEach(w => {\n w.messages = preparedMessages;\n w.last_update = rTime.timestamp;\n w.last_status = last_status;\n if (('history' in w) && Array.isArray(w.history)) {\n w.history.unshift(rMsg);\n }\n else { w.history = [rMsg]; }\n });\n await updateServiceRequest(writtenRecords);\n }\n } // end of \"is there a message to send?\"\n // if (records2Update.length > 0) { await updateServiceRequest(records2Update); }\n }\n }\n }\n\n function makeConfirm(pData) { // assumes you've passed in a columnList\n let warningsExist = false;\n let dataExists = false;\n let confirmStatus = 'confirm';\n let warningSection = [];\n let responseArray = [`[bold][italic]AVA will send the following:`];\n pData.forEach((this_column, column_number) => {\n /*\n pData[\n {\n rowDetails[{\n text: (the actual selection text, such as \"Chopped Steak\" or \"Pancake Platter\")\n isChecked: ,\n qualSelections: {\n option: {\n choice: or \n }\n },\n textValue: \n }, ...\n ],\n xxxxxx: ...\n },\n {},...\n ]\n */\n let selectionText = [];\n let columnName = columnUniqueName(this_column).string;\n if (!this_column.columnActivated) {\n warningSection.push(`[color:red][bold]Nothing was entered${columnName ? (' for ' + columnName) : ''}.`);\n warningsExist = true;\n }\n else {\n /* Check for errors */\n this_column.rowDetails.forEach((this_row, row_number) => {\n if (this_row.input === 'signature') {\n if (signatureRef.current.isEmpty() && this_row.required) {\n this_row.textValue = false;\n }\n else {\n // reactData.columnList[column_number].rowDetails[row_number].image = signatureRef.current.toDataURL('image/png');\n reactData.columnList[column_number].rowDetails[row_number].image = signatureRef.current.getTrimmedCanvas().toDataURL('image/png');\n if (this_row.textValue !== 'Signature on File') {\n this_row.textValue = 'Signature captured';\n }\n updateReactData({\n columnList: reactData.columnList\n }, false);\n }\n }\n reactData.columnList[column_number].rowDetails[row_number].error = false;\n if (this_row.isChecked && this_row.qualData) {\n this_row.qualData.forEach(this_qual => {\n if (this_qual.min_required > 0) {\n let qualCount = 0;\n if (this_row.qualSelections && this_row.qualSelections.hasOwnProperty(this_qual.title)) {\n qualCount = (Object.values(this_row.qualSelections[this_qual.title]).filter(this_value => {\n return this_value;\n })).length;\n }\n if (qualCount < this_qual.min_required) {\n confirmStatus = 'error';\n warningsExist = true;\n let warningMessage;\n if (this_qual.max_allowed === this_qual.min_required) {\n warningMessage = `You must select ${this_qual.min_required} from ${this_row.text} (${this_qual.title})`;\n }\n else {\n warningMessage = `You must select at least ${this_qual.min_required} from ${this_row.text} (${this_qual.title})`;\n }\n warningSection.push(`[color:red][bold]${warningMessage}`);\n reactData.columnList[column_number].rowDetails[row_number].error = warningMessage;\n }\n }\n });\n updateReactData({\n columnList: reactData.columnList\n }, false);\n }\n else if ((this_row.required && !this_row.textValue && !this_row.isChecked)\n || ((this_row.input === 'signature') && (signatureRef.current.isEmpty() && this_row.required))) {\n confirmStatus = 'error';\n let warningMessage;\n if (pData.length > 1) {\n warningMessage = `${columnName} is missing \"${this_row.text}\"`;\n }\n else {\n warningMessage = `\"${this_row.text}\" is required`;\n }\n warningsExist = true;\n warningSection.push(`[color:red][bold]${warningMessage}`);\n reactData.columnList[column_number].rowDetails[row_number].error = 'This field is required';\n updateReactData({\n columnList: reactData.columnList\n }, false);\n }\n else if (this_row.error) {\n confirmStatus = 'error';\n if (pData.length > 1) {\n warningSection.push(`[color:red][bold]${columnName} has an error on \"${this_row.text}\". The error is: ${this_row.error}.`);\n }\n else {\n warningSection.push(`[color:red][bold]Error on \"${this_row.text}\". The error is: ${this_row.error}.`);\n }\n warningsExist = true;\n }\n });\n let options = {};\n if (reactData.collectPayment) {\n options.includeFees = true;\n }\n for (const [this_selection, optionList] of Object.entries(formatServiceRequestDetails(this_column, options))) {\n selectionText.push(`[style={size:1}]${sentenceCase(this_selection)}`);\n optionList.forEach(option => {\n selectionText.push(`[indent=1][italic][style={size:0.4}]${option}`);\n });\n };\n // that's all the rows for this column\n if (selectionText.length === 0) {\n if (pData.length > 1) {\n warningSection.push(`[color:red][bold]${columnName} has no entries at all`);\n }\n else {\n warningSection.push(`[color:red][bold]No entries were made`);\n }\n warningsExist = true;\n }\n else {\n if (confirmStatus !== 'error') {\n if (columnName) {\n responseArray.push(`[bold]${columnName}`);\n };\n responseArray.push(...selectionText);\n responseArray.push('[style = { bottom: 3 }] ');\n dataExists = true;\n }\n }\n }\n });\n let returnArray = [reactData.factName];\n if (reactData.commonText) {\n returnArray = [titleCase(reactData.commonText)];\n }\n if (warningsExist) {\n returnArray.push(...warningSection);\n }\n if (dataExists) {\n if (warningsExist) {\n returnArray.push(' ');\n }\n returnArray.push(...responseArray);\n }\n return [confirmStatus, returnArray];\n };\n\n return (\n \n { /* MAIN */}\n\n {(reactData.columnList && reactData.columnList.length > 0)\n &&\n \n {/* Header with Avatar, Message, and VertMenu */}\n \n \n \n {`${titleCase(reactData.commonText) || factName}`}\n \n {reactData.titleName.display &&\n \n {`for ${reactData.titleName.display}`}\n \n }\n \n {\n handleClick(event);\n setPopupMenuOpen(true);\n }}>\n \n \n { setPopupMenuOpen(false); }}\n keepMounted>\n \n {\n onClose();\n }}>\n \n \n \n {'Go to AVA Menu'}\n \n \n \n {\n let jumpTo = window.location.origin;\n window.location.replace(jumpTo);\n }}>\n \n \n \n {'Restart AVA'}\n \n \n \n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n {`User ${fact.session.user_id}${fact.patient_id !== fact.session.user_id ? (' (' + fact.patient_id + ')') : ''}`}\n {`Function: ObservationForm`}\n {`Activity: ${fact.activity_key}`}\n \n \n \n \n \n\n { /* Selection Row */}\n {(reactData.columnList.length > 1) &&\n 5) ? ((reactData.titleName.remembered.length > 1) ? '150px' : '100px') : 1}\n overflow={(reactData.columnList.length > 5) ? 'scroll' : null}\n key={'peopleSelectionBox'}\n id={'peopleSelectionBox'}\n className={classes.listItemSticky}\n >\n \n \n \n {(reactData.titleName.remembered.length === 1) &&\n \n }\n {'Select'}\n \n {reactData.columnList.map((this_column, this_columnNumber) => (\n \n {(reactData.titleName.remembered.length > 1) &&\n \n }\n {columnUniqueName(this_column).array.slice(-1 * Math.min(reactData.maxDName, 7)).map((n, nx) => (\n {n.slice(0, 10)}\n ))}\n {\n setSelectedColumn(this_columnNumber);\n setForceRedisplay(!forceRedisplay);\n }}\n disableRipple\n className={classes.radioButton}\n size='small'\n />\n \n ))}\n \n \n \n }\n\n { /* Data rows */}\n \n {(reactData.columnList.length > 0) &&\n (reactData.columnList[selectedColumn].rowDetails).map((this_item, this_index) => (\n \n {OKtoShow(this_item) &&\n \n \n {\n if (this_item.checkbox) {\n await itemSelected(selectedColumn, this_index);\n }\n }}\n alignItems='center'\n >\n {this_item.checkbox &&\n \n }\n { /* Descriptive text for this row - every row has some */}\n {!this_item.input &&\n \n \n {this_item.bold\n ? (this_item.italic ? {this_item.text} : {this_item.text})\n : (this_item.italic ? {this_item.text} : `${this_item.text}`)}\n \n \n }\n { /* Text prompt line for this row - headers don't have this */}\n {this_item.input && (this_item.input !== 'signature') && (this_item.input !== 'docLines') &&\n {\n if (!event.target.value) {\n reactData.errorOnScreen = false;\n }\n handleChangeTextField(event.target.value, selectedColumn, this_index);\n }}\n FormHelperTextProps={{ style: { fontSize: `${user_fontSize * 0.75}rem`, lineHeight: `${user_fontSize * 0.9}rem` } }}\n onKeyPress={(event) => {\n onCheckEnter(event, selectedColumn, this_index);\n }}\n onBlur={(event) => {\n onCheckEnter(event, selectedColumn, this_index);\n }}\n autoComplete='off'\n value={this_item.textValue || ''}\n />\n }\n {this_item.input && (this_item.input === 'docLines') &&\n \n }\n {this_item.input && (this_item.input === 'signature') &&\n \n \n \n {this_item.text}\n \n \n {signatureRef.current && !signatureRef.current.isEmpty() &&\n {\n signatureRef.current.clear();\n setForceRedisplay(!forceRedisplay);\n }}\n >\n {'Clear'}\n \n }\n {reactData.storedSignature &&\n {\n signatureRef.current.clear();\n var params = {\n Bucket: 'theseus-medical-storage',\n Key: reactData.storedSignature.split('/').pop()\n };\n let data = await s3\n .getObject(params)\n .promise()\n .catch(err => {\n console.log(`error at getS3Object is`, err);\n });\n if (data) {\n let s64 = data.Body.toString(\"base64\");\n console.log(s64);\n let b64 = 'data:image/png;base64,' + data.Body.toString(\"base64\");\n signatureRef.current.fromDataURL(b64);\n }\n handleChangeTextField('Signature on File', selectedColumn, this_index);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n {'Use Existing'}\n \n }\n \n \n }\n \n {this_item.isChecked && this_item.desc &&\n \n {this_item.desc}\n \n }\n {this_item.isChecked\n && !isEmpty(this_item.moreInfo) &&\n \n \n \n {Object.keys(this_item.moreInfo).map((opt, oX) => (\n \n {(opt !== 'image') && (opt !== 'restriction') &&\n \n \n {`${sentenceCase(opt.replace('_', ' '))}${this_item.moreInfo[opt].trim() ? (': ' + this_item.moreInfo[opt]) : ''}`}\n \n \n }\n {(opt === 'restriction')\n && (\n state\n .accessList[state.session.client_id]\n .list\n .find(p => { return (p.person_id === reactData.columnList[selectedColumn].person_id); })\n .groups\n .includes(this_item.moreInfo[opt].trim())\n )\n &&\n \n \n {`*** THIS ITEM IS NOT RECOMMENDED FOR ${reactData.columnList[selectedColumn].display_name.toUpperCase()} ***`}\n \n \n }\n \n ))}\n \n \n \n }\n {this_item.isChecked\n && (!isEmpty(this_item.qualData))\n && makeArray(this_item.qualData).map((qR, qRndx) => (\n \n \n \n {qR.title}\n \n \n {qR.option && qR.option.map((opt, oX) => (\n \n {(!opt.type || (opt.type === 'checkbox')) &&\n \n {\n optSelected(reactData.columnList[selectedColumn].rowDetails[this_index], qR.title, opt.display);\n if (reactData.columnList[selectedColumn].rowDetails[this_index].obo_line) {\n // which qualSelection is true?\n let allPossibilitiesObj = Object.values(reactData.columnList[selectedColumn].rowDetails[this_index].qualSelections)[0];\n let selectedOBOkey = Object.keys(allPossibilitiesObj).find((k) => {\n return allPossibilitiesObj[k];\n });\n let allQualsList = reactData.columnList[selectedColumn].rowDetails[this_index].qualData[0].option;\n let qualPicked = allQualsList.findIndex((i) => {\n return (i.display === selectedOBOkey);\n });\n reactData.columnList[selectedColumn].person_id = allQualsList[qualPicked].person_id;\n reactData.columnList[selectedColumn].display_name = allQualsList[qualPicked].dName;\n reactData.columnList[selectedColumn].dName.splice(-3, 3, ...([' ', ' ', ' '].concat(allQualsList[qualPicked].dName.split(/\\s+/).splice(-3))));\n resetTitleName();\n reactData.columnList[selectedColumn].rowDetails[this_index].textValue = titleCase(allQualsList[qualPicked].dName);\n reactData.columnList[selectedColumn].rowDetails.forEach((checkRow, r) => {\n if (checkRow.location_line) {\n reactData.columnList[selectedColumn].rowDetails[r].textValue = allQualsList[qualPicked].location || '';\n }\n });\n }\n reactData.columnList[selectedColumn].columnActivated = true;\n updateReactData({\n columnList: reactData.columnList\n }, true);\n }}\n checked={isQualChecked(reactData.columnList[selectedColumn].rowDetails[this_index], qR.title, opt.display)}\n />\n \n {opt.display}\n \n \n }\n {(opt.type === 'prompt' || opt.type === 'promptOnly') &&\n \n {(opt.type === 'prompt') &&\n \n }\n \n {opt.display}:\n \n {\n optSelected(reactData.columnList[selectedColumn].rowDetails[this_index], qR.title, opt.display, event.target.value);\n updateReactData({\n columnList: reactData.columnList\n }, true);\n }}\n autoComplete='off'\n />\n \n }\n \n ))}\n \n \n \n ))\n }\n \n {this_item.isChecked\n && this_item.moreInfo &&\n \n {\n Object.keys(this_item.moreInfo).map((opt, oX) => (\n (opt === 'image') &&\n \n ))\n }\n \n }\n \n }\n \n ))\n }\n { /* Show list of already uploaded attachments (if applicable) */}\n {(reactData.attachmentList.length > 0) &&\n \n Attachments:\n {reactData.attachmentList.map((a, x) => (\n \n {\n reactData.attachmentList.splice(x, 1);\n reactData.forceRedisplay = !reactData.forceRedisplay;\n if (loadingInProgress(x)) {\n reactData.loadProgress[x].loading = 'abort';\n }\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n }}\n />\n {loadingInProgress(x) &&\n \n \n \n }\n \n {a.Key}\n \n \n ))}\n \n }\n \n \n }\n\n { /* Prompt for People */}\n {((reactData.columnList && (reactData.columnList.length < 1)) || (morePeople))\n &&\n {\n if (reactData.columnList.length < 1) {\n onClose();\n }\n setMorePeople(false);\n }}\n onSelect={async (selectedID) => {\n let sIDs = makeArray(selectedID);\n reactData.columnList = [];\n if (sIDs.length > 0) {\n for (let p = 0; p < sIDs.length; p++) { // for each person you selected\n await addColumns(sIDs[p]);\n }\n updateReactData({\n columnList: reactData.columnList,\n titleName: reactData.titleName\n }, true);\n }\n setMorePeople(false);\n }}\n allowRandom={false}\n multiSelect={(defaultValue.selectOne ? !defaultValue.selectOne : true)}\n returnValue={'id'}\n />\n }\n\n { /* Prompts */}\n {cancelPending\n &&\n {\n setCancelPending(false);\n }}\n onConfirm={() => {\n onClose();\n }}\n >\n \n }\n {confirmDelete\n &&\n {\n setConfirmDelete(false);\n }}\n onConfirm={() => {\n reactData.columnList.splice(selectedColumn, 1);\n if (selectedColumn > 0) { setSelectedColumn(selectedColumn - 1); }\n setConfirmDelete(false);\n updateReactData({\n columnList: reactData.columnList\n }, true);\n }}\n >\n \n }\n {(confirmStatus === 'confirm')\n &&\n { setConfirmStatus(''); }}\n onConfirm={async () => {\n if (!reactData.lockSend) {\n updateReactData(\n { lockSend: true },\n false\n );\n if (reactData.collectPayment) {\n window.open(reactData.collectPayment.link || 'https://buy.stripe.com/3cs5lzbSS9RXecwcMN', reactData.collectPayment.description || 'Please pay');\n }\n await sendRequests(reactData.columnList);\n }\n onSave();\n }}\n />\n }\n {(confirmStatus === 'error')\n &&\n { setConfirmStatus(''); }}\n onConfirm={() => { }}\n >\n \n }\n\n { /* Command Area */}\n \n \n \n {\n ((factType === 'list') ? onClose() : setCancelPending(true));\n }}\n startIcon={}\n >\n {'Exit'}\n \n {reactData.allowAttachments &&\n \n }\n size='small'\n onClick={async () => {\n handleFileUpload();\n console.log('upload done');\n }}\n >\n {'Attach'}\n \n {\n await handleSaveFile(target.target.files[0]);\n setForceRedisplay(!forceRedisplay);\n }}\n />\n \n }\n {(!factType || (factType !== 'list')) &&\n {\n let [cStatus, response] = makeConfirm(reactData.columnList);\n setConfirmPrompt(response);\n setConfirmStatus(cStatus);\n }}\n startIcon={}\n >\n {'Confirm/Send'}\n \n }\n \n {(allowAddPeople || (allowRemovePeople && (reactData.columnList.length > 1))) &&\n \n {allowAddPeople &&\n {\n setMorePeople(true);\n }}\n startIcon={}\n >\n {'Add People'}\n \n }\n {allowRemovePeople && (reactData.columnList.length > 1) &&\n {\n setConfirmDelete(true);\n }}\n startIcon={}\n >\n {`Remove ${columnUniqueName(reactData.columnList[selectedColumn]).string}`}\n \n }\n \n }\n \n \n \n );\n\n};\n","import React from 'react';\n\nimport { useSnackbar } from 'notistack';\n\nimport useSession from '../../hooks/useSession';\n\nimport PersonFilter from './PersonFilter';\nimport AVAConfirm from './AVAConfirm';\n\nimport { makeName, getImage, getPerson } from '../../util/AVAPeople';\nimport { deepCopy, titleCase, sentenceCase, makeArray, s3, isObject, isEmpty } from '../../util/AVAUtilities';\nimport { getActivity } from '../../util/AVAObservations';\nimport { makeDate } from '../../util/AVADateTime';\nimport { buildDisplayRows, buildQualifiers } from '../../util/AVAActivityLoader';\nimport { putServiceRequest, getServiceRequests, updateServiceRequest, formatServiceRequestDetails, validRequestStatus } from '../../util/AVAServiceRequest';\nimport { mealTicketFormat, prepareMessage, sendMessages, resolveMessageVariables } from '../../util/AVAMessages';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport { AVAclasses, AVADefaults, AVATextStyle } from '../../util/AVAStyles';\n\nimport { Card, CardActions } from '@material-ui/core';\nimport { Button, IconButton, TextField } from '@material-ui/core';\nimport { Dialog } from '@material-ui/core';\nimport { Box, Paper, Typography, Checkbox, Radio, Avatar } from '@material-ui/core';\nimport { Menu, MenuList, MenuItem } from '@material-ui/core';\n\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport ExpandLessIcon from '@material-ui/icons/ExpandLess';\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport CheckIcon from '@material-ui/icons/Check';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport GroupAddIcon from '@material-ui/icons/GroupAdd';\nimport CloudUploadIcon from '@material-ui/icons/CloudUpload';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport HomeIcon from '@material-ui/icons/Home';\nimport AutorenewIcon from '@material-ui/icons/Autorenew';\n\nconst useStyles = makeStyles(theme => ({\n smallTextLine: {\n fontSize: theme.typography.fontSize * 1.0,\n flexGrow: 0,\n lineHeight: 1.25,\n whiteSpace: 'break-spaces'\n },\n messageArea: {\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n popUpFooter: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 1,\n },\n freeInput: {\n marginLeft: theme.spacing(1),\n paddingLeft: 0,\n paddingRight: 0,\n flexGrow: 2,\n width: '95%',\n },\n confirm: {\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n rootNoPadding: {\n paddingBottom: 0,\n paddingTop: 0,\n },\n inputRow: {\n marginTop: theme.spacing(1.5),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n },\n listItem: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n backGroundRed: {\n backgroundColor: 'red'\n },\n backGroundGreen: {\n backgroundColor: 'green'\n },\n backGroundNone: {\n },\n hiddenItem: {\n display: 'none',\n visibility: 'hidden'\n },\n listTopRow: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n listItemSticky: { // keep\n position: 'sticky',\n top: 0,\n opacity: 1,\n zIndex: 1,\n width: '100%',\n },\n page: {\n // height: 950,\n },\n buttonArea: {\n maxWidth: 1000,\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n }\n}));\n\nexport default ({ fact, factName, defaultValue, prompt, pClient, qualifiers, listValues, onSave, onClose }) => {\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n const { state } = useSession();\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const [cancelPending, setCancelPending] = React.useState(false);\n const [confirmStatus, setConfirmStatus] = React.useState('');\n const [confirmPrompt, setConfirmPrompt] = React.useState(false);\n const [confirmDelete, setConfirmDelete] = React.useState(false);\n const [morePeople, setMorePeople] = React.useState(false);\n\n const [reactData, setReactData] = React.useState({\n initialLoadComplete: false,\n defaultPerson: null,\n defaultQualSelections: {},\n defaultRequestType: null,\n titleName: {\n display: null,\n remembered: []\n },\n columnList: [],\n loadProgress: [],\n attachmentList: [],\n viewOnly: false,\n allowAttachments: false,\n errorOnScreen: false,\n factName: factName,\n expanded: []\n });\n\n const [records2Update, setRecords2Update] = React.useState([]);\n const [allowAddPeople, setAllowAddPeople] = React.useState(false);\n const [allowRemovePeople, setAllowRemovePeople] = React.useState(true);\n\n const [popupMenuOpen, setPopupMenuOpen] = React.useState(false);\n const [anchorEl, setAnchorEl] = React.useState(null);\n\n const [selectedColumn, setSelectedColumn] = React.useState(0);\n\n const factType = fact.activity_key.split('.')[0];\n\n const handleClick = async (event) => {\n setAnchorEl(event.currentTarget);\n };\n\n /* value | meaning | example */\n /* --------- | ---------- | ------------- */\n\n /* headers...\n /* ~~ | section header | ~~Entree Choices */\n\n /* check boxes...\n /* | selection/check box | Filet Mignon */\n\n /* instructions...\n /* ~[checkbox=off] | Stop rendering check boxes, render value only\n /* ~[checkbox=on] | Begin rendering check boxes AND values\n /* ~[display=off] | Do not display anything until display=on is encountered\n /* ~[display=on] | Begin showing lines again\n /* ~[required=on] | Text fields between these tags must not be left blank\n /* ~[required=off] | Stop requiring entry in text fields\n /* ~[displayIF=test] | only show this row if the test is true, will keep test on until endif encountered\n /* ~[endif] | stop testing rows\n\n \n /* prompt for response...\n /* ~other: | prompt for text response with | ~other:What is your name? */\n /* ~time: | prompt for time response with | ~time:What time would you like your meal? */\n /* ~date: | prompt for date response with | ~date:What date would you like your meal? */\n\n /* special cases...\n /* ~+~ | use value only when is selected | ~+Filet Mignon~~!How would you like your filet cooked? */\n\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n async function extractRequestType(aKey) {\n let activityParts = aKey.split('//');\n let activityCode = activityParts.pop();\n let activityClient = ((activityParts.length > 0) ? activityParts[0] : state.session.client_id);\n let activityRec = await getActivity(activityClient, activityCode);\n return activityRec.request_type || activityRec.name;\n }\n\n async function initialLoad() {\n let defaultObj = buildDefaults(defaultValue);\n let paymentInfo = defaultObj.collectPayment\n || defaultValue.collectPayment\n || (defaultValue.global_defaults && defaultValue.global_defaults.collectPayment);\n if (paymentInfo) {\n if (typeof (paymentInfo) === 'string') {\n paymentInfo = {\n allow: true\n };\n }\n updateReactData({\n collectPayment: paymentInfo,\n }, false);\n }\n let defaultColumnList = [];\n let localData_maxDName = 0;\n // eslint-disable-next-line\n { // build defaultColumns object from passed in activities for this request\n if (!defaultValue || !defaultValue.hasOwnProperty('activities')) {\n if (!fact.activity_code && fact.activity_key) {\n fact.activity_code = fact.activity_key;\n }\n let this_requestType = defaultValue.requestType || defaultValue.request_type || await extractRequestType(fact.activity_code) || 'noRType';\n let this_requestName = state.session.service_request_types.hasOwnProperty(this_requestType) ? state.session.service_request_types[this_requestType].description : titleCase(this_requestType);\n let this_foreignKey = defaultValue.foreignKey || defaultValue.foreign_key || 'noFKey';\n let fDate = makeDate(this_foreignKey);\n let dName = ([' ', ' ', ' '].concat(this_requestName.split(' ').slice(-3)).concat(fDate.error ? [] : ((fDate.absolute).split(','))));\n localData_maxDName = Math.max((localData_maxDName || 0), dName.length);\n let rowDetails = await buildDisplayRows(listValues, defaultObj, qualifiers);\n for (let r = 0; r < rowDetails.length; r++) {\n rowDetails[r].version = 1;\n if (rowDetails[r].checkbox && rowDetails[r].observationKey && !rowDetails[r].qualData) {\n let qualResponse = await buildQualifiers(rowDetails[r].observationKey);\n if (Object.keys(qualResponse.selections).length > 0) {\n rowDetails[r].qualSelections = deepCopy(qualResponse.selections);\n }\n if (Object.keys(qualResponse.data).length > 0) {\n rowDetails[r].qualData = deepCopy(qualResponse.data);\n }\n if (Object.keys(qualResponse.moreInfo).length > 0) {\n rowDetails[r].moreInfo = deepCopy(qualResponse.moreInfo);\n }\n }\n }\n defaultColumnList.push({\n rowDetails: rowDetails,\n activity_key: fact.activity_code,\n foreignKey: this_foreignKey,\n requestType: this_requestType,\n requestName: this_requestName,\n defaultValues: defaultObj,\n column_id: `${this_requestType}_${this_foreignKey}`,\n dName: dName\n });\n }\n else {\n for (let a = 0; a < defaultValue.activities.length; a++) {\n // merge global defaults and column_defaults into a single object; column_defaults will override globals\n let defaultsToUse = deepCopy(Object.assign({}, defaultObj, defaultValue.activities[a].column_defaults || {}));\n // if this activity carries qualifiers with it, add those to the qualifiers object that was passed in\n if (defaultsToUse.hasOwnProperty('collectPayment')) {\n if (typeof (defaultsToUse.collectPayment) === 'string') {\n updateReactData({\n collectPayment: {\n allow: true\n }\n }, false);\n }\n else {\n updateReactData({\n collectPayment: defaultsToUse.collectPayment,\n }, false);\n }\n }\n if (defaultValue.activities[a].hasOwnProperty('qualifiers')) {\n Object.assign(qualifiers, defaultValue.activities[a].qualifiers);\n }\n let this_activityKey = defaultValue.activities[a].column_defaults.activity_code || defaultValue.activities[a].activityRec.activity_code || fact.activity_code;\n let this_requestType = defaultValue.activities[a].column_defaults.requestType || defaultValue.requestType || defaultValue.request_type || await extractRequestType(this_activityKey) || 'noRType';\n let this_requestName = state.session.service_request_types.hasOwnProperty(this_requestType) ? state.session.service_request_types[this_requestType].description : titleCase(this_requestType);\n let this_foreignKey = defaultValue.activities[a].column_defaults.foreignKey || defaultValue.foreignKey || defaultValue.foreign_key || 'noFKey';\n let fDate = makeDate(this_foreignKey);\n let dName = ([' ', ' ', ' '].concat(this_requestName.split(' ').slice(-3)).concat(fDate.error ? [] : ((fDate.absolute).split(/,\\s*/))));\n localData_maxDName = Math.max((localData_maxDName || 0), dName.length);\n let rowDetails = await buildDisplayRows(defaultValue.activities[a].activityRec.valid_values_list, defaultsToUse, qualifiers);\n for (let r = 0; r < rowDetails.length; r++) {\n rowDetails[r].version = 1;\n if (rowDetails[r].checkbox && rowDetails[r].observationKey && !rowDetails[r].qualData) {\n let qualResponse = await buildQualifiers(rowDetails[r].observationKey);\n if (Object.keys(qualResponse.selections).length > 0) {\n rowDetails[r].qualSelections = deepCopy(qualResponse.selections);\n }\n if (Object.keys(qualResponse.data).length > 0) {\n rowDetails[r].qualData = deepCopy(qualResponse.data);\n }\n if (Object.keys(qualResponse.moreInfo).length > 0) {\n rowDetails[r].moreInfo = deepCopy(qualResponse.moreInfo);\n }\n }\n }\n defaultColumnList.push({\n rowDetails: rowDetails,\n activity_key: this_activityKey,\n foreignKey: this_foreignKey,\n requestType: this_requestType,\n requestName: this_requestName,\n defaultValues: defaultsToUse,\n column_id: `${this_requestType}_${this_foreignKey}`,\n dName: dName\n\n });\n }\n }\n }\n\n updateReactData({\n defaultColumns: defaultColumnList,\n maxDName: localData_maxDName,\n columnList: []\n }, false);\n\n // columns are created for each person_id, foreignKey, requestType combination\n // The person is assigned in one of three ways: \n // 1. selected - a selectList will be passed in the defaultValue.selectList\n // 2. pre-assigned - a peopleList will be passed in the defaultValue.peopleList\n // 3. default - if neither of the above, use the current session.patient_id\n\n if (defaultValue.peopleList && defaultValue.peopleList.peopleList && (defaultValue.peopleList.peopleList.length > 0)) {\n for (let p = 0; p < defaultValue.peopleList.peopleList.length; p++) {\n await addColumns(defaultValue.peopleList.peopleList[p].person_id);\n }\n }\n else if (defaultValue.selectList) {\n updateReactData({\n selectionList: defaultValue.selectList.selectionList || defaultValue.selectList.shortList\n }, false);\n }\n else {\n await addColumns(state.session.patient_id);\n }\n\n updateReactData({\n initialLoadComplete: true,\n columnList: reactData.columnList,\n titleName: reactData.titleName\n }, true);\n\n function buildDefaults(defaultValue) {\n let returnObj = {};\n if (defaultValue) {\n for (let dKey in defaultValue) {\n switch (dKey) {\n case ('importTypes'): {\n break;\n }\n case ('allowAddPeople'): {\n setAllowAddPeople(defaultValue.allowAddPeople);\n break;\n }\n case ('allowAttachment'):\n case ('allowAttachments'): {\n updateReactData({ allowAttachments: true }, false);\n break;\n }\n case ('viewOnly'): {\n updateReactData({ viewOnly: true }, false);\n break;\n }\n case ('allowRemovePeople'): {\n setAllowRemovePeople(defaultValue.allowRemovePeople);\n break;\n }\n case ('selectList'): {\n if (defaultValue.selectList.addPeople) {\n setAllowAddPeople(defaultValue.selectList.addPeople);\n }\n break;\n }\n case ('peopleList'): {\n if (defaultValue.peopleList.addPeople) {\n setAllowAddPeople(defaultValue.peopleList.addPeople);\n }\n break;\n }\n case ('activities'): {\n break;\n }\n default: {\n if (typeof defaultValue[dKey] === 'string') {\n returnObj[dKey] = defaultValue[dKey];\n }\n }\n };\n }\n }\n return returnObj;\n }\n\n };\n\n React.useEffect(() => {\n async function initialize() {\n await initialLoad();\n }\n if (!reactData.initialLoadComplete) {\n initialize();\n }\n }, [defaultValue]); // eslint-disable-line react-hooks/exhaustive-deps\n\n function columnUniqueName(my_column) {\n let commonRows = ([' ', ' ', ' ', ' ', ' '].concat(reactData.columnList[0].dName)).slice(-10);\n reactData.columnList.forEach(this_column => {\n let testName = ([' ', ' ', ' ', ' ', ' '].concat(this_column.dName)).slice(-10);\n testName.forEach((dN, dX) => {\n if (dN !== commonRows[dX]) {\n commonRows[dX] = false;\n }\n });\n });\n let testName = ([' ', ' ', ' ', ' ', ' '].concat(my_column.dName)).slice(-10);\n let showName = testName.filter((n, x) => {\n return !commonRows[x];\n });\n let returnData = {\n string: showName.slice(-7).join(' ').trim(),\n array: showName\n };\n return returnData;\n }\n\n function columnCommonName() {\n let commonRows = ([' ', ' ', ' ', ' ', ' '].concat(reactData.columnList[0].dName)).slice(-1 * reactData.maxDName);\n reactData.columnList.forEach(this_column => {\n let testName = ([' ', ' ', ' ', ' ', ' '].concat(this_column.dName)).slice(-1 * reactData.maxDName);\n testName.forEach((dN, dX) => {\n if (dN !== commonRows[dX]) {\n commonRows[dX] = false;\n }\n });\n });\n let commonText = '';\n commonRows.forEach(c => {\n if (c && !reactData.columnList[0].display_name.includes(c)) { commonText += (c + ' '); };\n });\n updateReactData({\n commonText,\n commonRows\n }, false);\n return;\n }\n\n const hiddenFileInput = React.useRef(null);\n const handleFileUpload = event => {\n hiddenFileInput.current.click();\n };\n\n let upload;\n async function handleSaveFile(pTarget) {\n let pType = pTarget.type;\n upload = s3.upload({\n partSize: 10 * 1024 * 1024,\n queueSize: 4,\n Bucket: 'theseus-medical-storage',\n Key: pTarget.name,\n Body: pTarget,\n ACL: 'public-read-write',\n ContentType: pType\n });\n let reactData_index = reactData.attachmentList.push({\n Key: pTarget.name\n }) - 1;\n reactData.loadProgress[reactData_index] = {\n loading: true,\n fileName: '',\n total: 1,\n progress: 0\n };\n updateReactData({ loadProgress: reactData.loadProgress }, true);\n let s3Resp = await performUpload();\n reactData.attachmentList[reactData_index] = s3Resp;\n if (!reactData.textInput) { reactData.textInput = { 's3file': s3Resp.Location }; }\n else { reactData.textInput.s3file = s3Resp.Location; }\n reactData.loadProgress[reactData_index] = {\n loading: false,\n fileName: '',\n total: 1,\n progress: 0\n };\n updateReactData({\n loadProgress: reactData.loadProgress,\n attachmentList: reactData.attachmentList,\n textInput: reactData.textInput\n }, true);\n return s3Resp;\n\n function performUpload() {\n return new Promise(function (resolve, reject) {\n upload\n .send((err, good) => {\n if (err) {\n if (err.code === 'RequestAbortedError') {\n enqueueSnackbar(`AVA stopped loading at your request.`, { variant: 'error', persist: false });\n }\n else {\n enqueueSnackbar(`Uh oh! AVA couldn't save your file. The reason is ${err.message}`, { variant: 'error', persist: true });\n }\n reject({});\n }\n else {\n resolve(good);\n }\n });\n upload.on('httpUploadProgress', progress => {\n if (reactData.loadProgress[reactData_index].loading === 'abort') {\n upload.abort();\n reactData.loadProgress.splice(reactData_index, 1);\n }\n else {\n let pFactor = 1000;\n do {\n pFactor *= 10;\n }\n while (progress.total > (1000 * pFactor));\n reactData.loadProgress[reactData_index] = {\n loading: true,\n fileName: progress.key,\n total: (progress.total / pFactor),\n progress: ((progress.loaded * 100) / progress.total)\n };\n }\n updateReactData({ loadProgress: reactData.loadProgress }, true);\n });\n });\n };\n };\n\n const handleChangeTextField = (vText, columnNumber, rowNumber) => {\n reactData.columnList[columnNumber].columnActivated = true;\n if (!reactData.columnList[columnNumber].rowDetails[rowNumber].hasOwnProperty('textValue')) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].textValue = {};\n }\n reactData.columnList[columnNumber].rowDetails[rowNumber].error = '';\n if (!vText || (vText === '')) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].isChecked = false;\n if (reactData.columnList[columnNumber].rowDetails[rowNumber].required) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].error = 'This information is required';\n }\n reactData.columnList[columnNumber].rowDetails[rowNumber].textValue = '';\n }\n else {\n reactData.columnList[columnNumber].rowDetails[rowNumber].isChecked = true;\n if (reactData.columnList[columnNumber].rowDetails[rowNumber].input.toLowerCase() === 'promptall') {\n handleTextAll(vText, reactData.columnList[columnNumber].rowDetails[rowNumber].text);\n }\n else if (reactData.columnList[columnNumber].rowDetails[rowNumber].input === 'date') {\n handleDateExit(vText, columnNumber, rowNumber);\n }\n else if (reactData.columnList[columnNumber].rowDetails[rowNumber].input === 'time') {\n handleTimeExit(vText, columnNumber, rowNumber);\n }\n else if (reactData.columnList[columnNumber].rowDetails[rowNumber].input.toLowerCase() === 'promptall') {\n handleTextAll(vText, reactData.columnList[columnNumber].rowDetails[rowNumber].text);\n }\n else if ((reactData.columnList[columnNumber].rowDetails[rowNumber].obo_line)\n || (reactData.columnList[columnNumber].rowDetails[rowNumber].input.toLowerCase() === 'obo')) {\n handleOBOText(vText, columnNumber, rowNumber);\n }\n else {\n reactData.columnList[columnNumber].rowDetails[rowNumber].textValue = vText.replace(/[\\r\\n]+/gm, '');\n }\n }\n if (isNaN(reactData.columnList[columnNumber].rowDetails[rowNumber].version)) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].version = new Date().getTime();\n }\n else {\n reactData.columnList[columnNumber].rowDetails[rowNumber].version++;\n }\n updateReactData({ columnList: reactData.columnList }, true);\n return;\n };\n\n function handleDateExit(vText, columnNumber, rowNumber) {\n let AVAdate = makeDate(vText, reactData.columnList[columnNumber].rowDetails[rowNumber].row_qualifier);\n if (AVAdate.error) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].error = AVAdate.absolute;\n }\n else {\n reactData.columnList[columnNumber].rowDetails[rowNumber].error = '';\n reactData.columnList[columnNumber].rowDetails[rowNumber].textValue = AVAdate.absolute_full;\n }\n return;\n };\n\n function handleTimeExit(vText, columnNumber, rowNumber) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].error = '';\n let ampm = null;\n if (vText.includes('p')) { ampm = 'pm'; }\n else if (vText.includes('a')) { ampm = 'am'; };\n let [hh$, mm$] = vText.split(':');\n let hh = Number(hh$.replace(/\\D+/g, ''));\n let mm = 0;\n if (hh > 100) {\n if (!mm$) { mm = hh % 100; }\n hh = Math.floor(hh / 100);\n }\n if (mm$) { mm = Number(mm$.replace(/\\D+/g, '')); }\n if (mm > 59) {\n let hAdd = Math.floor(mm / 60);\n mm -= (hAdd * 60);\n hh += hAdd;\n }\n if (hh >= 23) {\n hh = hh % 24;\n }\n if (hh >= 12) {\n hh -= 12;\n ampm = 'pm';\n }\n if (hh === 0) {\n hh = 12;\n ampm = 'pm';\n }\n if (!ampm) { ampm = ((hh > 6) && (hh < 12)) ? 'am' : 'pm'; }\n reactData.columnList[columnNumber].rowDetails[rowNumber].textValue = `${hh}:${mm < 10 ? ('0' + mm) : mm} ${ampm}`;\n return;\n };\n\n function handleOBOText(vText, columnNumber, rowNumber) {\n let inactiveAssignment = state?.session?.group_assignments?.inactive;\n let inactiveGroup = [];\n if (!inactiveAssignment) {\n inactiveGroup = ['inactive'];\n }\n else if (Array.isArray(inactiveAssignment)) {\n inactiveGroup.push(...inactiveAssignment);\n }\n else {\n inactiveGroup = [inactiveAssignment];\n }\n let prohibitedGroups = inactiveGroup;\n if (defaultValue.obo_prohibited) {\n let prohibitedList = makeArray(defaultValue.obo_prohibited);\n prohibitedList.forEach(p => {\n prohibitedGroups.push(...makeArray(state?.session?.group_assignments?.[p]));\n });\n };\n let guestAssignment = state?.session?.group_assignments?.guest;\n let guestGroups = [];\n if (!guestAssignment) {\n guestGroups = ['guest'];\n }\n else if (Array.isArray(guestAssignment)) {\n guestGroups.push(...guestAssignment);\n }\n else {\n guestGroups = [guestAssignment];\n }\n let typed_in_words = vText.toLowerCase().split(/\\s+/).filter(w => { return w.length > 2; });\n let hits = [];\n let errorText = null;\n let winnerList = [];\n let selections = {};\n if (!state?.accessList?.[state.session.client_id]?.list) {\n errorText = `AVA is still loading names. Please wait a few seconds and try again.`;\n }\n else {\n let maxMatch = 1;\n for (let accessList_person of state.accessList[state.session.client_id].list) {\n if (prohibitedGroups.includes(accessList_person.member_of)) {\n return false;\n }\n // if any word in the display_name matches a typed in word, it is a \"hit\"\n let wordsMatched = accessList_person.display_name.toLowerCase().split(/\\s+/).reduce((total_matches, name_word) => { // for every word in the display_name...\n if (typed_in_words.some(typed_in_word => { // check for any typed in word that exactly matches\n return (typed_in_word === name_word);\n })) {\n total_matches++;\n };\n return total_matches;\n }, 0);\n if (wordsMatched >= maxMatch) {\n maxMatch = Math.min(wordsMatched, typed_in_words.length); // you can't match 4 words if only 2 words were typed in\n hits.push({\n accessRec: accessList_person,\n wordsMatched\n });\n }\n };\n if (hits.length === 0) {\n errorText = `Nobody found to match that name`;\n }\n else {\n winnerList = [{\n default: '',\n max_allowed: 1,\n min_required: 1,\n option: [],\n }];\n for (let this_hit of (hits.filter(h => { return h.wordsMatched >= maxMatch; }))) {\n let newDName = `${this_hit.accessRec.name?.first} ${this_hit.accessRec.name?.last}`.trim() || this_hit.accessRec.display_name;\n let select_name = `${newDName}${guestGroups.includes(this_hit.accessRec.member_of)\n ? ' (Guest)'\n : (this_hit.accessRec.location ? ' (' + this_hit.accessRec.location + ')' : '')\n }`;\n winnerList[0].option.push({\n person_id: this_hit.accessRec.id,\n location: this_hit.location,\n dName: newDName,\n display: select_name,\n type: 'checkbox'\n });\n selections[select_name] = false;\n }\n if (winnerList[0].option.length > 1) {\n winnerList[0].title = `AVA found ${winnerList[0].option.length} people to match that name.`;\n }\n }\n let targetColumns = [];\n if (!defaultValue.selectList) {\n reactData.columnList.forEach((c, x) => {\n targetColumns.push(x);\n });\n }\n else {\n targetColumns.push(columnNumber);\n }\n targetColumns.forEach(c => {\n reactData.columnList[c].rowDetails[rowNumber].error = '';\n reactData.columnList[c].rowDetails[rowNumber].qualData = [];\n reactData.columnList[c].rowDetails[rowNumber].qualSelections = {};\n if (winnerList[0].option.length === 1) {\n reactData.columnList[c].person_id = winnerList[0].option[0].person_id;\n let newDName = winnerList[0].option[0].dName;\n reactData.columnList[c].display_name = newDName;\n reactData.columnList[c].dName.splice(-3, 3, ...([' ', ' ', ' '].concat(newDName.split(/\\s+/).splice(-3))));\n vText = winnerList[0].option[0].display;\n resetTitleName();\n reactData.columnList[c].rowDetails.forEach((checkRow, r) => {\n if (checkRow.location_line) {\n reactData.columnList[c].rowDetails[r].textValue = winnerList[0].option[0].location || '';\n }\n });\n }\n else if (errorText) {\n reactData.columnList[c].rowDetails[rowNumber].error = errorText;\n }\n else {\n reactData.columnList[c].person_id = winnerList[0].option[0].person_id;\n reactData.columnList[c].display_name = winnerList[0].option[0].dName;\n reactData.columnList[c].dName.splice(-3, 3, ...([' ', ' ', ' '].concat(winnerList[0].option[0].dName.split(/\\s+/).splice(-3))));\n resetTitleName();\n reactData.columnList[c].rowDetails[rowNumber].isChecked = true;\n reactData.columnList[c].rowDetails[rowNumber].isExpanded = true;\n reactData.columnList[c].rowDetails[rowNumber].version = new Date().getTime();\n reactData.columnList[c].rowDetails[rowNumber].qualData = winnerList;\n reactData.columnList[c].rowDetails[rowNumber].qualSelections = {\n [winnerList[0].title]: selections\n };\n vText = winnerList[0].option[0].dName;\n reactData.columnList[c].rowDetails.forEach((checkRow, r) => {\n if (checkRow.location_line) {\n reactData.columnList[c].rowDetails[r].textValue = winnerList[0].option[0].location || '';\n }\n });\n }\n reactData.columnList[c].rowDetails[rowNumber].textValue = titleCase(vText);\n });\n return;\n }\n };\n\n function resetTitleName() {\n let workingTitle = {};\n reactData.columnList.forEach(this_person => {\n let nameWords = this_person.display_name.split(/\\s+/);\n let this_lastName = nameWords.pop();\n let this_firstName = nameWords.join(' ');\n if (!workingTitle || !workingTitle.remembered || (workingTitle.remembered.length === 0)) {\n workingTitle = {\n first: this_firstName,\n last: this_lastName.trim(),\n display: this_person.display_name,\n remembered: [this_person.display_name]\n };\n }\n else if (workingTitle.last.toLowerCase() !== this_lastName.trim().toLowerCase()) {\n if (!workingTitle.remembered.includes(this_person.display_name)) {\n workingTitle.display = `${workingTitle.remembered.push(this_person.display_name)} people`;\n }\n workingTitle.first = '_multi_';\n workingTitle.last = '_multi_';\n }\n else { // same last name as all others so far\n if (!workingTitle.remembered.includes(this_person.display_name)) {\n workingTitle.remembered.push(this_person.display_name);\n workingTitle.display = `${workingTitle.first} and ${this_person.display_name}`;\n workingTitle.first = `${workingTitle.first}, ${this_firstName.trim()}`;\n }\n }\n });\n updateReactData({ titleName: workingTitle }, false);\n }\n\n function handleTextAll(vText, this_item) {\n reactData.columnList.forEach((this_column, columnNumber) => {\n let rowNumber = this_column.rowDetails.findIndex(r => {\n return (r.text === this_item);\n });\n if (rowNumber >= 0) {\n reactData.columnList[columnNumber].rowDetails[rowNumber].textValue = vText;\n }\n });\n return;\n };\n\n function isQualChecked(rowData, pOption, pSelection) {\n if (!rowData.qualSelections) { return false; }\n if (!rowData.qualSelections.hasOwnProperty(pOption)) { return false; }\n return !!rowData.qualSelections[pOption][pSelection];\n }\n\n async function itemSelected(columnNumber, rowNumber) {\n let this_row = reactData.columnList[columnNumber].rowDetails[rowNumber];\n this_row.isChecked = !this_row.isChecked;\n this_row.isExpanded = this_row.isChecked;\n if (isNaN(this_row.version)) {\n this_row.version = new Date().getTime();\n }\n else {\n this_row.version++;\n }\n if (this_row.isChecked && this_row.observationKey && !this_row.qualData) {\n // let [myQualSelections, myQualData] = await buildQualifiers(this_row.observationKey);\n let qualResponse = await buildQualifiers(this_row.observationKey);\n if (Object.keys(qualResponse.selections).length > 0) {\n this_row.qualSelections = deepCopy(qualResponse.selections);\n }\n if (Object.keys(qualResponse.data).length > 0) {\n this_row.qualData = deepCopy(qualResponse.data);\n }\n if (Object.keys(qualResponse.moreInfo).length > 0) {\n this_row.moreInfo = deepCopy(qualResponse.moreInfo);\n }\n }\n reactData.columnList[columnNumber].columnActivated = true;\n reactData.columnList[columnNumber].rowDetails[rowNumber] = this_row;\n updateReactData({ columnList: reactData.columnList }, true);\n }\n\n function getQualTextValue(rowData, qOpt, qChoice) {\n if (rowData.qualSelections && rowData.qualSelections[qOpt]) {\n return rowData.qualSelections[qOpt][qChoice] || '';\n }\n else {\n return '';\n }\n }\n\n function optSelected(rowData, qOpt, qChoice, qValueText) {\n // reactData.columnList[columnNumber].rowDetails[rowNumber].qualSelections[pText][pOption][pSelection]\n if (!rowData.hasOwnProperty('qualData')) {\n return;\n }\n // which entry in qualData contains the qOpt information?\n let optionAt = rowData.qualData.findIndex(opt => {\n return (opt.title === qOpt);\n });\n if (optionAt < 0) {\n return;\n }\n if (isNaN(rowData.version)) {\n rowData.version = new Date().getTime();\n }\n else {\n rowData.version++;\n }\n\n let qualRules = rowData.qualData[optionAt];\n // which option in rowData.qualData[optionAt] contains the qChoice information?\n\n // reactData.columnList[columnNumber].rowDetails[rowNumber].hasOwnProperty('qualSelections').qualSelections[pText][pOption][pSelection]\n if (!rowData.hasOwnProperty('qualSelections')) {\n rowData.qualSelections = {\n };\n }\n if (!rowData.qualSelections.hasOwnProperty(qOpt)) {\n rowData.qualSelections[qOpt] = {\n [qChoice]: (qValueText || true)\n };\n }\n else {\n if (rowData.qualSelections[qOpt].hasOwnProperty(qChoice)) {\n if (typeof (rowData.qualSelections[qOpt][qChoice]) === 'boolean') {\n rowData.qualSelections[qOpt][qChoice] = !rowData.qualSelections[qOpt][qChoice];\n }\n else { rowData.qualSelections[qOpt][qChoice] = qValueText; }\n }\n else { rowData.qualSelections[qOpt][qChoice] = (qValueText || true); }\n }\n\n let optionsSelected = [];\n for (let choice in rowData.qualSelections[qOpt]) {\n if (rowData.qualSelections[qOpt][choice]) {\n optionsSelected.push(choice);\n }\n }\n let numberOfSelections = optionsSelected.length;\n if (qualRules.max_allowed && (numberOfSelections > qualRules.max_allowed)) {\n for (let o = 0; ((o < optionsSelected.length) && (numberOfSelections > qualRules.max_allowed)); o++) {\n // too many selections? turn off the first one we find that isn't the one requested in the function call\n if (optionsSelected[o] !== qChoice) {\n rowData.qualSelections[qOpt][optionsSelected[o]] = false;\n numberOfSelections--;\n }\n }\n }\n if (qualRules.min_required && (numberOfSelections < qualRules.min_required)) { // not enough selections\n if (qualRules.default && !rowData.qualSelections[qOpt][qualRules.default]) { // and the default is not selected \n rowData.qualSelections[qOpt][qualRules.default] = true;\n numberOfSelections++;\n }\n for (let o = 0; ((o < qualRules.option.length) && (numberOfSelections < qualRules.min_required)); o++) {\n // start turning things on until we have enough; but don't touch the one requested in the function call\n if ((!rowData.qualSelections[qOpt][qualRules.option[o].display])\n && (qualRules.option[o].display !== qOpt)\n && (qualRules.option[o].type === 'checkbox')\n ) {\n rowData.qualSelections[qOpt][qualRules.option[o].display] = true;\n numberOfSelections++;\n }\n }\n }\n return rowData;\n }\n\n async function addColumns(this_id) {\n let this_person = await getPerson(this_id);\n let this_name = (`${this_person.name.first} ${this_person.name.last}`).trim();\n if (!reactData.titleName || !reactData.titleName.remembered || (reactData.titleName.remembered.length === 0)) {\n reactData.titleName = {\n first: this_person.name.first.trim(),\n last: this_person.name.last.trim(),\n display: this_name,\n remembered: [this_name]\n };\n }\n else if (reactData.titleName.last.toLowerCase() !== this_person.name.last.trim().toLowerCase()) {\n if (!reactData.titleName.remembered.includes(this_name)) {\n reactData.titleName.display = `${reactData.titleName.remembered.push(this_name)} people`;\n }\n reactData.titleName.first = '_multi_';\n reactData.titleName.last = '_multi_';\n }\n else { // same last name as all others so far\n if (!reactData.titleName.remembered.includes(this_name)) {\n reactData.titleName.remembered.push(this_name);\n reactData.titleName.display = `${reactData.titleName.first} and ${this_name}`;\n reactData.titleName.first = `${reactData.titleName.first}, ${this_person.name.first.trim()}`;\n }\n }\n let myDefaultColumns = deepCopy(reactData.defaultColumns);\n for (let c = 0; c < myDefaultColumns.length; c++) { // for each column\n let column = myDefaultColumns[c];\n for (let dKey in column.defaultValues) {\n if (column.defaultValues[dKey] === '[person.location]') {\n myDefaultColumns[c].defaultValues[dKey] = this_person.location;\n }\n else if (column.defaultValues[dKey] === '[person.name]') {\n myDefaultColumns[c].defaultValues[dKey] = `${this_person.first} ${this_person.last}`;\n }\n else if ((typeof (column.defaultValues[dKey]) === 'string') && (column.defaultValues[dKey].startsWith('[person.'))) {\n let pKey = column.defaultValues[dKey].split('.')[1];\n if (this_person.hasOwnProperty(pKey)) {\n myDefaultColumns[c].defaultValues[dKey] = this_person[pKey];\n }\n }\n }\n myDefaultColumns[c].columnActivated = false;\n myDefaultColumns[c].rowDetails.forEach((dRow, r) => {\n if (dRow.textValue) {\n if (dRow.textValue === '[person.location]') {\n myDefaultColumns[c].rowDetails[r].textValue = this_person.location;\n }\n else if (dRow.textValue === '[person.name]') {\n myDefaultColumns[c].rowDetails[r].textValue = `${this_person.first} ${this_person.last}`;\n }\n else if (dRow.textValue.startsWith('[person.')) {\n let pKey = dRow.textValue.split('.')[1];\n if (this_person.hasOwnProperty(pKey)) {\n myDefaultColumns[c].rowDetails[r].textValue = this_person[pKey];\n }\n }\n }\n });\n myDefaultColumns[c].person_id = this_id;\n myDefaultColumns[c].column_id = `${column.column_id}_${this_id}`;\n myDefaultColumns[c].display_name = this_name;\n // add three elements for the name at the end of the dName array (regardless of whether you have 2 or 3 words in your name)\n let nameElements = [' ', ' '].concat((`${this_person.name.first} ${this_person.name.last}`).trim().split(/[\\s-]+/));\n myDefaultColumns[c].dName.push(...(nameElements.slice(-3)));\n if (myDefaultColumns[c].dName.length > reactData.maxDName) {\n updateReactData({\n maxDName: myDefaultColumns[c].dName.length\n }, false);\n }\n if (defaultValue.checkForDuplicates) {\n let existingRequest = await checkExistingRequests({\n client_id: state.session.client_id,\n foreign_key: myDefaultColumns[c].foreign_key || myDefaultColumns[c].foreignKey,\n request_type: defaultValue.importTypes || myDefaultColumns[c].request_type || myDefaultColumns[c].requestType,\n requestor: this_id,\n requestor_name: `${this_person.name.first} ${this_person.name.last}`,\n defaultValue\n });\n if (existingRequest.status === 'use existing') {\n await applyExistingRequest(existingRequest, myDefaultColumns[c], c);\n }\n }\n };\n reactData.columnList.push(...myDefaultColumns);\n if (reactData.columnList.length > 1) {\n columnCommonName();\n }\n };\n\n function OKtoShow(this_item) {\n let response = true;\n if (this_item.rowTest.length > 0) {\n response = this_item.rowTest.every(thisTest => {\n let test;\n let display = true;\n if (isObject(thisTest)) {\n test = thisTest.test;\n display = (thisTest.type === 'display');\n }\n else {\n test = thisTest;\n display = true;\n };\n let [checkField, checkValue, qualSelected] = test.split('%%');\n let checkRow = reactData.columnList[selectedColumn].rowDetails.find(row => {\n return (row.text === checkField);\n });\n if (checkValue === 'true') {\n checkValue = true;\n }\n else if (checkValue === 'false') {\n checkValue = false;\n }\n let innerResponse;\n if (checkRow) {\n if (checkRow.checkbox || checkRow.isChecked) { // checkbox \n if (!checkValue) {\n innerResponse = checkRow.isChecked;\n }\n else if (!checkRow.isChecked || !qualSelected || !checkRow.qualSelections) {\n innerResponse = false;\n }\n else {\n innerResponse = (checkRow.qualSelections.hasOwnProperty(checkValue) && checkRow.qualSelections[checkValue][qualSelected]);\n }\n }\n else if (!checkValue) { // not a checkbox... if we don't care if there is a vlue type in or not? \n innerResponse = !!checkRow.textValue;\n }\n else { // if we do care...\n innerResponse = checkRow.textValue.toLowerCase().includes(checkValue.toLowerCase());\n }\n }\n else if (reactData.columnList[selectedColumn].defaultValues.hasOwnProperty(checkField)) {\n // no row matched this test field; perhaps a default value does? \n innerResponse = (reactData.columnList[selectedColumn].defaultValues[checkField] === checkValue);\n }\n else if (defaultValue.hasOwnProperty(checkField)) {\n // maybe a global default? \n innerResponse = (defaultValue[checkField] === checkValue);\n }\n if (display) {\n return innerResponse;\n }\n else {\n return !innerResponse;\n }\n });\n }\n return response;\n }\n\n async function applyExistingRequest(existingRequest, this_column, this_column_index) {\n this_column.request_to_update = existingRequest.requestToUse;\n this_column.columnActivated = true;\n if (!existingRequest.requestToUse.hasOwnProperty('current_request')) {\n existingRequest.requestToUse.current_request = deepCopy(existingRequest.requestToUse.original_request);\n }\n for (let sX = 0; sX < existingRequest.requestToUse.current_request.selections.length; sX++) {\n let s = existingRequest.requestToUse.current_request.selections[sX];\n let selection = s.split('(').shift().trim();\n let rowNumber = this_column.rowDetails.findIndex(r => {\n return (r.text === selection);\n });\n if (rowNumber > -1) {\n this_column.rowDetails[rowNumber].isChecked = true;\n this_column.rowDetails[rowNumber].isExpanded = true;\n this_column.rowDetails[rowNumber].version = new Date().getTime();\n if (this_column.rowDetails[rowNumber].observationKey && !this_column.rowDetails[rowNumber].qualData) {\n let qualResponse = await buildQualifiers(this_column.rowDetails[rowNumber].observationKey);\n if (Object.keys(qualResponse.selections).length > 0) {\n this_column.rowDetails[rowNumber].qualSelections = deepCopy(qualResponse.selections);\n }\n if (Object.keys(qualResponse.data).length > 0) {\n this_column.rowDetails[rowNumber].qualData = deepCopy(qualResponse.data);\n }\n if (Object.keys(qualResponse.moreInfo).length > 0) {\n this_column.rowDetails[rowNumber].moreInfo = deepCopy(qualResponse.moreInfo);\n }\n }\n if ((existingRequest.requestToUse.current_request.hasOwnProperty('options'))\n && (existingRequest.requestToUse.current_request.options.hasOwnProperty(selection))) {\n if (!this_column.rowDetails[rowNumber].qualData) {\n // [this_column.rowDetails[rowNumber].defaultSelections, this_column.rowDetails[rowNumber].qualData] = await buildQualifiers(this_column.rowDetails[rowNumber].observationKey);\n let qualResponse = await buildQualifiers(this_column.rowDetails[rowNumber].observationKey);\n this_column.rowDetails[rowNumber].defaultSelections = deepCopy(qualResponse.selections);\n this_column.rowDetails[rowNumber].qualData = deepCopy(qualResponse.data);\n this_column.rowDetails[rowNumber].moreInfo = deepCopy(qualResponse.moreInfo);\n }\n this_column.rowDetails[rowNumber].qualSelections = deepCopy(existingRequest.requestToUse.current_request.options[selection]);\n }\n if ((existingRequest.requestToUse?.current_request.hasOwnProperty('textInput'))\n && (existingRequest.requestToUse?.current_request?.options?.hasOwnProperty(selection))) {\n this_column.rowDetails[rowNumber].textValue = deepCopy(existingRequest.requestToUse.current_request.textInput[selection]);\n }\n if ((this_column.rowDetails[rowNumber].input === 'signature')\n && (existingRequest.requestToUse.current_request.hasOwnProperty('images') || existingRequest.requestToUse?.current_request.hasOwnProperty('image_location'))) {\n if (existingRequest.requestToUse.current_request.image_location?.[this_column.rowDetails[rowNumber].text]) {\n\n updateReactData({\n storedSignature: existingRequest.requestToUse?.current_request.image_location[this_column.rowDetails[rowNumber].text]\n }, false);\n }\n else {\n updateReactData({\n storedSignature: existingRequest.requestToUse?.current_request.images[this_column.rowDetails[rowNumber].text]\n }, false);\n }\n }\n }\n };\n if (existingRequest.requestToUse.current_request.hasOwnProperty('textInput')) {\n for (let selection in existingRequest.requestToUse.current_request.textInput) {\n let rowNumber = this_column.rowDetails.findIndex(r => {\n return (r.text === selection);\n });\n if (rowNumber < 0) {\n continue;\n };\n this_column.rowDetails[rowNumber].textValue = deepCopy(existingRequest.requestToUse.current_request.textInput[selection]);\n }\n }\n if (existingRequest.requestToUse.current_request.hasOwnProperty('qualifiers')) {\n /*\n current_request.qualifiers come in as qualifiers.[][][]\n example \n [Coffee][How do you like your coffee?][cream, sugar]\n \n and are stored in qualSelections as [][][][pSelection]\n example \n [Coffee][rsteele][How do you like your coffee?][cream] = true\n [Coffee][rsteele][How do you like your coffee?][sugar] = true\n */\n for (let selection in existingRequest.requestToUse.current_request.qualifiers) {\n let rowNumber = this_column.rowDetails.findIndex(r => {\n return (r.qualData && r.qualData.qualSelections && r.qualData.qualSelections.hasOwnProperty(selection));\n });\n if (rowNumber < 0) {\n continue;\n };\n for (let option in existingRequest.requestToUse.current_request.qualifiers[selection]) {\n if (!this_column.rowDetails.qualData.qualSelections[selection].hasOwnProperty(option)) {\n this_column.rowDetails.qualData.qualSelections[selection][option] = {};\n }\n if (Array.isArray(existingRequest.requestToUse.current_request.qualifiers[selection][option])) {\n existingRequest.requestToUse.current_request.qualifiers[selection][option].forEach(choice => {\n this_column.rowDetails.qualData.qualSelections[selection][option][choice] = true;\n });\n }\n }\n }\n }\n };\n\n async function checkExistingRequests(request_key) {\n // Does this person already have a request for this requestype and foreignkey?\n if (!request_key.foreign_key || (request_key.foreign_key === 'noFKey')) {\n return {\n 'status': 'make new'\n };\n }\n let existingRequest = await getServiceRequests(request_key);\n if (existingRequest.length > 0) {\n if (request_key.defaultValue.useExisting) {\n return {\n 'status': 'use existing',\n 'requestToUse': existingRequest[0]\n };\n }\n else {\n let requestAction = await orderWarning(request_key);\n let rTime = makeDate(new Date().getTime());\n switch (requestAction) {\n case 'use': {\n let lastRec = records2Update.push(existingRequest[0]) - 1;\n records2Update[lastRec].history.unshift(`Imported by ${state.session.user_id} on ${rTime.oaDate}`);\n records2Update[lastRec].last_update = rTime.timestamp;\n setRecords2Update(records2Update);\n return {\n 'status': 'use existing',\n 'requestToUse': existingRequest[0]\n };\n }\n case 'delete': {\n let lastRec = records2Update.push(existingRequest[0]) - 1;\n records2Update[lastRec].history.unshift(`Replaced on ${rTime.oaDate}`);\n records2Update[lastRec].last_update = rTime.timestamp;\n setRecords2Update(records2Update);\n break;\n }\n default: { }\n }\n }\n }\n return {\n 'status': 'make new'\n };\n\n async function orderWarning(pKey) {\n const showWarning = new Promise((resolve, reject) => {\n let response = '';\n const snackAction = (\n \n \n \n \n \n );\n let phrase = `${state.session.service_request_types[pKey.request_type]?.description || 'This'} already exists for ${pKey.requestor_name}`;\n if (pKey.foreign_key) {\n let fKdate = makeDate(pKey.foreign_key);\n if (!fKdate.error) {\n phrase += ` dated for ${fKdate.relative}`;\n }\n }\n enqueueSnackbar(\n `${phrase}. What would you like to do?`,\n { variant: 'warning', persist: true, action: snackAction }\n );\n });\n let rValue = await showWarning;\n closeSnackbar();\n return rValue;\n }\n };\n\n async function sendRequests(pData) {\n let everyoneText = {};\n if (pData.textValue && pData.textValue.hasOwnProperty('*all*')) {\n Object.keys(pData.textValue['*all*']).forEach(prompt => {\n everyoneText[prompt] = pData.textValue['*all*'][prompt];\n });\n }\n let writtenRecords = [];\n let local_key = null;\n let message_body;\n\n for (let columnNumber = 0; columnNumber < pData.length; columnNumber++) {\n let currentTime = makeDate(new Date());\n let selections = [];\n let options = {};\n let textInput = {};\n let images = {};\n let image_location = {};\n let oBo;\n let this_column = pData[columnNumber];\n if (this_column.columnActivated) {\n if (this_column.person_id) {\n oBo = await makeName(this_column.person_id);\n }\n else {\n oBo = await makeName(reactData.defaultPerson ? reactData.defaultPerson.person_id : state.patient.person_id);\n }\n for (let rowNumber = 0; rowNumber < this_column.rowDetails.length; rowNumber++) {\n let this_row = this_column.rowDetails[rowNumber];\n if (this_row.isChecked && !this_row.input) {\n let choices_list = [];\n for (let this_option in this_row.qualSelections) {\n for (let this_choice in this_row.qualSelections[this_option]) {\n if (!options.hasOwnProperty(this_row.text)) {\n options[this_row.text] = {};\n }\n if (!options[this_row.text].hasOwnProperty(this_option)) {\n options[this_row.text][this_option] = {};\n }\n options[this_row.text][this_option][this_choice] = this_row.qualSelections[this_option][this_choice];\n if (typeof (this_row.qualSelections[this_option][this_choice]) === 'boolean') {\n if (this_row.qualSelections[this_option][this_choice]) {\n choices_list.push(this_choice);\n }\n }\n else {\n choices_list.push(this_row.qualSelections[this_option][this_choice]);\n }\n }\n }\n let pushText = this_row.text;\n if (choices_list.length > 0) {\n pushText += ` (${choices_list.join('; ')})`;\n }\n selections.push(pushText);\n }\n if (this_row.textValue) {\n // special Values/\n if ((this_row.obo_line) || (this_column.defaultValues.hasOwnProperty('onBehalfOf') && (this_column.defaultValues['onBehalfOf'] === this_row.text))\n || (this_row.input === 'obo')) {\n oBo = this_row.textValue;\n textInput[this_row.text] = `Changed to ${this_row.textValue}`;\n }\n else {\n textInput[this_row.text] = this_row.textValue;\n }\n }\n }\n if ((selections.length > 0) || (Object.keys(textInput).length > 0)) {\n // We are ready to save this service request\n let svc_messaging = null;\n if (!fact.new_messaging && fact.messaging) {\n if ((Array.isArray(fact.messaging) && (fact.messaging.every(m => { return (m.format && (m.format.type !== 'mealTicket')); })))\n || (!Array.isArray(fact.messaging) && (fact.messaging.format && (fact.messaging.format.type !== 'mealTicket')))) {\n svc_messaging = fact.messaging;\n local_key = null;\n }\n }\n let putSR = {};\n if (this_column.request_to_update) {\n putSR = deepCopy(this_column.request_to_update);\n }\n Object.assign(putSR, {\n client: state.session.client_id,\n author: this_column.person_id || state.session.patient_id,\n proxy_user: state.session.user_id,\n requestType: this_column.requestType,\n activity_key: this_column.activity_key,\n request: {},\n onBehalfOf: oBo,\n messaging: svc_messaging\n });\n if (local_key) {\n putSR.local_key = local_key;\n }\n if (this_column.request_to_update) {\n if (putSR.history.length === 0) {\n putSR.history = [];\n };\n putSR.history.unshift(`Request updated ${currentTime.oaDate}`);\n // putSR.original_request = {\n putSR.current_request = {\n selections,\n options,\n textInput,\n image_location,\n images\n };\n await updateServiceRequest(putSR);\n writtenRecords.push(putSR);\n }\n else {\n putSR.history = [`Request submitted ${currentTime.oaDate}`];\n putSR.request = {\n selections,\n options,\n textInput,\n image_location,\n images\n };\n putSR.foreign_key = await resolveMessageVariables(this_column.foreignKey, textInput);\n if (fact?.value?.freeText?.assign_to) {\n // if there is an assign_to value, we'll assigne this SR to that ID\n putSR.assign_to = fact?.value?.freeText?.assign_to;\n let this_name = await getPerson(fact?.value?.freeText?.assign_to, 'name');\n putSR.history.unshift(`Auto-Assigned to ${this_name}`);\n if (validRequestStatus(this_column.requestType, 'assigned', state.session)) {\n putSR.requestStatus = 'assigned';\n }\n }\n else {\n putSR.assign_to = 'unassigned';\n }\n if (reactData.attachmentList && (reactData.attachmentList.length > 0)) {\n putSR.attachments = reactData.attachmentList;\n if (defaultValue.requestType === 'file') {\n }\n }\n let result = await putServiceRequest(putSR);\n local_key = result.requestRec.local_key;\n message_body = result.body;\n writtenRecords.push(result.requestRec);\n if (result.message) {\n enqueueSnackbar(\n result.message,\n { variant: 'warning', persist: true }\n );\n }\n }\n }\n }\n };\n // meal tickets print here combining all completed requests...\n let formatCallObj = {\n local_key,\n client_id: pClient,\n client_name: state.session.client_name\n };\n if (fact.messaging && (fact.messaging?.format?.method !== 'hold')) {\n let factMessagingList = [];\n if (Array.isArray(fact.messaging)) {\n factMessagingList.push(...fact.messaging);\n }\n else {\n factMessagingList.push(fact.messaging);\n }\n for (let m = 0; m < factMessagingList.length; m++) {\n if (!factMessagingList[m].format.hasOwnProperty('logo') || factMessagingList[m].format.logo) {\n formatCallObj.logo = state.session.client_logo;\n formatCallObj.logo_dimensions = state.session.logo_dimensions;\n }\n if (!factMessagingList[m].format.hasOwnProperty('initials') || factMessagingList[m].format.initials) {\n formatCallObj.initials = true;\n }\n let html, plain, attachment;\n switch (factMessagingList[m].format.type) {\n case 'mealTicket':\n {\n [html, plain, attachment] = await mealTicketFormat(formatCallObj);\n break;\n }\n default: { }\n }\n if (html) { // if there is a message to send, send it and update all the Service Request records to show that it was sent\n // prepare message that contains the tickets (one for the whole group)\n message_body.messaging = deepCopy(factMessagingList[m]);\n message_body.messaging.format = { 'type': 'inBody', 'subject': 'Meal Ticket' };\n message_body.htmlText = html;\n message_body.messageText = plain;\n let preparedMessages = await prepareMessage(message_body);\n // send the message\n if (preparedMessages.length > 0) {\n preparedMessages.forEach((m, x) => {\n preparedMessages[x].thread_id = `svc_${message_body.requestType}/${local_key}`;\n if (attachment) {\n preparedMessages[x].attachments = [attachment.Location];\n if (message_body.messaging.hasOwnProperty('attachment_method')\n && (message_body.messaging.attachment_method === 'file')) {\n if (attachment.data) {\n preparedMessages[x].attachment_data = {\n filename: `MealTicket-${local_key}.pdf`,\n content: attachment.data,\n type: 'application/pdf',\n disposition: 'attachment',\n content_id: local_key\n };\n }\n }\n }\n });\n let rTime = makeDate(new Date().getTime());\n let rMsg;\n let last_status;\n if (message_body.messaging?.format?.method === 'hold') {\n last_status = 'Prepared & Held';\n rMsg = `Held for future processing ${rTime.oaDate}`;\n }\n else {\n let sendResults = (await sendMessages(preparedMessages)).pop();\n if (!sendResults.sent) {\n last_status = 'Failed to send';\n rMsg = `Failed to send ${rTime.oaDate}`;\n }\n else {\n if (validRequestStatus(message_body.requestType, 'sent', state.session)) {\n last_status = 'Sent';\n }\n rMsg = `Sent for processing ${rTime.oaDate}`;\n }\n }\n writtenRecords.forEach(w => {\n w.messages = preparedMessages;\n w.last_update = rTime.timestamp;\n w.last_status = last_status;\n if (('history' in w) && Array.isArray(w.history)) {\n w.history.unshift(rMsg);\n }\n else { w.history = [rMsg]; }\n });\n await updateServiceRequest(writtenRecords);\n }\n } // end of \"is there a message to send?\"\n // if (records2Update.length > 0) { await updateServiceRequest(records2Update); }\n }\n }\n }\n\n function makeConfirm(pData) { // assumes you've passed in a columnList\n let warningsExist = false;\n let dataExists = false;\n let confirmStatus = 'confirm';\n let warningSection = [];\n let responseArray = [`[bold][italic]AVA will send the following:`];\n pData.forEach((this_column, column_number) => {\n /*\n pData[\n {\n rowDetails[{\n text: (the actual selection text, such as \"Chopped Steak\" or \"Pancake Platter\")\n isChecked: ,\n qualSelections: {\n option: {\n choice: or \n }\n },\n textValue: \n }, ...\n ],\n xxxxxx: ...\n },\n {},...\n ]\n */\n let selectionText = [];\n let columnName = columnUniqueName(this_column).string;\n if (!this_column.columnActivated) {\n warningSection.push(`[color:red][bold]Nothing was entered${columnName ? (' for ' + columnName) : ''}.`);\n warningsExist = true;\n }\n else {\n /* Check for errors */\n this_column.rowDetails.forEach((this_row, row_number) => {\n reactData.columnList[column_number].rowDetails[row_number].error = false;\n if (this_row.isChecked && this_row.qualData) {\n this_row.qualData.forEach(this_qual => {\n if (this_qual.min_required > 0) {\n let qualCount = 0;\n if (this_row.qualSelections && this_row.qualSelections.hasOwnProperty(this_qual.title)) {\n qualCount = (Object.values(this_row.qualSelections[this_qual.title]).filter(this_value => {\n return this_value;\n })).length;\n }\n if (qualCount < this_qual.min_required) {\n confirmStatus = 'error';\n warningsExist = true;\n let warningMessage;\n if (this_qual.max_allowed === this_qual.min_required) {\n warningMessage = `You must select ${this_qual.min_required} from ${this_row.text} (${this_qual.title})`;\n }\n else {\n warningMessage = `You must select at least ${this_qual.min_required} from ${this_row.text} (${this_qual.title})`;\n }\n warningSection.push(`[color:red][bold]${warningMessage}`);\n reactData.columnList[column_number].rowDetails[row_number].error = warningMessage;\n }\n }\n });\n updateReactData({\n columnList: reactData.columnList\n }, false);\n }\n else if (this_row.required && !this_row.textValue && !this_row.isChecked) {\n confirmStatus = 'error';\n let warningMessage;\n if (pData.length > 1) {\n warningMessage = `${columnName} is missing \"${this_row.text}\"`;\n }\n else {\n warningMessage = `\"${this_row.text}\" is required`;\n }\n warningsExist = true;\n warningSection.push(`[color:red][bold]${warningMessage}`);\n reactData.columnList[column_number].rowDetails[row_number].error = 'This field is required';\n updateReactData({\n columnList: reactData.columnList\n }, false);\n }\n else if (this_row.error) {\n confirmStatus = 'error';\n if (pData.length > 1) {\n warningSection.push(`[color:red][bold]${columnName} has an error on \"${this_row.text}\". The error is: ${this_row.error}.`);\n }\n else {\n warningSection.push(`[color:red][bold]Error on \"${this_row.text}\". The error is: ${this_row.error}.`);\n }\n warningsExist = true;\n }\n });\n let options = {};\n if (reactData.collectPayment) {\n options.includeFees = true;\n }\n for (const [this_selection, optionList] of Object.entries(formatServiceRequestDetails(this_column, options))) {\n selectionText.push(`[style={size:1}]${sentenceCase(this_selection)}`);\n optionList.forEach(option => {\n selectionText.push(`[indent=1][italic][style={size:0.4}]${option}`);\n });\n };\n // that's all the rows for this column\n if (selectionText.length === 0) {\n if (pData.length > 1) {\n warningSection.push(`[color:red][bold]${columnName} has no entries at all`);\n }\n else {\n warningSection.push(`[color:red][bold]No entries were made`);\n }\n warningsExist = true;\n }\n else {\n if (confirmStatus !== 'error') {\n if (columnName) {\n responseArray.push(`[bold]${columnName}`);\n };\n responseArray.push(...selectionText);\n responseArray.push('[style = { bottom: 3 }] ');\n dataExists = true;\n }\n }\n }\n });\n let returnArray = [reactData.factName];\n if (reactData.commonText) {\n returnArray = [titleCase(reactData.commonText)];\n }\n if (warningsExist) {\n returnArray.push(...warningSection);\n }\n if (dataExists) {\n if (warningsExist) {\n returnArray.push(' ');\n }\n returnArray.push(...responseArray);\n }\n return [confirmStatus, returnArray];\n };\n\n return (\n \n { /* MAIN */}\n\n {(reactData.columnList && reactData.columnList.length > 0)\n &&\n \n {/* Header with Avatar, Message, and VertMenu */}\n \n \n \n {`${titleCase(reactData.commonText) || factName}`}\n \n {reactData.titleName.display &&\n \n {`for ${reactData.titleName.display}`}\n \n }\n \n {\n handleClick(event);\n setPopupMenuOpen(true);\n }}>\n \n \n { setPopupMenuOpen(false); }}\n keepMounted>\n \n {\n onClose();\n }}>\n \n \n \n {'Go to AVA Menu'}\n \n \n \n {\n let jumpTo = window.location.origin;\n window.location.replace(jumpTo);\n }}>\n \n \n \n {'Restart AVA'}\n \n \n \n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n {`User ${fact.session.user_id}${fact.patient_id !== fact.session.user_id ? (' (' + fact.patient_id + ')') : ''}`}\n {`Function: ObservationForm`}\n {`Activity: ${fact.activity_key}`}\n \n \n \n \n \n\n { /* Selection Row */}\n {(reactData.columnList.length > 1) &&\n 5) ? ((reactData.titleName.remembered.length > 1) ? '150px' : '100px') : 1}\n overflow={(reactData.columnList.length > 5) ? 'scroll' : null}\n key={'peopleSelectionBox'}\n id={'peopleSelectionBox'}\n className={classes.listItemSticky}\n >\n \n \n \n {(reactData.titleName.remembered.length === 1) &&\n \n }\n {'Select'}\n \n {reactData.columnList.map((this_column, this_columnNumber) => (\n \n {(reactData.titleName.remembered.length > 1) &&\n \n }\n {columnUniqueName(this_column).array.slice(-1 * Math.min(reactData.maxDName, 7)).map((n, nx) => (\n {n.slice(0, 10)}\n ))}\n {\n setSelectedColumn(this_columnNumber);\n setForceRedisplay(!forceRedisplay);\n }}\n disableRipple\n className={classes.radioButton}\n size='small'\n />\n \n ))}\n \n \n \n }\n\n { /* Data rows */}\n \n \n\n {(reactData.columnList.length > 0) &&\n (reactData.columnList[selectedColumn].rowDetails).map((this_item, this_index) => (\n OKtoShow(this_item) &&\n \n { /* Descriptive text - headers and info that is text only */}\n {!this_item.input && !this_item.checkbox &&\n \n \n {this_item.bold\n ? (this_item.italic ? {this_item.text} : {this_item.text})\n : (this_item.italic ? {this_item.text} : `${this_item.text}`)}\n \n \n }\n { /* Text prompt line for this row - headers don't have this */}\n {this_item.input && !reactData.viewOnly &&\n \n {\n if (!event.target.value) {\n reactData.errorOnScreen = false;\n }\n handleChangeTextField(event.target.value, selectedColumn, this_index);\n }}\n autoComplete='off'\n defaultValue={this_item.textValue || ''}\n />\n {(this_item.isChecked && !isEmpty(this_item.qualData)) &&\n \n {makeArray(this_item.qualData).map((qR, qRndx) => (\n \n \n \n {qR.title}\n \n \n {qR.option && qR.option.map((opt, oX) => (\n \n \n {\n reactData.columnList[selectedColumn].rowDetails[this_index].error = '';\n reactData.columnList[selectedColumn].rowDetails[this_index].qualData = [];\n reactData.columnList[selectedColumn].rowDetails[this_index].qualSelections = {};\n reactData.columnList[selectedColumn].rowDetails[this_index].textValue = opt.dName;\n reactData.columnList[selectedColumn].rowDetails[this_index].version++;\n reactData.columnList[selectedColumn].person_id = opt.person_id;\n reactData.columnList[selectedColumn].display_name = opt.dName;\n reactData.columnList[selectedColumn].dName.splice(-3, 3, ...([' ', ' ', ' '].concat(opt.dName.split(/\\s+/).splice(-3))));\n resetTitleName();\n reactData.columnList[selectedColumn].rowDetails.forEach((checkRow, r) => {\n if (checkRow.location_line) {\n reactData.columnList[selectedColumn].rowDetails[r].textValue = opt.location;\n }\n });\n updateReactData({\n columnList: reactData.columnList\n }, true);\n }}\n checked={false}\n />\n \n {opt.display}\n \n \n \n ))}\n \n \n \n ))\n }\n \n }\n \n }\n {this_item.checkbox && !this_item.header &&\n \n \n {\n if (this_item.checkbox && !this_item.noUpdate) {\n await itemSelected(selectedColumn, this_index);\n }\n }}\n >\n \n {!reactData.viewOnly && !this_item.noUpdate &&\n \n {this_item.isChecked ? : }\n \n }\n \n \n {this_item.text}\n \n {this_item.moreInfo && this_item.moreInfo.fee &&\n \n {new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n }).format(this_item.moreInfo.fee)}\n \n }\n {this_item.desc &&\n \n {this_item.desc}\n \n }\n \n \n {this_item.moreInfo && this_item.moreInfo.image &&\n \n }\n \n {(this_item.isChecked || this_item.isExpanded) &&\n (!isEmpty(this_item.moreInfo) || !isEmpty(this_item.qualData)) &&\n \n {!isEmpty(this_item.moreInfo) &&\n \n {Object.keys(this_item.moreInfo).map((opt, oX) => (\n \n {(opt !== 'image') && (opt !== 'fee') && (opt !== 'restriction') &&\n \n {`${sentenceCase(opt.replace('_', ' '))}${this_item.moreInfo[opt].trim() ? (': ' + this_item.moreInfo[opt]) : ''}`}\n \n }\n {(opt === 'restriction')\n && (\n state\n .accessList[state.session.client_id]\n .list\n .find(p => { return (p.person_id === reactData.columnList[selectedColumn].person_id); })\n .groups\n .includes(this_item.moreInfo[opt].trim())\n )\n &&\n \n \n {`*** THIS ITEM IS NOT RECOMMENDED FOR ${reactData.columnList[selectedColumn].display_name.toUpperCase()} ***`}\n \n \n }\n \n ))}\n \n }\n {(!isEmpty(this_item.qualData))\n && makeArray(this_item.qualData).map((qR, qRndx) => (\n \n \n \n {qR.title}\n \n \n {qR.option && qR.option.map((opt, oX) => (\n \n {(!opt.type || (opt.type === 'checkbox')) &&\n \n {!reactData.viewOnly &&\n {\n optSelected(reactData.columnList[selectedColumn].rowDetails[this_index], qR.title, opt.display);\n reactData.columnList[selectedColumn].columnActivated = true;\n updateReactData({\n columnList: reactData.columnList\n }, true);\n }}\n checked={isQualChecked(reactData.columnList[selectedColumn].rowDetails[this_index], qR.title, opt.display)}\n />\n }\n \n {opt.display}\n \n \n }\n {(opt.type === 'prompt' || opt.type === 'promptOnly') &&\n \n {!reactData.viewOnly && (opt.type === 'prompt') &&\n \n }\n \n {opt.display}:\n \n {!reactData.viewOnly &&\n {\n optSelected(reactData.columnList[selectedColumn].rowDetails[this_index], qR.title, opt.display, event.target.value);\n updateReactData({\n columnList: reactData.columnList\n }, true);\n }}\n autoComplete='off'\n />\n }\n \n }\n \n ))}\n \n \n \n ))\n }\n \n }\n {false && (this_item.moreInfo || this_item.qualData) &&\n \n {\n reactData.columnList[selectedColumn].rowDetails[this_index].isExpanded = !reactData.columnList[selectedColumn].rowDetails[this_index].isExpanded;\n updateReactData({\n columnList: reactData.columnList\n }, true);\n }\n }\n >\n {this_item.isExpanded ? : }\n \n \n }\n \n \n }\n \n ))\n }\n \n \n \n }\n\n { /* Prompt for People */}\n {((reactData.columnList && (reactData.columnList.length < 1)) || (morePeople))\n &&\n {\n if (reactData.columnList.length < 1) {\n onClose();\n }\n setMorePeople(false);\n }}\n onSelect={async (selectedID) => {\n let sIDs = makeArray(selectedID);\n reactData.columnList = [];\n if (sIDs.length > 0) {\n for (let p = 0; p < sIDs.length; p++) { // for each person you selected\n await addColumns(sIDs[p]);\n }\n updateReactData({\n columnList: reactData.columnList,\n titleName: reactData.titleName\n }, true);\n }\n setMorePeople(false);\n }}\n allowRandom={false}\n multiSelect={(defaultValue.selectOne ? !defaultValue.selectOne : true)}\n returnValue={'id'}\n />\n }\n\n { /* Prompts */}\n {cancelPending\n &&\n {\n setCancelPending(false);\n }}\n onConfirm={() => {\n onClose();\n }}\n >\n \n }\n {confirmDelete\n &&\n {\n setConfirmDelete(false);\n }}\n onConfirm={() => {\n reactData.columnList.splice(selectedColumn, 1);\n if (selectedColumn > 0) { setSelectedColumn(selectedColumn - 1); }\n setConfirmDelete(false);\n updateReactData({\n columnList: reactData.columnList\n }, true);\n }}\n >\n \n }\n {(confirmStatus === 'confirm')\n &&\n { setConfirmStatus(''); }}\n onConfirm={async () => {\n if (!reactData.lockSend) {\n updateReactData(\n { lockSend: true },\n false\n );\n if (reactData.collectPayment) {\n window.open(reactData.collectPayment.link || 'https://buy.stripe.com/3cs5lzbSS9RXecwcMN', reactData.collectPayment.description || 'Please pay');\n }\n await sendRequests(reactData.columnList);\n }\n onSave();\n }}\n />\n }\n {(confirmStatus === 'error')\n &&\n { setConfirmStatus(''); }}\n onConfirm={() => { }}\n >\n \n }\n\n { /* Command Area */}\n {((reactData.columnList && (reactData.columnList.length > 0)) && !morePeople)\n &&\n \n \n \n \n {\n ((factType === 'list') ? onClose() : setCancelPending(true));\n }}\n startIcon={}\n >\n {'Exit'}\n \n \n \n {reactData.allowAttachments &&\n \n }\n size='small'\n onClick={async () => {\n handleFileUpload();\n console.log('upload done');\n }}\n >\n {'Attach'}\n \n {\n await handleSaveFile(target.target.files[0]);\n setForceRedisplay(!forceRedisplay);\n }}\n />\n \n }\n {(allowAddPeople || (allowRemovePeople && (reactData.columnList.length > 1))) &&\n \n {allowAddPeople &&\n {\n setMorePeople(true);\n }}\n startIcon={}\n >\n {'Add People'}\n \n }\n {allowRemovePeople && (reactData.columnList.length > 1) && !reactData.viewOnly &&\n {\n setConfirmDelete(true);\n }}\n startIcon={}\n >\n {`Remove ${columnUniqueName(reactData.columnList[selectedColumn]).string}`}\n \n }\n \n }\n {(!factType || (factType !== 'list')) && !reactData.viewOnly &&\n !((reactData.columnList && (reactData.columnList.length < 1)) || (morePeople)) &&\n {\n let [cStatus, response] = makeConfirm(reactData.columnList);\n setConfirmPrompt(response);\n setConfirmStatus(cStatus);\n }}\n startIcon={}\n >\n {'Confirm/Send'}\n \n }\n \n \n \n \n }\n \n );\n\n};\n","import React from 'react';\nimport AVATextInput from './AVATextInput';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\n\nimport { isEmpty, titleCase, dbClient, cl } from '../../util/AVAUtilities';\nimport { makeDate } from '../../util/AVADateTime';\nimport { determineClass } from '../../util/AVAGroups';\nimport { getServiceRequests, putServiceRequest, updateServiceRequest } from '../../util/AVAServiceRequest';\nimport { getPerson, getImage, getPersonByWords, addGuest, addVendor, makeName } from '../../util/AVAPeople';\nimport { AVAclasses, AVADefaults, AVATextStyle, AVATextVariableStyle } from '../../util/AVAStyles';\n\nimport { useSnackbar } from 'notistack';\n\nimport useSession from '../../hooks/useSession';\nimport AVAConfirm from './AVAConfirm';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nconst useStyles = makeStyles(theme => ({\n AVAClientBackground: {\n backgroundColor: AVADefaults({ client_style: 'get' }) ? AVADefaults({ client_style: 'get' }).backgroundColor : null,\n borderRadius: '30px',\n padding: 5\n },\n AVAPromptBackground: {\n backgroundColor: AVADefaults({ client_style: 'get' }) ? AVADefaults({ client_style: 'get' }).promptBackgroundColor : null,\n borderRadius: '30px',\n padding: 5\n }\n}));\n\nexport default ({ onSave, onClose }) => {\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n const { enqueueSnackbar } = useSnackbar();\n const { state } = useSession();\n\n const [forceRedisplay, setForceRedisplay] = React.useState();\n const [reactData, setReactData] = React.useState(\n {\n kiosk_mode: (state.session.hasOwnProperty('kiosk_mode') ? state.session.kiosk_mode : false),\n validated_user: false,\n personRec: state.patient,\n residentName: ((state.patient && state.patient.name) ? `${state.patient.name.first} ${state.patient.name.last}` : ''),\n residentLocation: ((state.patient && state.patient.location) ? `${state.patient.location.trim().split(/\\s+/)[0]}` : ''),\n errorText: [],\n guest_mode: false,\n guest_vendor: false,\n resident_mode: false,\n add_guest_mode: false,\n adminOverride: false,\n adminIndex: -1,\n outList: [],\n adminView: false,\n initialized: false\n }\n );\n\n // Initialization\n\n React.useEffect(() => {\n async function initialize() {\n reactData.initialized = true;\n reactData.marquee_message = JSON.parse(sessionStorage.getItem('marquee_message'));\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }\n initialize();\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n\n // Functions\n\n async function validateUser(IDString, client_id, nonRes) {\n if (!IDString) { return { result: 'invalid', error_field: 0, reason: 'The ID field is empty' }; }\n // get candidates from the words entered\n let personRecs = [];\n let ID_words = IDString.trim().split(/\\s+/);\n if (ID_words.length === 1) { // only one word, try it as a user ID\n let result = await getPerson(ID_words[0], '*all');\n if (!isEmpty(result)) { personRecs.push(result); }\n }\n if (isEmpty(personRecs)) {\n personRecs.push(...(await getPersonByWords(client_id, ID_words)));\n if (isEmpty(personRecs)) {\n return { result: 'invalid', error_field: 0, reason: `We didn't find an account for ${IDString}` };\n }\n }\n for (let p = 0; p < personRecs.length; p++) {\n personRecs[p].account_class = determineClass(personRecs[p].groups, state.session.group_assignments);\n if (personRecs[p].messaging.voice) { personRecs[p].phone_key = `(xxx) xxx-${personRecs[p].messaging.voice.slice(-4)}`; }\n else if (personRecs[p].messaging.sms) { personRecs[p].phone_key = `(xxx) xxx-${personRecs[p].messaging.sms.slice(-4)}`; }\n }\n personRecs = personRecs.filter(p => { return (p.account_class !== 'inactive'); });\n switch (personRecs.length) {\n case 0: {\n return { result: 'invalid', error_field: 1, reason: `That information doesn't match any ${nonRes ? titleCase(nonRes) : 'Resident'} accounts that we can find` };\n }\n case 1: {\n return { result: 'match', person_id: personRecs[0].person_id, personRec: personRecs[0] };\n }\n default: {\n return {\n result: 'ambiguous',\n error_field: 1,\n reason: `\"${IDString}\" matches more than one ${nonRes ? titleCase(nonRes) : 'Resident'} account`,\n candidates: personRecs\n };\n }\n }\n }\n\n async function getCurrentStatus(client_id, person_id, mode) {\n let reqArray = await getServiceRequests({ client_id, person_id, foreign_key: mode, request_type: \"checkout\" });\n if (reqArray.length === 0) {\n let now = new Date().getTime();\n return {\n last_status: 'none',\n last_update: 0,\n history: [],\n reqRec: {\n client_id,\n \"request_id\": `${person_id}_checkout`,\n \"requestor\": person_id,\n \"on_behalf_of\": `${reactData.personRec.name.first} ${reactData.personRec.name.last}`,\n \"request_type\": 'checkout',\n \"request_date\": now,\n \"original_request\": {},\n \"history\": [],\n \"local_key\": `${person_id}_checkout`,\n \"foreign_key\": mode,\n \"last_update\": now,\n \"last_status\": 'none'\n }\n };\n }\n else\n return {\n last_status: reqArray[0].last_status,\n last_update: reqArray[0].last_update,\n history: reqArray[0].history,\n reqRec: reqArray[0]\n };\n }\n\n async function getCheckedOut() {\n let reqArray = await getServiceRequests({ client_id: state.session.client_id, request_type: \"checkout\" });\n let checkedOutList = [];\n let checkedInGuests = [];\n let checkedInVendors = [];\n let outSorter = [];\n let guestSorter = [];\n let vendorSorter = [];\n if (reqArray.length > 0) {\n reqArray.forEach((c, x) => {\n if ((c.last_status === 'out') && (c.foreign_key === 'resident')) {\n outSorter.push(`${c.last_update}~${x}`);\n }\n else if ((c.last_status === 'in') && (c.foreign_key === 'guest')) {\n guestSorter.push(`${c.last_update}~${x}`);\n }\n else if ((c.last_status === 'in') && (c.foreign_key === 'vendor')) {\n vendorSorter.push(`${c.last_update}~${x}`);\n }\n });\n outSorter.sort();\n for (let x = 0; x < outSorter.length; x++) {\n let c = reqArray[Number(outSorter[x].split('~')[1])];\n checkedOutList.push({\n person_id: c.requestor,\n reqRec: c,\n last_update: c.last_update,\n name: await makeName(c.requestor),\n message: c.history[0].replace('Checked out', '').trim()\n });\n };\n guestSorter.sort();\n for (let x = 0; x < guestSorter.length; x++) {\n let c = reqArray[Number(guestSorter[x].split('~')[1])];\n checkedInGuests.push({\n person_id: c.requestor,\n reqRec: c,\n last_update: c.last_update,\n name: await makeName(c.requestor),\n message: c.history[0].replace('Checked in', '').trim()\n });\n }\n vendorSorter.sort();\n for (let x = 0; x < vendorSorter.length; x++) {\n let c = reqArray[Number(vendorSorter[x].split('~')[1])];\n checkedInVendors.push({\n person_id: c.requestor,\n reqRec: c,\n last_update: c.last_update,\n name: await makeName(c.requestor),\n message: c.history[0].replace('Checked in', '').trim()\n });\n }\n }\n return [checkedOutList, checkedInGuests, checkedInVendors];\n }\n\n async function putCheckout(reqRec, options) {\n await updateServiceRequest(reqRec);\n let requestor = reactData.personRec.person_id;\n if (['vendor', 'guest'].includes(reqRec.foreign_key)) {\n requestor = reqRec.visiting;\n let visitor_name = `${reactData.personRec.name.first} ${reactData.personRec.name.last}`;\n reqRec.history[0] = `${visitor_name} ${reqRec.history[0]}`;\n }\n if ((reqRec.last_status === 'in') || (!reqRec.hasOwnProperty('current_request'))) {\n reqRec.current_request = {\n textInput: {\n Action: reqRec.history[0]\n }\n };\n }\n await putServiceRequest({\n client: state.session.client_id,\n author: requestor,\n proxy_user: state.session.user_id,\n requestType: 'checkout',\n requestor: requestor,\n activity_key: \"\",\n onBehalfOf: `${reactData.personRec.name.first} ${reactData.personRec.name.last}`,\n foreign_key: reactData.personRec.person_id, // if person checking into another person\n local_key: `${reactData.personRec.person_id}_checkout`,\n history: reqRec.history[0],\n last_status: reqRec.last_status,\n request: {\n selections: [`Checked ${reqRec.last_status}`],\n textInput: reqRec.current_request.textInput,\n },\n messaging: {}\n });\n let last10checkout = [reqRec.history[0]];\n if (reactData.personRec.hasOwnProperty('checkout_recent_history')) {\n last10checkout.push(...reactData.personRec.checkout_recent_history.slice(0, 9));\n }\n await dbClient\n .update({\n Key: { person_id: reactData.personRec.person_id },\n UpdateExpression: 'set #s = :s, #h = :h',\n ExpressionAttributeValues: {\n ':s': reqRec.last_status,\n ':h': last10checkout\n },\n ExpressionAttributeNames: {\n '#s': 'checkout_status',\n '#h': 'checkout_recent_history'\n },\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating People; error is: `, error);\n });\n }\n\n function reset() {\n let marquee_message = JSON.parse(sessionStorage.getItem('marquee_message'));\n setReactData({\n kiosk_mode: (state.session.hasOwnProperty('kiosk_mode') ? state.session.kiosk_mode : false),\n validated_user: false,\n personRec: state.patient,\n residentName: ((state.patient && state.patient.name) ? `${state.patient.name.first} ${state.patient.name.last}` : ''),\n residentLocation: ((state.patient && state.patient.location) ? `${state.patient.location.trim().split(/\\s+/)[0]}` : ''),\n errorText: [],\n guest_mode: false,\n resident_mode: false,\n staff_mode: false,\n add_guest_mode: false,\n adminOverride: false,\n adminIndex: -1,\n outList: [],\n adminView: false,\n initialized: true,\n marquee_message\n });\n setForceRedisplay(!forceRedisplay);\n }\n\n function determineMode(personRec) {\n reactData.resident_mode = false;\n reactData.guest_mode = false;\n reactData.staff_mode = false;\n reactData.other_mode = false;\n let mode;\n switch (personRec.account_class) {\n case 'staff':\n case 'admin': {\n reactData.staff_mode = true;\n mode = 'resident';\n break;\n }\n case 'student': \n case 'resident': {\n reactData.resident_mode = true;\n mode = 'resident';\n break;\n }\n case 'vendor': {\n reactData.guest_mode = true;\n mode = 'vendor';\n break;\n }\n case 'other': {\n reactData.other_mode = true;\n mode = 'other';\n break;\n }\n default: {\n reactData.guest_mode = true;\n mode = 'guest';\n }\n }\n return mode;\n }\n\n function makeGreeting(pName) {\n if (state.session?.custom_greeting) { return `${state.session.custom_greeting}${pName ? ', ' + pName : ''}!`; }\n else { return `Good ${makeDate(new Date()).dayPart}${pName ? ', ' + pName : ''}!`; }\n }\n\n return (\n \n \n \n \n {/* *** CHECK-IN/OUT VIEW *** */\n !reactData.adminView &&\n \n { /* **********************************\n We don't know who this is yet\n ********************************** */\n !reactData.validated_user && !reactData.add_guest_mode &&\n (!reactData.select_user ?\n {\n onClose();\n }}\n errorText={reactData.errorText}\n onSave={async ([enteredID], buttonPressed) => {\n if (buttonPressed === 2) {\n let [outList, guestList, vendorList] = await getCheckedOut();\n reactData.outList = outList;\n reactData.guestList = guestList;\n reactData.vendorList = vendorList;\n reactData.adminView = true;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }\n if (enteredID && (enteredID === 'exit')) {\n onClose();\n }\n else {\n if (!enteredID) {\n reactData.errorText[0] = `Please enter your name or AVA ID so we can properly identify you!`;\n }\n else {\n let validation = {};\n if (enteredID === reactData.residentName) {\n validation = {\n result: 'match',\n person_id: reactData.personRec.person_id,\n personRec: reactData.personRec,\n };\n validation.personRec.account_class = determineClass(reactData.personRec.groups, state.session.group_assignments);\n }\n else {\n validation = await validateUser(enteredID.toLowerCase(), state.session.client_id);\n }\n reactData.errorText = [];\n reactData.enteredID = enteredID;\n if ((validation.result === 'match') && (validation.personRec.person_id === state.patient.person_id)) { // Found myself\n reactData.validated_user = true;\n reactData.personRec = validation.personRec;\n let mode = determineMode(validation.personRec);\n reactData.currentStatus = await getCurrentStatus(state.session.client_id, validation.personRec.person_id, mode);\n reactData.select_user = false;\n }\n else if ((validation.result === 'match') || (validation.result === 'ambiguous')) {\n reactData.select_user = true;\n reactData.candidates = validation.candidates || [validation.personRec];\n }\n else {\n // put AVA in \"add a new guest\" mode\n reactData.select_user = false;\n reactData.add_guest_mode = true;\n reactData.add_try_number = 1;\n }\n }\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }\n }}\n allowCancel={!reactData.kiosk_mode}\n options={{\n save_on_enter: true,\n bgColor: AVADefaults({ client_style: 'get' }) ? AVADefaults({ client_style: 'get' }).promptBackgroundColor : null\n }}\n />\n :\n \n \n {makeGreeting()}\n {`Please select from this list or tap \"None of these\"`}\n \n \n {reactData.candidates.map((candidate, cIndex) => (\n {\n reactData.validated_user = true;\n reactData.personRec = candidate;\n let mode = determineMode(candidate);\n reactData.currentStatus = await getCurrentStatus(state.session.client_id, candidate.person_id, mode);\n reactData.select_user = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n \n {`${titleCase(candidate.name.first)} ${titleCase(candidate.name.last)}`}\n {`${titleCase(candidate.account_class)} - ${(candidate.phone_key || candidate.location)}`}\n \n \n )\n )}\n \n \n {\n reactData.select_user = false;\n reset();\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n Start over\n \n {\n // put AVA in \"add a new guest\" mode\n reactData.select_user = false;\n reactData.add_guest_mode = true;\n reactData.add_try_number = 1;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n None of these\n \n \n \n )\n }\n { /* **********************************\n We are checking in/out a Resident\n ********************************** */\n reactData.validated_user\n && (reactData.resident_mode)\n &&\n (['in', 'none'].includes(reactData.currentStatus.last_status) ?\n {\n reactData.validated_user = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }\n }\n onSave={async (responses) => {\n let now = makeDate(new Date());\n reactData.currentStatus.reqRec.last_status = 'out';\n reactData.currentStatus.reqRec.last_update = now.timestamp;\n let hNote = `Checked out on ${now.absolute}`;\n let textInput = {\n Action: hNote\n };\n if (responses && (responses.length > 0)) {\n responses.forEach((r, x) => {\n if (r && state.session.resident_checkout_prompts) {\n hNote += ` ${state.session.resident_checkout_prompts[x]}: ${r}.`;\n textInput[state.session.resident_checkout_prompts[x]] = r;\n }\n });\n }\n reactData.currentStatus.reqRec.history.unshift(hNote);\n if (!isEmpty(textInput)) {\n reactData.currentStatus.reqRec.current_request = { textInput };\n }\n await putCheckout(reactData.currentStatus.reqRec);\n enqueueSnackbar(`Got it! You have successfully checked out. Thank you!`, { variant: 'success', persist: false });\n if (!reactData.kiosk_mode && !state.session.adminAccount) { onClose(); }\n else { reset(); }\n }}\n allowCancel={true}\n options={{\n save_on_enter: (state.session.resident_checkout_prompts && (state.session.resident_checkout_prompts.length === 1)),\n bgColor: AVADefaults({ client_style: 'get' }) ? AVADefaults({ client_style: 'get' }).promptBackgroundColor : null\n }}\n\n />\n :\n {\n if (!reactData.kiosk_mode && !state.session.adminAccount) { onClose(); }\n else {\n reactData.validated_user = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }\n }}\n onConfirm={async () => {\n let now = makeDate(new Date());\n reactData.currentStatus.reqRec.last_status = 'in';\n reactData.currentStatus.reqRec.last_update = now.timestamp;\n let hNote = `Checked in on ${now.absolute}`;\n reactData.currentStatus.reqRec.history.unshift(hNote);\n await putCheckout(reactData.currentStatus.reqRec);\n enqueueSnackbar(`You're all set! You have successfully checked in.`, { variant: 'success', persist: false });\n if (!reactData.kiosk_mode && !state.session.adminAccount) { onClose(); }\n else { reset(); }\n }}\n allowCancel={true}\n />\n )\n }\n { /* **********************************\n We are checking in/out Staff\n ********************************** */\n reactData.validated_user\n && reactData.staff_mode\n &&\n (['in', 'none'].includes(reactData.currentStatus.last_status) ?\n {\n reactData.validated_user = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n options={{\n bgColor: AVADefaults({ client_style: 'get' }) ? AVADefaults({ client_style: 'get' }).promptBackgroundColor : null\n }}\n onConfirm={async () => {\n let now = makeDate(new Date());\n reactData.currentStatus.reqRec.last_status = 'out';\n reactData.currentStatus.reqRec.last_update = now.timestamp;\n let hNote = `Checked out on ${now.absolute}`;\n reactData.currentStatus.reqRec.history.unshift(hNote);\n await putCheckout(reactData.currentStatus.reqRec);\n enqueueSnackbar(`You're all set!`, { variant: 'success', persist: false });\n if (!reactData.kiosk_mode && !state.session.adminAccount) { onClose(); }\n else { reset(); }\n }}\n allowCancel={true}\n />\n :\n {\n reactData.errorText = [];\n reactData.validated_user = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onConfirm={async () => {\n let now = makeDate(new Date());\n reactData.currentStatus.reqRec.last_status = 'in';\n reactData.currentStatus.reqRec.last_update = now.timestamp;\n let hNote = `Checked in on ${now.absolute}`;\n reactData.currentStatus.reqRec.history.unshift(hNote);\n await putCheckout(reactData.currentStatus.reqRec);\n enqueueSnackbar(`You're all set!`, { variant: 'success', persist: false });\n if (!reactData.kiosk_mode && !state.session.adminAccount) { onClose(); }\n else { reset(); }\n }}\n allowCancel={true}\n />\n )\n }\n { /* **********************************\n We are checking in/out a Guest or Vendor\n ********************************** */\n reactData.validated_user\n && reactData.guest_mode\n &&\n (['in', 'none'].includes(reactData.currentStatus.last_status) ?\n {\n reactData.validated_user = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onConfirm={async () => {\n let now = makeDate(new Date());\n reactData.currentStatus.reqRec.last_status = 'out';\n reactData.currentStatus.reqRec.last_update = now.timestamp;\n let hNote = `Checked out on ${now.absolute}`;\n reactData.currentStatus.reqRec.history.unshift(hNote);\n await putCheckout(reactData.currentStatus.reqRec);\n enqueueSnackbar(`You're all set!`, { variant: 'success', persist: false });\n if (!reactData.kiosk_mode && !state.session.adminAccount) { onClose(); }\n else { reset(); }\n }}\n allowCancel={true}\n />\n :\n {\n reactData.errorText = [];\n reactData.validated_user = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onSave={async ([destination]) => {\n reactData.errorText = [];\n let hWho;\n if (destination !== reactData.currentStatus.reqRec.on_behalf_of) {\n let residentRec = await getPersonByWords(state.session.client_id, destination.trim().split(/\\s+/));\n switch (residentRec.length) {\n case 0: {\n reactData.errorText[0] = `We don't find anyone to match \"${destination}\".`;\n break;\n }\n case 1: {\n hWho = ` Visiting ${residentRec[0].name.first} ${residentRec[0].name.last}`;\n if (residentRec[0].location) {\n hWho += ` at ${residentRec[0].location}`;\n }\n reactData.currentStatus.reqRec.visiting = residentRec[0].person_id;\n reactData.currentStatus.reqRec.on_behalf_of = `${residentRec[0].name.first} ${residentRec[0].name.last}`;\n break;\n }\n default: {\n reactData.errorText[0] = `There are ${residentRec.length} matches for \"${destination}\". Can you be more specific?`;\n break;\n }\n }\n }\n else {\n hWho = ` Visiting ${reactData.currentStatus.reqRec.on_behalf_of}`;\n reactData.currentStatus.reqRec.visiting = reactData.currentStatus.reqRec.person_id;\n }\n if (reactData.errorText.length === 0) {\n let now = makeDate(new Date());\n reactData.currentStatus.reqRec.last_status = 'in';\n reactData.currentStatus.reqRec.last_update = now.timestamp;\n let hNote = `Checked in on ${now.absolute}`;\n hNote += hWho;\n reactData.currentStatus.reqRec.history.unshift(hNote);\n await putCheckout(reactData.currentStatus.reqRec);\n enqueueSnackbar(`Got it! Thank you!`, { variant: 'success', persist: false });\n if (!reactData.kiosk_mode && !state.session.adminAccount) { onClose(); }\n else { reset(); }\n }\n else {\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }\n }}\n options={{\n save_on_enter: true,\n bgColor: AVADefaults({ client_style: 'get' }) ? AVADefaults({ client_style: 'get' }).promptBackgroundColor : null\n }}\n allowCancel={true}\n />\n )\n }\n { /* **********************************\n Other/Error mode - You are not allowed to check-in/out\n ********************************** */\n reactData.validated_user\n && reactData.other_mode\n &&\n {\n reactData.validated_user = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onConfirm={async () => {\n reactData.validated_user = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n allowCancel={false}\n />\n }\n { /* ************************************\n Previously unknown user that must be created\n ************************************ */\n reactData.add_guest_mode\n &&\n {\n reactData.validated_user = false;\n reactData.add_guest_mode = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n errorText={reactData.errorText}\n onSave={async ([guestName, vendorCompany, contactNumber, destination]) => {\n reactData.errorText = [];\n if (reactData.enteredID.toLowerCase() !== guestName.toLowerCase()) {\n let validation = await validateUser(guestName, state.session.client_id);\n reactData.enteredID = guestName;\n if ((validation.result === 'match') || (validation.result === 'ambiguous')) {\n reactData.select_user = true;\n reactData.candidates = validation.candidates || [validation.personRec];\n reactData.add_guest_mode = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n return;\n }\n }\n let gNames = titleCase(guestName.trim()).split(/\\s+/);\n let gLast, gFirst;\n if (gNames.length < 2) {\n reactData.errorText[0] = `Please enter your full name`;\n }\n else {\n gLast = gNames.pop();\n gFirst = gNames.join(' ');\n }\n let dNames = (destination ? titleCase(destination.trim()).split(/\\s+/) : []);\n let dLast, dFirst;\n // if (dNames.length < 2) {\n // reactData.errorText[3] = `Please enter the full name of the person you are visiting`;\n // }\n // else {\n dLast = dNames.pop();\n dFirst = dNames.join(' ');\n // }\n let gPhone = Number(contactNumber.replace(/\\D/g, ''));\n if (gPhone < 1000000000) {\n reactData.errorText[1] = `Please enter your area code and phone number`;\n }\n let residentRec = {};\n if (reactData.errorText.length === 0) {\n residentRec = await getPersonByWords(state.session.client_id, destination.trim().split(/\\s+/));\n switch (residentRec.length) {\n case 0: {\n if (reactData.add_try_number === 1) {\n reactData.errorText[3] = `We don't find anyone to match \"${destination}\". Please confirm this is correct.`;\n }\n else {\n residentRec = [{ name: { first: (dFirst || ''), last: (dLast || destination) } }];\n }\n break;\n }\n case 1: {\n break;\n }\n default: {\n if (reactData.add_try_number === 1) {\n reactData.errorText[3] = `There are ${residentRec.length} matches for \"${destination}\". Please be more specific if you can, and confirm the name.`;\n }\n break;\n }\n }\n }\n if (reactData.errorText.length === 0) {\n let addedPerson = {};\n let newPersonRec = {\n name: {\n first: gFirst,\n last: gLast\n },\n sms: `+1${gPhone}`,\n client_id: state.session.client_id\n };\n if (vendorCompany) {\n newPersonRec.location = `Vendor - ${vendorCompany}`;\n addedPerson = await addVendor(newPersonRec);\n }\n else {\n newPersonRec.location = 'Guest';\n addedPerson = await addGuest(newPersonRec);\n }\n if (addedPerson.result !== 'success') {\n reactData.errorText[0] = `Something went wrong. Please see the Receptionist. Error: ${addedPerson.message}`;\n }\n else {\n let now = makeDate(new Date());\n let hNote = `Checked in on ${now.absolute}`;\n hNote += ` Visiting ${residentRec[0].name.first} ${residentRec[0].name.last}${residentRec[0].location ? ' at ' + residentRec[0].location : ''}`;\n await putServiceRequest(\n {\n client_id: state.session.client_id,\n request_id: `${addedPerson.personRec.person_id}_checkout`,\n requestor: addedPerson.personRec.person_id,\n on_behalf_of: `${residentRec[0].name.first} ${residentRec[0].name.last}`,\n request_type: 'checkout',\n request_date: now.timestamp,\n original_request: (vendorCompany ? { \"vendor_company\": [vendorCompany] } : {}),\n history: [hNote],\n local_key: `${addedPerson.personRec.person_id}_checkout`,\n foreign_key: (vendorCompany ? 'vendor' : 'guest'),\n last_update: now.timestamp,\n last_status: 'in'\n }\n );\n enqueueSnackbar(`You're all set, ${gFirst}! Have a great visit!`, { variant: 'success', persist: false });\n reactData.validated_user = false;\n reactData.add_guest_mode = false;\n reset();\n }\n }\n else {\n reactData.add_try_number++;\n }\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }} /* end of onSave */\n allowCancel={true}\n options={{\n bgColor: AVADefaults({ client_style: 'get' }) ? AVADefaults({ client_style: 'get' }).promptBackgroundColor : null\n }}\n />\n }\n \n }\n {/* *** ADMIN (REPORTING) VIEW *** */\n reactData.adminView &&\n \n { /* **********************************\n Reporting all data\n ********************************** */\n (!reactData.adminOverride ?\n \n \n \n {`Check-in/out status`}\n \n \n {`as of ${makeDate(new Date()).absolute}`}\n \n \n \n \n {'Residents currently checked-out'}\n {(reactData.outList.length === 0) &&\n \n No residents currently checked out\n \n }\n {(reactData.outList.length > 0)\n && reactData.outList.map((outRow, outNdx) => (\n {\n reactData.adminOverride = true;\n reactData.resident_mode = true;\n reactData.adminIndex = outNdx;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n \n \n {outRow.name}\n {outRow.message}\n \n \n )\n )}\n \n \n \n {'Guests still checked-in'}\n \n {(reactData.guestList.length === 0) &&\n \n No guests currently checked in\n \n }\n {(reactData.guestList.length > 0) && reactData.guestList.map((inRow, inNdx) => (\n {\n reactData.adminOverride = true;\n reactData.guest_mode = true;\n reactData.adminIndex = inNdx;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n \n {inRow.name}\n {inRow.message}\n \n \n )\n )}\n \n \n \n {'Vendors still checked-in'}\n \n {(reactData.vendorList.length === 0) &&\n \n No vendors currently checked in\n \n }\n {(reactData.vendorList.length > 0) && reactData.vendorList.map((inRow, inNdx) => (\n {\n reactData.adminOverride = true;\n reactData.vendor_mode = true;\n reactData.adminIndex = inNdx;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n \n {inRow.name}\n {inRow.reqRec && inRow.reqRec.original_request && inRow.reqRec.original_request.vendor_company\n && Array.isArray(inRow.reqRec.original_request.vendor_company)\n &&\n {inRow.reqRec.original_request.vendor_company[0]}\n }\n {inRow.message}\n \n \n )\n )}\n \n \n \n {\n reset();\n }}\n >\n Back\n \n \n \n :\n \n {reactData.resident_mode &&\n {\n reactData.adminOverride = false;\n reactData.resident_mode = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onConfirm={async () => {\n let reqRec = reactData.outList[reactData.adminIndex].reqRec;\n let now = makeDate(new Date());\n reqRec.last_status = 'in';\n reqRec.last_update = now.timestamp;\n let myName = await makeName(state.session.user_id);\n let hNote = `Checked in by ${myName} on ${now.absolute}`;\n reqRec.history.unshift(hNote);\n await putCheckout(reqRec, { proxy: true });\n enqueueSnackbar(`Check-in completed!`, { variant: 'success', persist: false });\n reactData.adminOverride = false;\n reactData.resident_mode = false;\n reactData.outList.splice(reactData.adminIndex, 1);\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n allowCancel={true}\n />\n }\n {reactData.vendor_mode &&\n {\n reactData.adminOverride = false;\n reactData.vendor_mode = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onConfirm={async () => {\n let reqRec = reactData.vendorList[reactData.adminIndex].reqRec;\n let now = makeDate(new Date());\n reqRec.last_status = 'out';\n reqRec.last_update = now.timestamp;\n let myName = await makeName(state.session.user_id);\n let hNote = `Checked out by ${myName} on ${now.absolute}`;\n reqRec.history.unshift(hNote);\n await putCheckout(reqRec, { proxy: true });\n enqueueSnackbar(`Check-out is complete!`, { variant: 'success', persist: false });\n reactData.adminOverride = false;\n reactData.vendor_mode = false;\n reactData.vendorList.splice(reactData.adminIndex, 1);\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n allowCancel={true}\n />\n }\n {reactData.guest_mode &&\n {\n reactData.adminOverride = false;\n reactData.guest_mode = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onConfirm={async () => {\n let reqRec = reactData.guestList[reactData.adminIndex].reqRec;\n let now = makeDate(new Date());\n reqRec.last_status = 'out';\n reqRec.last_update = now.timestamp;\n let myName = await makeName(state.session.user_id);\n let hNote = `Checked out by ${myName} on ${now.absolute}`;\n reqRec.history.unshift(hNote);\n await putCheckout(reqRec, { proxy: true });\n enqueueSnackbar(`Check-out is complete!`, { variant: 'success', persist: false });\n reactData.adminOverride = false;\n reactData.guest_mode = false;\n reactData.guestList.splice(reactData.adminIndex, 1);\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n allowCancel={true}\n />\n }\n )\n \n )\n }\n \n }\n \n );\n};","import { clt, cl, s3, titleCase, uuid, parseNumeric, getCustomizations, deepCopy } from './AVAUtilities';\nimport { resolveMessageVariables } from './AVAMessages';\nimport { makeName } from './AVAPeople';\nimport { getServiceRequests, formatServiceRequest } from './AVAServiceRequest';\nimport { makeDate } from './AVADateTime';\n\nimport { jsPDF } from \"jspdf\";\n\nlet page = {};\nlet pdfCurrent = {};\nlet doc;\nlet htmlMessage = '';\nlet rawMessage = '';\nlet customizations = {};\n\n// Functions\n\nexport async function makeSRPrint(inboundRequest) {\n let requestList = [];\n if (Array.isArray(inboundRequest)) {\n requestList.push(...inboundRequest);\n }\n else {\n requestList = [inboundRequest];\n }\n\n // input will be a list of SR's to be printed\n // each element MUST contain a service request, a reference to a service request, OR a set of printing instructions\n /*\n We'll return an array with one element for each passed in SR or referenced SR\n (NOTE: if inboundRequest references multiple SRs, as in \"all foreign_key = date, request_type = dinner_order\", list will expand accordingly)\n output_format as follows\n {\n : {\n type: pdf, html, data\n output: \n sharedDoc_id: if multiPrint, this key is the same for all SRs in the output document\n }\n }\n */\n let sharedDoc_id;\n let final_result = [];\n\n for (let rN = 0; rN < requestList.length; rN++) {\n let request_body = requestList[rN];\n if (request_body.hasOwnProperty('body')) { // keys in \"body\" are promoted to the object itself\n Object.assign(request_body, request_body.body);\n delete request_body.body;\n }\n\n let returnedRequests = await formatServiceRequest(request_body);\n let this_request;\n if (returnedRequests.length === 0) {\n return { error: true };\n }\n else if (returnedRequests.length === 1) {\n this_request = deepCopy(returnedRequests[0]);\n }\n else {\n requestList.splice(rN, 1, ...returnedRequests);\n this_request = deepCopy(returnedRequests[0]);\n }\n\n if ((!this_request) || this_request.error) {\n return { error: true };\n }\n\n // Prep the PDF output\n /*\n pass request_body.multiPrint{} to control:\n stand-alone - omit multiPrint\n first page / start new PDF - multiPrint.firstDoc === true\n last page / close this PDF at end - multiPrint.lastDoc === true\n so... multiPrint.firstDoc === false adds a page to an existing PDF\n ...and multiPrint.lastDoc === false leaves the PDF open on exit\n */\n\n if (!request_body.margin) {\n request_body.margin = {};\n }\n\n let client_customizations = await getCustomizations('*all', this_request.client_id);\n let AVA_customizations = await getCustomizations('*all', 'AVA');\n customizations = Object.assign({}, AVA_customizations, client_customizations);\n\n let output_format = {}; // one or more output formats as called for in the this_request.print?.format array\n\n if (!this_request.print?.format) {\n return { 'error': true };\n };\n\n if (request_body.multiPrint && request_body.multiPrint.firstDoc) {\n sharedDoc_id = uuid(10); // this is one document of multiple documents in the output\n }\n\n for (let f = 0; f < this_request.print?.format.length; f++) {\n let this_format = this_request.print?.format[f];\n\n output_format[this_format] = {\n type: customizations?.print_format?.[this_format].format || 'pdf',\n sharedDoc_id\n };\n\n // Header & Title\n await pdfLaunch(Object.assign({}, request_body, this_request, { client_id: this_request.client_id }));\n if (customizations?.print_format?.[this_format].show_obo === 'as_title') {\n page.title = this_request.print?.data?.onBehalfOf_name;\n }\n if (customizations?.print_format?.[this_format].suppress_header) {\n pdfLine(' ', { align: 'center', image: pdfCurrent.logo });\n pdfLine(page.title, { style: 'bold', size: 'large', align: 'center', after: 1 });\n }\n else {\n pdfHeader();\n }\n htmlMessage += `

    ${page.title}

    `;\n htmlMessage += `

    `;\n rawMessage += `${page.title}\\n\\r`;\n\n let suppress_obo = false;\n // does the title contain all of the words in the obo?\n if (customizations?.print_format?.[this_format].show_obo === 'when_unique') {\n let tLower = page.title.toLowerCase();\n let oboWords = this_request.print.data.onBehalfOf_name.toLowerCase().split(/\\s+/);\n suppress_obo = oboWords.every(oboWord => {\n return (tLower.includes(oboWord));\n });\n }\n else if (customizations?.print_format?.[this_format].show_obo !== 'always') {\n suppress_obo = true;\n }\n if (!suppress_obo) {\n htmlMessage += this_request.print.data.onBehalfOf_name;\n rawMessage += `${this_request.print.data.onBehalfOf_name}\\n`;\n pdfLine(`for ${this_request.print.data.onBehalfOf_name}`, { style: 'normal', align: 'center', size: 'medium' });\n }\n\n if (customizations?.print_format?.[this_format].show_location && this_request.print.data.request_person_rec.location) {\n let locNum = parseNumeric(this_request.print.data.request_person_rec.location);\n if (locNum.hasNumbers) {\n this_request.print.data.request_person_rec.location = `Apt ${locNum.value}`;\n }\n htmlMessage += `
    ${this_request.print.data.request_person_rec.location}`;\n rawMessage += `${this_request.print.data.request_person_rec.location}\\n`;\n pdfLine(this_request.print.data.request_person_rec.location, { size: 'small', align: 'center' });\n }\n\n htmlMessage += `

    `;\n\n if (customizations?.print_format?.[this_format].show_created) {\n let pDateTime = this_request.print.data.created_time.absolute;\n if (this_request.print.data.creator_id !== this_request.print.data.request_person_id) {\n pDateTime += ` by ${this_request.print.data.creator_name}`;\n }\n htmlMessage += `created: ${pDateTime}`;\n rawMessage += `${pDateTime}\\n\\r`;\n pdfLine(`created: ${pDateTime}`, { size: 'small', align: 'center' });\n }\n\n if (customizations?.print_format?.[this_format].show_contact_info) {\n for (let cTyp in this_request.print.data.request_person_rec.messaging) {\n if ((cTyp in this_request.print.data.request_person_rec) && (this_request.print.data.request_person_rec[cTyp].trim() !== '')) {\n let cLab;\n switch (cTyp) {\n case 'sms': { cLab = 'cell'; break; }\n case 'voice': { cLab = 'home'; break; }\n case 'email': { cLab = 'e-Mail'; break; }\n default: { cLab = cTyp; }\n }\n htmlMessage += `
    ${cLab}: ${this_request.print.data.request_person_rec[cTyp]}`;\n rawMessage += `${cLab}: ${this_request.print.data.request_person_rec[cTyp]}\\n\\r`;\n pdfLine(`${this_request.print.data.request_person_rec[cTyp]}`, { size: 'small', align: 'center' });\n }\n }\n }\n pdfDown(2);\n\n htmlMessage += '

    ** AVA **

    ';\n rawMessage += '\\n\\r** AVA **\\n\\r';\n\n // Request Detail section\n let requestDetails = deepCopy(this_request.print.data.requestDetails);\n\n // Pre-Detail - show info that needs special attention\n if (customizations?.print_format?.[this_format].selections_to_promote\n && (customizations?.print_format?.[this_format].selections_to_promote.length > 0)) {\n\n for (const [this_selection, optionList] of Object.entries(requestDetails)) {\n if (customizations?.print_format?.[this_format].selections_to_promote.includes(this_selection)) {\n if (!optionList || (optionList.length === 0)) {\n htmlMessage += `

    ${this_selection}

    `;\n rawMessage += `${this_selection}\\r\\n`;\n pdfLine(this_selection);\n }\n else {\n for (let o = 0; o < optionList.length; o++) {\n htmlMessage += `

    ${optionList[o]}

    `;\n rawMessage += `${optionList[o]}\\r\\n`;\n pdfLine(optionList[o]);\n };\n }\n delete requestDetails[this_selection];\n }\n }\n }\n\n let renderCheckBox = '';\n if (customizations?.print_format?.[this_format].show_checkbox) {\n renderCheckBox = '⃞ ';\n }\n\n if (customizations?.print_format?.[this_format].detail_section_header\n && (Object.keys(requestDetails).length > 0)) {\n htmlMessage += `

    Options Selected

    `;\n rawMessage += `Options Selected\\r\\n`;\n pdfLine('Options Selected', { style: 'bold', before: 1, align: 'left' });\n }\n\n htmlMessage += `
    `;\n pdfStyle('reset');\n let lineSpacing = '0px';\n\n // ********* DETAIL LINES **********\n for (const [this_selection, optionList] of Object.entries(requestDetails)) {\n htmlMessage += `
    ${renderCheckBox}   ${this_selection}
    `;\n rawMessage += `\\n${this_selection}\\n`;\n pdfStyle('reset');\n pdfLine(this_selection, { before: 1 });\n if (optionList) {\n for (let o = 0; o < optionList.length; o++) {\n htmlMessage += `
    ${optionList[o]}
    `;\n rawMessage += `${optionList[o]}\\n`;\n pdfLine(`${optionList[o]}`, { noNewLine: true, before: 1, indent: 15, size: 'small' });\n };\n }\n };\n\n pdfStyle('reset');\n rawMessage += `\\n\\n`;\n htmlMessage += `
    `;\n\n if (customizations?.print_format?.[this_format].initials_message) {\n pdfLine(`${customizations?.print_format?.[this_format].initials_message}: ________________________`, { before: 4, after: 1 });\n htmlMessage += `

    ${customizations?.print_format?.[this_format].initials_message}: _______________________

    `;\n rawMessage += `\\n\\n${customizations?.print_format?.[this_format].initials_message}: ________________________\\n\\n`;\n }\n\n // Finish\n if (!request_body.multiPrint || request_body.multiPrint.lastDoc) {\n let refText = `AVA reference: ${this_request.print.data.client_id}/${this_request.print.data.request_id} (${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()})`;\n pdfLine(refText, { noNewPage: true, yPos: 'footer', align: 'center' });\n pdfLine(`***** END *****`, { noNewPage: true, noNewLine: true, before: 1 });\n htmlMessage += `

    ${refText}
    ***** END *****

    `;\n rawMessage += `\\n\\r${refText}\\n***** END *****`;\n }\n } // done with all formats of this SR\n\n for (const [format_code, outObj] of Object.entries(output_format)) { // for each format, load the final document\n switch (outObj.type) {\n case 'text': {\n output_format[format_code].output = rawMessage;\n break;\n }\n case 'html': {\n output_format[format_code].output = htmlMessage;\n break;\n }\n default: {\n output_format[format_code].output = doc.output('blob');\n }\n }\n }\n\n if (request_body.multiPrint && request_body.multiPrint.lastDoc) {\n for (let x = 0; x < final_result.length; x++) {\n let doc = final_result[x];\n for (const [format_code, outObj] of Object.entries(doc)) { // for each format, load the final document\n if (outObj.sharedDoc_id === sharedDoc_id) {\n switch (outObj.type) {\n case 'text': {\n final_result[x][format_code].output = rawMessage;\n break;\n }\n case 'html': {\n final_result[x][format_code].output = htmlMessage;\n break;\n }\n default: {\n final_result[x][format_code].output = doc.output('blob');\n }\n }\n }\n }\n }\n }\n final_result.push(output_format);\n }\n return final_result;\n}\n\nexport async function printRawData(dataRows, state) {\n // Header & Title\n await pdfLaunch({ client_id: state.session.client_id });\n page.title = 'Activity Listing';\n pdfHeader();\n dataRows.forEach((this_item, index) => {\n pdfDown(3);\n pdfStyle('reset');\n if (pdfCurrent.yPos > (page.bottom - (1.5 * page.margin.bottom))) {\n pdfCurrent.pageNumber++;\n pdfHeader();\n }\n pdfLine(this_item.workData.formatted_type, { size: 'large', style: 'bold' });\n pdfLine(this_item.workData.requestor_name, { size: 'large', style: 'normal' });\n let line;\n if (this_item?.current_request?.textInput['Room Number']) {\n line = this_item?.current_request?.textInput['Room Number'];\n }\n else if (this_item?.original_request?.textInput['Room Number']) {\n line = this_item?.original_request?.textInput['Room Number'];\n }\n else if (this_item.workData.requestor_location) {\n line = this_item.workData.requestor_location;\n }\n if (line) {\n pdfLine(line, { size: 'large', style: 'normal' });\n }\n pdfStyle({ size: 'small' });\n if (this_item.workData.updated) {\n pdfLine(this_item.workData.updated, { });\n }\n if (this_item.requestor !== this_item.workData.enteredBy) {\n pdfLine(`By ${this_item.workData.enteredBy_name}`);\n }\n pdfLine(this_item.workData.display_date);\n if (this_item.workData.summary_request) {\n this_item.workData.summary_request.forEach((mLine, mIndex) => {\n if (typeof mLine[1] === 'string') {\n if (mLine[0] === 'head') {\n pdfLine(`Status: ${mLine[1]}`, { size: 'small', before: 0, indent: 0 });\n }\n else if (mLine[0] === 'qual') {\n pdfLine(mLine[1], { size: 'small', before: 0, indent: 10 });\n }\n else {\n pdfLine(mLine[1], { size: 'medium', before: 0.5, indent: 0 });\n }\n }\n });\n }\n if (this_item.workData.notes_section) {\n this_item.workData.notes_section.forEach((mLine, mIndex) => {\n if (typeof mLine[1] === 'string') {\n if (mLine[0] === 'head') {\n pdfLine(mLine[1], { size: 'medium', before: 0.5, indent: 0 });\n }\n else {\n pdfLine(mLine[1], { size: 'small', before: 0, indent: 10 });\n }\n }\n });\n }\n if (this_item.workData.formatted_request) {\n this_item.workData.formatted_request.forEach((mLine, mIndex) => {\n if (typeof mLine[1] === 'string') {\n if (mLine[0] === 'head') {\n pdfLine(mLine[1], { size: 'medium', before: 0.5, indent: 0 });\n }\n else {\n pdfLine(mLine[1], { size: 'small', before: 0, indent: 10 });\n }\n }\n });\n }\n if (this_item.workData.messageRecs) {\n this_item.workData.messageRecs.forEach((mLine, dX) => {\n if (mLine[0] === 'head') {\n pdfLine(mLine[1], { size: 'medium', before: 0.5, indent: 0 });\n }\n else {\n pdfLine(mLine[1], { size: 'small', before: 0, indent: 10 });\n }\n });\n }\n });\n let pdfInfo = {\n PDF: true, fileName: 'report_PDF', request_type: \"force_print\",\n s3Bucket: 'theseus-medical-storage',\n s3Key: `${state.session.client_id}_AVA_Report.pdf`,\n };\n let pdfResp = await savePDFBlob(doc.output('blob'), pdfInfo, { local: false, S3: true, onSave: 'print' });\n if (pdfResp.responseData.s3Resp) {\n pdfInfo.s3Location = pdfResp.responseData.s3Resp.Location;\n }\n}\n\nexport async function savePDFBlob(pdfBlob, pdfInfo, options = {}) {\n let s3Resp;\n let responseStatus = 400;\n let responseData = { message: [] };\n if (options.S3) {\n let goodS3 = true;\n s3Resp = await s3\n .upload({\n Bucket: pdfInfo.s3Bucket,\n Key: pdfInfo.s3Key,\n Body: pdfBlob,\n ACL: 'public-read-write',\n ContentType: 'application/pdf'\n })\n .promise()\n .catch(err => {\n cl(`PDF not saved by AVA. The reason is ${err.message}`);\n goodS3 = false;\n responseStatus = 401;\n responseData.message = err.message;\n });\n if (goodS3 && options.onSave === 'print') {\n window.open(s3Resp.Location);\n responseStatus = 200;\n responseData.message.push(`S3 saved at ${s3Resp.Location}`);\n responseData.s3Resp = s3Resp;\n }\n }\n return {\n responseStatus,\n responseData\n };\n\n}\n\nexport async function mealTicketFormat(body, requestRec = {}) {\n\n // *********** GET ALL REQ THAT MATCH LOCAL_KEY IN THE BODY *********** //\n let seat_key = body.tableNumberKey || 'Seat Assignment';\n if (!body.local_key) {\n let keyRequest = await getServiceRequests({\n request_id: body.request_id,\n client_id: body.client || body.client_id\n });\n if (keyRequest.length === 0) { return null; }\n body.local_key = keyRequest[0].local_key;\n }\n let requestList = await getServiceRequests({\n local_key: body.local_key,\n client_id: body.client || body.client_id\n });\n if (requestList.length === 0) {\n if (Object.keys(requestRec).length > 0) {\n requestList.push(requestRec);\n }\n else {\n return null;\n }\n }\n // Sort the requests\n requestList.sort((a, b) => {\n let aSort, bSort;\n if (a.original_request.textInput && a.original_request.textInput[seat_key]) {\n aSort = a.original_request.textInput[seat_key];\n }\n if (b.original_request.textInput && b.original_request.textInput[seat_key]) {\n bSort = b.original_request.textInput[seat_key];\n }\n return ((aSort < bSort) ? -1 : 1);\n });\n\n // Prep the PDF output\n let htmlText = [];\n let plainText = [];\n if (!body.margin) { body.margin = {}; }\n let page = {\n width: body.pageWidth || 175,\n border: body.border || true,\n font: {\n family: 'Helvetica',\n size: { large: 14, medium: 12, small: 10, tiny: 8 }\n },\n layout: body.orientation || 'portrait',\n info: { author: 'AVA Senior Living', title: 'Meal Ticket' },\n margin: {\n top: body.margin.top || 84,\n bottom: body.margin.bottom || 14,\n left: body.margin.left || 4,\n right: body.margin.right || 4\n }\n };\n page.printableArea = page.width - page.margin.left - page.margin.right;\n let yPos = page.margin.top;\n let style = `\"padding-top: ${page.margin.top}px; padding-bottom: ${page.margin.bottom}px; width: ${page.width}px; font-family: ${page.font.family}; ${page.border ? 'border: 2px solid black;' : ''} color: black; padding-left: ${page.margin.left}px; padding-right: ${page.margin.right}px\"`;\n const doc = new jsPDF({\n orientation: \"portrait\",\n unit: \"px\",\n format: [page.width, page.width * 3]\n });\n\n htmlText.push(``);\n\n // ********** LOGO ********** //\n if (body.logo) {\n htmlText.push(`
    `);\n let logo_dimensions = [150, 100];\n if (body.logo_dimensions) {\n logo_dimensions = body.logo_dimensions;\n }\n htmlText.push(``);\n htmlText.push(`
    `);\n }\n\n htmlText.push(`

    `);\n\n // ********** TITLE ********** //\n let titleWords = body.subject || body?.format?.subject || body.activityName || 'Meal Ticket';\n titleWords = await resolveMessageVariables(titleWords, body);\n if (body.reprint) { titleWords = '*** REPRINT ' + titleWords + ' ***'; };\n style = `\"text-align:center; font-size: ${page.font.size.large};\"`;\n let outTitle = titleCase(titleWords);\n pdfLineMealTicket(outTitle, page.font.size.large, 'normal', 0, 0, 0, { align: 'center' });\n htmlText.push(`

    ${outTitle}
    `);\n plainText.push(outTitle);\n if (body.client_name) {\n let outClientName = titleCase(body.client_name);\n pdfLineMealTicket(outClientName, page.font.size.large, 'normal', 0, 0, 0, { align: 'center' });\n htmlText.push(`
    ${outClientName}
    `);\n plainText.push(outClientName);\n }\n\n htmlText.push(`
    `);\n plainText.push(' ');\n\n // ********** HEADER ********** //\n // Pick-off the first request for Header info for the ticket\n let this_request = requestList[0];\n let [author_id, order_timestamp] = this_request.request_id.split('~');\n let author_name = await makeName(author_id);\n let table_key = body.tableNumberKey || 'Table Number';\n style = `\"text-align:center; font-size: ${page.font.size.small};\"`;\n let outAuthor = titleCase(author_name);\n pdfLineMealTicket(`Created by: ${outAuthor}`, page.font.size.small, 'normal', 0, -0.2, 0, { align: 'center' });\n htmlText.push(`
    Created by: ${outAuthor}
    `);\n plainText.push(outAuthor);\n let outTime = makeDate(order_timestamp).absolute;\n pdfLineMealTicket(`${outTime}`, page.font.size.small, 'normal', 0, 0, 0, { align: 'center' });\n htmlText.push(`
    ${outTime}
    `);\n plainText.push(outTime);\n if (this_request.original_request.textInput && this_request.original_request.textInput[table_key]) {\n pdfLineMealTicket(`Table: ${this_request.original_request.textInput[table_key]}`, page.font.size.small, 'bold', 0, 0, 0, { align: 'center' });\n htmlText.push(`
    Table: ${this_request.original_request.textInput[table_key]}
    `);\n plainText.push(`Table: ${this_request.original_request.textInput[table_key]}`);\n }\n\n htmlText.push(`

    `);\n\n // ********** ORDERS ********** //\n for (let r = 0; r < requestList.length; r++) {\n let this_request = requestList[r];\n let requestor = this_request.on_behalf_of;\n if (!requestor) { requestor = await makeName(this_request.requestor); }\n htmlText.push(`

    `);\n plainText.push(' ');\n style = `\"font-size: ${page.font.size.medium}; padding-top: 0.5em;\"`;\n let outSeat = '';\n if (this_request.original_request.textInput && this_request.original_request.textInput[seat_key]) {\n outSeat = this_request.original_request.textInput[seat_key] + ' - ';\n }\n let outRequestor = outSeat + titleCase(requestor);\n pdfLineMealTicket(outRequestor, page.font.size.medium, 'bold', 0, 1);\n htmlText.push(`

    ${outRequestor}
    `);\n plainText.push(outRequestor);\n // eslint-disable-next-line\n this_request.original_request.selections.forEach(s => {\n style = `\"font-size: ${page.font.size.medium}; padding-top: 0.5em; padding-left: 0;\"`;\n let [selection, ...options] = s.split(/[();,]/);\n if (this_request.original_request.hasOwnProperty('qualifiers')\n && this_request.original_request.qualifiers.hasOwnProperty(selection.trim())\n ) {\n Object.values(this_request.original_request.qualifiers[selection.trim()]).forEach(choiceList => {\n choiceList.forEach(choice => {\n if (!options.includes(choice)) {\n options.push(choice);\n }\n });\n });\n }\n pdfLineMealTicket(selection, page.font.size.medium, 'normal');\n htmlText.push(`
    ${selection}
    `);\n plainText.push(selection);\n if (options.length > 0) {\n style = `\"font-size: ${page.font.size.medium}; padding-left: 2em;\"`;\n options.forEach((o, i) => {\n let outO = titleCase(o.trim());\n if (outO !== '') {\n pdfLineMealTicket(outO, page.font.size.small, 'normal', 1, (i === 0 ? -0.2 : -0.1), ((i === (options.length - 1)) ? 0.2 : 0));\n htmlText.push(`
    ${outO}
    `);\n plainText.push(outO);\n }\n });\n }\n });\n for (let field in this_request.original_request.textInput) {\n if ((field !== table_key) && (field !== seat_key)) {\n /*\n pdfLineMealTicket(field, page.font.size.medium, 'normal');\n style = `\"font-size: ${page.font.size.medium}; padding-top: 0.5em;\"`;\n htmlText.push(`
    ${field}
    `);\n plainText.push(field);\n */\n let tLine = `>>> ${this_request.original_request.textInput[field]} <<<`;\n // pdfLineMealTicket(tLine, page.font.size.small, 'normal', 1, -0.5);\n pdfLineMealTicket(tLine, page.font.size.medium, 'normal');\n // style = `\"font-size: ${page.font.size.medium}; padding-left: 2em;\"`;\n style = `\"font-size: ${page.font.size.medium}; padding-top: 0.5em;\"`;\n htmlText.push(`
    ${tLine}
    `);\n plainText.push(`--${tLine}`);\n }\n }\n htmlText.push(`

    `);\n }\n\n // ********** INITIALS ********** //\n if (body.initials) {\n pdfLineMealTicket('Initials _________', page.font.size.medium, 'normal', 0, 2, 1);\n htmlText.push(`

    Initials _________

    `);\n plainText.push(' ');\n plainText.push(' ');\n plainText.push('Initials _________');\n }\n\n // ********** FOOTERS ********** //\n pdfLineMealTicket('AVA Senior Living', page.font.size.tiny, 'normal', 0, 2, 0, { align: 'center' });\n pdfLineMealTicket(`ID ${this_request.local_key}`, page.font.size.tiny, 'normal', 0, 0, 0, { align: 'center' });\n pdfLineMealTicket('****** END ******', page.font.size.tiny, 'normal', 0, 0, 4, { align: 'center' });\n htmlText.push(`

    `);\n style = `\"font-size: ${page.font.size.tiny}; text-align:center;\"`;\n htmlText.push(`

    ${this_request.local_key}/${this_request.request_id}
    `);\n htmlText.push(`
    AVA Senior Living
    `);\n htmlText.push(`
    ****** END ******
    `);\n htmlText.push(`

    `);\n plainText.push(' ');\n plainText.push(' ');\n plainText.push(`${this_request.local_key}/${this_request.request_id}`);\n plainText.push(`AVA Senior Living`);\n plainText.push(`****** END ******`);\n\n htmlText.push(``);\n\n doc.rect(page.margin.left - 2, page.margin.top - page.font.size.large - 2, page.width - 4, yPos - page.margin.top);\n\n let pBlob = doc.output('blob');\n let data64 = (doc.output('datauri')).split(';base64,')[1];\n let fileName = `${body.client || body.client_id}_${this_request.local_key}_mealticket.pdf`;\n let s3Resp = await s3\n .upload({\n Bucket: 'theseus-medical-storage',\n Key: fileName,\n Body: pBlob,\n ACL: 'public-read-write',\n ContentType: 'application/pdf'\n })\n .promise()\n .catch(err => {\n cl(`PDF not saved by AVA. The reason is ${err.message}`);\n });\n // await doc.save(fileName, { returnPromise: true });\n s3Resp.data = data64;\n\n return [htmlText.join(''), plainText.join('\\n'), s3Resp];\n\n function pdfLineMealTicket(text, size, style, indent = 0, before, after, options) {\n if (style) { doc.setFont(page.font.family, style); }\n let lastSize = page.font.size.medium;\n if (size) {\n doc.setFontSize(size);\n lastSize = size;\n }\n if (before) { yPos += before * size; }\n let i = 0;\n if (indent) { i = indent * page.font.size.medium; }\n let nextLine;\n if (doc.getTextWidth(text) > page.printableArea) {\n let tWords = text.split(/\\s+/);\n nextLine = tWords.pop();\n text = tWords.join(' ');\n if (doc.getTextWidth(text) > page.printableArea) {\n let t2Words = text.split(/\\s+/);\n nextLine += ' ' + t2Words.pop();\n text = t2Words.join(' ');\n }\n }\n if (options) {\n if (options.align === 'center') { doc.text(text, page.width / 2, yPos, options); }\n else { doc.text(text, page.margin.left + i, yPos, options); }\n }\n else { doc.text(text, page.margin.left + i, yPos); }\n yPos += lastSize;\n if (nextLine) {\n if (options) {\n if (options.align === 'center') { doc.text(nextLine, page.width / 2, yPos, options); }\n else { doc.text(nextLine, page.margin.left + i, yPos, options); }\n }\n else { doc.text(nextLine, page.margin.left + i, yPos); }\n yPos += lastSize;\n }\n if (after) { yPos += (after * size); }\n return;\n }\n}\n\nasync function pdfLaunch(body) {\n if (!body.hasOwnProperty('pdf')) { body.pdf = {}; }\n if (!body.multiPrint || body.multiPrint.firstDoc) {\n doc = new jsPDF({\n orientation: \"portrait\",\n unit: \"px\",\n format: ((body.pdf.pageWidth) ? [body.pdf.pageWidth, (body.pdf.pageHeight || 9999)] : [563, 750])\n });\n }\n else {\n doc.addPage({\n orientation: \"portrait\",\n format: ((body.pdf.pageWidth) ? [body.pdf.pageWidth, (body.pdf.pageHeight || 9999)] : [563, 750])\n });\n }\n doc.autoPrint();\n page = {\n width: doc.internal.pageSize.width,\n height: doc.internal.pageSize.height,\n center: (doc.internal.pageSize.width / 2),\n border: (body.pdf.hasOwnProperty('border')) ? body.pdf.border : true,\n font: {\n family: 'Helvetica',\n size: { large: 20, medium: 16, small: 12, tiny: 8 }\n },\n layout: (body.pdf.hasOwnProperty('orientation')) ? body.pdf.orientation : 'portrait',\n info: { author: 'AVA Senior Living' },\n margin: {\n top: (body.pdf.margin && body.pdf.margin.top) || (doc.internal.pageSize.height / 20),\n bottom: (body.pdf.margin && body.pdf.margin.bottom) || (doc.internal.pageSize.height / 10),\n left: (body.pdf.margin && body.pdf.margin.left) || (doc.internal.pageSize.width / 12),\n right: (body.pdf.margin && body.pdf.margin.right) || (doc.internal.pageSize.width / 12)\n }\n };\n page.bottom = page.height - (2 * page.margin.bottom);\n page.right = page.width - page.margin.right;\n page.centerPoint = page.width / 2;\n page.printableArea = page.width - page.margin.left - page.margin.right;\n page.title = body?.print?.data?.title || page.title;\n page.info.title = page.title;\n clt({ page });\n\n let nowTime = makeDate(new Date());\n pdfCurrent = {\n yPos: page.margin.top,\n xPos: page.margin.left,\n pageNumber: ((body.multiPrint && !body.multiPrint.firstDoc) ? doc.internal.getNumberOfPages() + 1 : 1),\n indent: 0,\n reportTime: nowTime.absolute,\n timestamp: nowTime.numeric24,\n client_name: body?.print?.data?.client_name,\n logo: body?.print?.data?.logo\n };\n\n if (customizations['print']) {\n let print_specs = customizations['print'];\n if (print_specs.size) {\n page.font.size = {\n large: ((print_specs.size <= 5) ? 20 * print_specs.size : print_specs.size),\n medium: ((print_specs.size <= 5) ? 16 * print_specs.size : print_specs.size),\n small: ((print_specs.size <= 5) ? 12 * print_specs.size : print_specs.size),\n tiny: ((print_specs.size <= 5) ? 8 * print_specs.size : print_specs.size),\n };\n }\n }\n if (customizations['logo_dimensions']) {\n pdfCurrent.logo_width = customizations['logo_dimensions'][0] / 2;\n pdfCurrent.logo_height = customizations['logo_dimensions'][1] / 2;\n }\n else {\n pdfCurrent.logo_width = 75;\n pdfCurrent.logo_height = 75;\n }\n pdfStyle('reset');\n}\n\nfunction pdfHeader() {\n clt({ pdfCurrent });\n if (pdfCurrent.pageNumber > 1) {\n doc.addPage({\n orientation: \"portrait\",\n format: ([page.width, page.height])\n });\n }\n let savedStyle = Object.assign({}, pdfCurrent);\n pdfCurrent.yPos = page.margin.top;\n pdfStyle('reset');\n if (pdfCurrent.logo) {\n // removed due to a security (CORS) policy violation\n // let extension = pdfCurrent.logo.split('.').pop().toUpperCase(); \n // doc.addImage(pdfCurrent.logo, extension, page.center - (pdfCurrent.logo_width / 2), pdfCurrent.yPos, pdfCurrent.logo_width, pdfCurrent.logo_height);\n // pdfCurrent.yPos += pdfCurrent.logo_height;\n }\n pdfStyle({ size: 'large', align: 'center', style: 'bold' });\n doc.text(pdfCurrent.client_name || 'AVA', page.center, pdfCurrent.yPos, { align: 'center' });\n pdfStyle({ size: 'large', before: 1.5, style: 'normal' });\n doc.text(page.title || 'Report', page.center, pdfCurrent.yPos, { align: 'center' });\n pdfStyle({ size: 'small', before: 1, style: 'normal' });\n doc.text(pdfCurrent.reportTime, page.center, pdfCurrent.yPos, { align: 'center' });\n if (pdfCurrent.pageNumber > 1) {\n pdfStyle({ size: 'small', before: 1 });\n doc.text(`Page ${pdfCurrent.pageNumber}`, page.center, pdfCurrent.yPos, { align: 'center' });\n pdfDown(4);\n pdfCurrent = Object.assign({}, savedStyle, { yPos: pdfCurrent.yPos });\n pdfStyle(pdfCurrent);\n }\n else {\n pdfStyle('reset');\n pdfDown(1);\n }\n}\n\nfunction pdfLine(text, options = {}) {\n clt({ pdfLine: text, options });\n if (options) {\n pdfStyle(options);\n }\n let remembered_indent = pdfCurrent.indent;\n if (options.hasOwnProperty('before')) {\n delete options.before;\n }\n if (options.yPos && !isNaN(options.yPos)) {\n pdfCurrent.yPos = options.yPos;\n }\n else if (options.yPos && (options.yPos === 'footer')) {\n pdfCurrent.yPos = page.height - page.margin.bottom - 54;\n pdfCurrent.xPos = page.margin.left;\n options.noNewPage = true;\n }\n else if (options.yPos && (options.yPos === 'header')) {\n pdfCurrent.yPos = page.margin.top;\n options.noNewPage = true;\n }\n else if (!options.noNewLine) {\n pdfDown(1);\n }\n if (!options.noNewPage && (pdfCurrent.yPos >= page.bottom)) {\n pdfCurrent.pageNumber++;\n pdfHeader();\n }\n if (options.image) {\n let imageSize = pdfCurrent.fontSize * 5;\n let xOffset;\n switch (pdfCurrent.align) {\n case 'center': {\n xOffset = page.centerPoint - (imageSize / 2);\n doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos, imageSize, imageSize);\n pdfCurrent.xPos = page.centerPoint + (imageSize / 2);\n break;\n }\n case 'right': {\n xOffset = page.width - page.margin.right - imageSize;\n doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos, imageSize, imageSize);\n pdfCurrent.xPos = page.width - page.margin.right;\n break;\n }\n default: {\n xOffset = pdfCurrent.xPos + pdfCurrent.indent;\n doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos, imageSize, imageSize);\n pdfCurrent.xPos = xOffset + imageSize;\n }\n }\n pdfCurrent.yPos += imageSize;\n }\n else {\n // this little chunk deals with text overflow\n {\n let tWords = [];\n if ((pdfCurrent.align === 'center') && (doc.getTextWidth(text) > page.printableArea)) {\n tWords = doc.splitTextToSize(text, page.printableArea);\n }\n else if ((pdfCurrent.align !== 'center') && ((doc.getTextWidth(text) + pdfCurrent.xPos + pdfCurrent.indent + 10) > page.right)) {\n tWords = doc.splitTextToSize(text, (page.right - (pdfCurrent.xPos + pdfCurrent.indent)));\n }\n if (tWords.length > 1) { \n for (let t = 0; t < tWords.length - 1; t++) {\n doc.text(tWords[t], pdfCurrent.xPos + pdfCurrent.indent, pdfCurrent.yPos);\n pdfCurrent.indent = remembered_indent + 10;\n pdfDown(1);\n }\n text = tWords[tWords.length - 1];\n }\n }\n if (pdfCurrent.align === 'center') {\n let xOffset = page.centerPoint - (doc.getTextWidth(text) / 2);\n doc.text(text, xOffset, pdfCurrent.yPos);\n pdfCurrent.xPos = page.centerPoint + (doc.getTextWidth(text) / 2) + pdfCurrent.fontSize;\n }\n else if (pdfCurrent.align === 'right') {\n doc.text(text, page.width - page.margin.right, pdfCurrent.yPos, { align: 'right' });\n pdfCurrent.xPos = page.margin.right;\n }\n else if (pdfCurrent.noNewLine) {\n doc.text(text, pdfCurrent.xPos + pdfCurrent.indent, pdfCurrent.yPos);\n pdfCurrent.xPos += doc.getTextWidth(text) + pdfCurrent.fontSize;\n }\n else {\n doc.text(text, pdfCurrent.xPos + pdfCurrent.indent, pdfCurrent.yPos);\n pdfCurrent.xPos = (pdfCurrent.xPos + pdfCurrent.indent) + doc.getTextWidth(text) + pdfCurrent.fontSize;\n }\n }\n if (options.after) {\n pdfDown(options.after);\n }\n if (remembered_indent) {\n pdfCurrent.indent = remembered_indent;\n }\n return;\n}\n\nfunction pdfDown(n = 1) {\n pdfCurrent.yPos += ((isNaN(n) ? 1 : n) * (pdfCurrent.fontSize * 0.75));\n pdfCurrent.xPos = page.margin.left;\n}\n\nfunction pdfStyle(options = {}) {\n if (options === 'reset') {\n pdfCurrent.style = 'normal';\n doc.setFont(page.font.family, 'normal');\n pdfCurrent.fontSize = page.font.size['medium'];\n doc.setFontSize(pdfCurrent.fontSize);\n pdfCurrent.indent = 0;\n pdfCurrent.align = '';\n }\n else {\n if (options.style) {\n pdfCurrent.style = options.style;\n doc.setFont(page.font.family, options.style);\n }\n if (options.size) {\n if (isNaN(options.size)) {\n if (page.font.size.hasOwnProperty(options.size)) {\n pdfCurrent.fontSize = page.font.size[options.size];\n }\n }\n else { pdfCurrent.fontSize = options.size; }\n doc.setFontSize(pdfCurrent.fontSize);\n }\n if (options.fontSize) {\n pdfCurrent.fontSize = options.fontSize;\n doc.setFontSize(pdfCurrent.fontSize);\n }\n if (options.hasOwnProperty('indent')) { // different because when options.indent === 0, options.indent is false\n pdfCurrent.indent = options.indent;\n }\n if (options.align) {\n pdfCurrent.align = options.align;\n }\n if (options.before) {\n pdfDown(options.before);\n }\n }\n}\n","import React from 'react';\nimport { useSnackbar } from 'notistack';\nimport { makeDate, makeTime } from '../../util/AVADateTime';\nimport { getSlotList, writeSlot, makeSlotName, myAvailability, printOccurrenceSheet } from '../../util/AVACalendars';\nimport { getMemberList } from '../../util/AVAGroups';\nimport { cl, makeArray, dbClient, isEmpty, deepCopy, titleCase, isMobile, recordExists } from '../../util/AVAUtilities';\nimport { makeName, getImage, getPerson } from '../../util/AVAPeople';\nimport { sendMessages } from '../../util/AVAMessages';\nimport { putServiceRequest } from '../../util/AVAServiceRequest';\nimport MakeMessage from './MakeMessage';\nimport FormFillB from './FormFillB';\n\nimport { useGeolocated } from \"react-geolocated\";\nimport { SearchPlaceIndexForPositionCommand, LocationClient } from '@aws-sdk/client-location';\nimport { withAPIKey } from '@aws/amazon-location-utilities-auth-helper';\n\nimport List from '@material-ui/core/List';\nimport Button from '@material-ui/core/Button';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport AlarmAddIcon from '@material-ui/icons/AlarmAdd';\nimport TimerOffIcon from '@material-ui/icons/TimerOff';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\n\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport PrintIcon from '@material-ui/icons/Print';\nimport StorageOutlined from '@material-ui/icons/StorageOutlined';\nimport SendIcon from '@material-ui/icons/Send';\nimport AssignmentTurnedInIcon from '@material-ui/icons/AssignmentTurnedIn';\nimport RestoreIcon from '@material-ui/icons/Restore';\nimport PersonAddIcon from '@material-ui/icons/PersonAdd';\nimport PersonAddDisabledIcon from '@material-ui/icons/PersonAddDisabled';\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport EditIcon from '@material-ui/icons/Edit';\nimport SaveIcon from '@material-ui/icons/Save';\nimport IconButton from '@material-ui/core/IconButton';\nimport RadioButtonCheckedIcon from '@material-ui/icons/RadioButtonChecked';\nimport RadioButtonUncheckedIcon from '@material-ui/icons/RadioButtonUnchecked';\n\nimport PersonFilter from '../forms/PersonFilter';\nimport AVATextInput from '../forms/AVATextInput';\nimport AVAConfirm from '../forms/AVAConfirm';\nimport useSession from '../../hooks/useSession';\n\nimport Menu from '@material-ui/core/Menu';\nimport MenuList from '@material-ui/core/MenuList';\nimport MenuItem from '@material-ui/core/MenuItem';\n\nimport TextField from '@material-ui/core/TextField';\n\nimport { AVAclasses, AVATextStyle, AVADefaults } from '../../util/AVAStyles';\nimport { getServiceRequests } from '../../util/AVAServiceRequest';\n\nconst useStyles = makeStyles(theme => ({\n page: {\n // minHeight: '950px',\n width: '100%'\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n freeInput: {\n marginLeft: '25px',\n marginRight: 2,\n marginBottom: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: theme.spacing(1),\n width: '60%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n },\n title: {\n marginTop: theme.spacing(2),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(2),\n fontSize: '1.3rem',\n },\n AVAButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n },\n idText: {\n display: 'inline',\n marginTop: -5,\n marginRight: theme.spacing(1),\n },\n idTextNoSpacing: {\n display: 'inline',\n },\n inputRule: {\n display: 'inline',\n fontSize: theme.typography.fontSize * 1,\n padding: 0,\n margin: 0,\n },\n listItem: {\n justifyContent: 'space-between',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n listItemLeft: {\n justifyContent: 'space-between',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n marginLeft: 0,\n paddingLeft: theme.spacing(2),\n },\n listItemNarrow: {\n justifyContent: 'space-between',\n marginTop: '-15px',\n marginBottom: '-15px'\n },\n preferenceLine: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n popUpMenu: {\n marginRight: theme.spacing(3),\n paddingRight: 2,\n },\n clientPopUp: {\n borderRadius: '30px 30px 30px 30px',\n margin: '10px'\n },\n clientPopUpWithPadding: {\n borderRadius: '30px 30px 30px 30px',\n padding: '10px'\n },\n messageArea: {\n alignItems: 'center',\n justifyContent: 'space-between',\n marginTop: theme.spacing(0.5),\n marginBottom: theme.spacing(0),\n marginLeft: theme.spacing(0.5),\n marginRight: theme.spacing(0.5),\n },\n popUpMenuRow: {\n marginLeft: theme.spacing(1),\n fontSize: theme.typography.fontSize * 1.0,\n },\n popUpFooter: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n standardIndent: {\n marginLeft: theme.spacing(1),\n variant: 'body1',\n marginRight: theme.spacing(1),\n paddingRight: theme.spacing(2),\n width: '100%'\n },\n standard: {\n variant: 'body1',\n marginRight: theme.spacing(1),\n paddingRight: theme.spacing(1),\n width: '100%'\n },\n lastName: {\n fontWeight: 'bold',\n }\n}));\n\nexport default ({ pEventCode, pEvent, peopleList, pPatient, pSignUps, pViewOnly = false, pClient, pOccData, defaultValues, onReset, pMode }) => {\n\n const { state } = useSession();\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const [eventSlotList, setEventSlotList] = React.useState([]);\n\n const [selectNewSlotOwner, setSelectNewSlotOwner] = React.useState(false);\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n\n const [editSlot, setEditSlot] = React.useState();\n\n const [editNoteNumber, setEditNoteNumber] = React.useState(-1);\n const [newNote, setNewNote] = React.useState('');\n\n const { enqueueSnackbar } = useSnackbar();\n\n const isEventOwner = pOccData?.owner?.includes(pPatient)\n || ['master', 'support'].includes(state.patient.account_class);\n\n const [loading, setLoading] = React.useState(true);\n\n const isWaitListed = (pPatient) => {\n return reactData.waitList.includes(pPatient);\n };\n\n const [ownerOfSlots, setOwnerOfSlots] = React.useState(false);\n const [firstAvailableSlot, setFirstAvailableSlot] = React.useState();\n\n const [reactData, setReactData] = React.useState({\n promptForMessage: '',\n messageType: null,\n recipient: null,\n messageRecipientIDs: false,\n messageRecipientNames: false,\n editEventInfo: false,\n editInfoErrorList: [],\n editOwnerInfo: false,\n editIndex: false,\n popupMenuOpen: false,\n choiceList: [],\n signUpObject: pSignUps || {},\n attachedSR: false,\n selectAssignTo: false,\n defaultValues: defaultValues || { \"noDefaults\": true },\n cancelPending: false,\n numberOfOwnedSlots: 0,\n waitList: pOccData.wait_list || [],\n editWaitList: false,\n editForm: false\n });\n\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n const [anchorEl, setAnchorEl] = React.useState(null);\n\n const {\n coords,\n getPosition,\n isGeolocationAvailable,\n isGeolocationEnabled,\n positionError,\n } = useGeolocated({\n positionOptions: {\n enableHighAccuracy: true,\n },\n userDecisionTimeout: 5000,\n watchLocationPermissionChange: true,\n });\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n var rowsWritten = 0;\n\n function isOwned(slotData) {\n return (slotData.owner && (slotData.owner !== 'available'));\n }\n\n function isSlotOwner(slotData) {\n return (slotData.owner === pPatient);\n }\n\n const handleClick = async (event) => {\n setAnchorEl(event.currentTarget);\n };\n\n const setChoices = async ({ pGroups, noCurrent }) => {\n // if (reactData.choiceList.length > 0) { return; }\n let response = [];\n let gList = [];\n if (Array.isArray(pGroups)) {\n pGroups.forEach(grp => {\n grp = grp.replace('~group:', '');\n gList.push(...(grp.replace(/[[\\]]/g, '').split(/,|~/g)));\n });\n }\n else if (pGroups.includes('[')) {\n pGroups = pGroups.replace('~group:', '');\n gList = pGroups.replace(/[[\\]]/g, '').split(/,|~/g);\n }\n else { gList = [pGroups]; }\n if (pOccData.groups) { // If this event is restricted to specific groups, only allow names from those groups\n pOccData.groups.forEach(g => {\n if (!gList.includes(g)) {\n gList.push(g);\n }\n });\n }\n let memberInfo = await getMemberList(gList, pClient, { \"sort\": true, \"exclude\": false });\n /* getMemberList returns\n {\n peopleList: [],\n groupList: []\n }\n */\n let pLL = memberInfo.peopleList.length;\n for (let e = 0; e < pLL; e++) {\n let mInfo = {};\n let p = memberInfo.peopleList[e];\n if (noCurrent && reactData.slotOwnerList.includes(p.person_id)) {\n continue;\n }\n let searchString = [...Object.values(p.name), p.search_data, p.location].join(' ');\n if (p.messaging) {\n searchString += Object.values(p.messaging).join(' ');\n }\n try {\n mInfo.display_name = `${p.name.last}, ${p.name.first}`;\n let conflictInfo = [];\n if (reactData.signUpObject.hasOwnProperty(p.person_id)) {\n reactData.signUpObject[p.person_id].forEach(o => {\n if (o.occurrence_date === pOccData.date) {\n let timeText = '';\n if ((o.start_time24 === 0) && (o.end_time24 === 2359)) {\n timeText += 'All day';\n }\n else {\n if (o.start_time24 === 0) {\n timeText += 'Until';\n }\n else {\n timeText += `${makeTime(o.start_time24).short}`;\n }\n if (o.end_time24 !== 2359) {\n timeText += `-${makeTime(o.end_time24).short}`;\n }\n }\n conflictInfo.push(`${timeText} ${o.event_description}`);\n }\n });\n if (conflictInfo) {\n mInfo.conflict = conflictInfo;\n }\n }\n mInfo.person_id = p.person_id;\n mInfo.searchString = searchString;\n response.push(deepCopy(mInfo));\n }\n catch (error) {\n cl(`response push error at index ${e} with ${mInfo}`);\n }\n };\n updateReactData({\n choiceList: response\n }, false);\n };\n\n async function getDoc(this_doc) {\n let queryObj = {\n KeyConditionExpression: 'client_id = :c and document_id = :dID',\n ScanIndexForward: false,\n Limit: 1,\n ExpressionAttributeValues: {\n ':c': state.session.client_id,\n ':dID': this_doc\n }\n };\n queryObj.TableName = 'CompletedDocuments';\n let queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n if (recordExists(queryResult)) {\n return queryResult.Items[0];\n }\n queryObj.TableName = 'DocumentsInProcess';\n queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n if (recordExists(queryResult)) {\n return queryResult.Items[0];\n }\n queryObj.TableName = 'DocumentsAssigned';\n queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n if (recordExists(queryResult)) {\n return queryResult.Items[0];\n }\n queryObj.TableName = 'Documents';\n queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n if (recordExists(queryResult)) {\n return queryResult.Items[0];\n }\n return null;\n }\n\n const handlePrint = async (pEvent, pType) => {\n await printOccurrenceSheet({\n client_id: pClient,\n event_id: pEvent,\n requestor: pPatient,\n request_type: pType\n });\n return;\n };\n\n const getEventSlots = async (pEvent) => {\n let checkOwnership = false;\n reactData.numberOfOwnedSlots = 0;\n let firstAvailableChoice;\n if (!['time', 'seats'].includes(pOccData.signup_type)) { firstAvailableChoice = pPatient; }\n let slotInfo = await getSlotList({ \"client\": pClient, \"event\": pEvent });\n let slotList = Object.keys(slotInfo.slotObj).sort().map(o => {\n let first = \"\";\n let last = \"\";\n if (!slotInfo.slotObj[o].status || ['released', 'available'].includes(slotInfo.slotObj[o].status)) {\n slotInfo.slotObj[o].display_name = '';\n slotInfo.slotObj[o].owner = '';\n if (!firstAvailableChoice) { firstAvailableChoice = o; }\n }\n if (slotInfo.slotObj[o].display_name) {\n [first, last] = slotInfo.slotObj[o].display_name.split(/\\s(.*)/);\n }\n let slotData = Object.assign(slotInfo.slotObj[o], {\n name: slotInfo.slotObj[o].display_name,\n id: o\n });\n if (!checkOwnership) {\n checkOwnership = isSlotOwner(slotData);\n }\n if (isOwned(slotData)) {\n reactData.numberOfOwnedSlots++;\n }\n return {\n event_key: slotInfo.occRec.event_key,\n first,\n last,\n display_name: slotInfo.slotObj[o].display_name,\n slotData,\n marked: slotInfo.slotObj[o].marked || false\n };\n });\n slotList.sort((a, b) => {\n if (a.slotData.slot_sort) {\n return ((a.slotData.slot_sort > b.slotData.slot_sort) ? 1 : -1);\n }\n else if (a.slotData.id > b.slotData.id) { return 1; }\n else { return -1; }\n });\n let slotOwnerList = slotList.map(this_slot => {\n return this_slot.slotData.owner;\n });\n updateReactData({\n slotOwnerList\n }, false);\n setOwnerOfSlots(checkOwnership);\n setFirstAvailableSlot(firstAvailableChoice);\n setEventSlotList(slotList);\n setReactData(reactData);\n return slotList;\n };\n\n const getMarker = async () => {\n getPosition();\n let newText;\n if (!isEmpty(positionError)) {\n newText = `Location Error ${JSON.stringify(positionError)}`;\n }\n else if (!isGeolocationAvailable) {\n newText = \"Device doesn't support location ID\";\n }\n else if (!isGeolocationEnabled) {\n newText = `User blocked location ID`;\n }\n else {\n newText = await reverseGeo({\n latitude: coords.latitude,\n longitude: coords.longitude,\n accuracy: coords.accuracy\n });\n }\n return {\n location: newText,\n timestamp: new Date().getTime()\n };\n };\n\n const reverseGeo = async ({ latitude, longitude, accuracy }) => {\n const authHelper =\n await withAPIKey(\"v1.public.eyJqdGkiOiJiOTFjN2E0My1mZTNlLTQxMzctYTIyMy00YWI2YTE2NjUxZDUifToPc5592CrSHhW1JSbATtnjGoJDzqJYD-7AK7ExQpcAtmfRb-ofIy9TciExqtsveXreYKYPBoGKj8IIpESh8jhu8WcHmPHzYyPwjdMLEj2oc78daTQeGqw41QI-okSYoUMVCRBwO9eGiLsU2adjFXwSNlcs85lz_XAaYLAAKZODPOFTKk4sgI2kJ5queq9aHj4HjOOJfPwWmJZAqP-oTs2TLp-N95yBVllyU7-_6S3QXOI97rSAy5ABj-7fJMZTtXRrb6zw6sv8pJPKjZegaeM8V2oP4fQBMC4bC746aYaNT6SiVtTzIU8tdmrYgHmgkzbSxw_VZSp-UF8_OQIiNwQ.ZWU0ZWIzMTktMWRhNi00Mzg0LTllMzYtNzlmMDU3MjRmYTkx\");\n const locationClient = new LocationClient({\n region: \"us-east-1\",\n ...authHelper.getLocationClientConfig() // sets up the Location client to use the API Key defined above\n });\n let response = await locationClient.send(new SearchPlaceIndexForPositionCommand({\n IndexName: \"explore.place.Here\", // Place index resource to use\n Position: [longitude, latitude], // position to search near\n MaxResults: 3 // number of results to return\n }));\n if (!response || !response.Results || (response.Results.length === 0)) {\n return `at ${formatDegrees(latitude, false)}, ${formatDegrees(longitude, true)}`;\n }\n else {\n let selectedResponse = response.Results.find(result => {\n return (result.Place.AddressNumber);\n });\n if (!selectedResponse) {\n selectedResponse = response.Results[0];\n }\n let textResponse = 'At';\n let netAccuracy = selectedResponse.Distance + accuracy;\n if (netAccuracy > 10) {\n let calcAccuracyFeet = netAccuracy * 3.28;\n if (calcAccuracyFeet > 1000) {\n textResponse = `Within ${Math.round((calcAccuracyFeet / 5280) * 10) / 10} miles of`;\n }\n else {\n textResponse = `Within ${Math.round(calcAccuracyFeet)} feet of`;\n }\n }\n textResponse += ` ${selectedResponse.Place.Label}`;\n return textResponse;\n }\n };\n\n const getHistoryTimes = (this_item) => {\n let currentHistory = this_item.slotData.status.history;\n let foundTimes = ['no Value', 'no Value'];\n if (!currentHistory || isEmpty(currentHistory)) {\n return foundTimes;\n }\n currentHistory.some(h => {\n if (h.action === 'Checked out') {\n foundTimes[1] = makeDate(h.timestamp).timeOnly;\n }\n else if (h.action === 'Checked in') {\n foundTimes[0] = makeDate(h.timestamp).timeOnly;\n return true;\n }\n return false;\n });\n return foundTimes;\n };\n\n const getDirection = (degrees, isLongitude) =>\n degrees > 0 ? (isLongitude ? \"E\" : \"N\") : isLongitude ? \"W\" : \"S\";\n\n const formatDegrees = (degrees, isLongitude) =>\n `${0 | degrees}° ${0 | (((degrees < 0 ? (degrees = -degrees) : degrees) % 1) * 60)\n }' ${0 | (((degrees * 60) % 1) * 60)}\" ${getDirection(\n degrees,\n isLongitude,\n )}`;\n\n const handleUpdateWaitList = async (waitList) => {\n let qQ = {\n Key: {\n \"client\": pClient,\n \"event_key\": pEventCode\n },\n UpdateExpression: `set wait_list = :w`,\n ExpressionAttributeValues: { ':w': waitList },\n TableName: \"Calendar\"\n };\n await dbClient\n .update(qQ)\n .promise()\n .catch(error => {\n cl(`caught error updating Calendar for ${qQ.Key.event_key}; error is: `, error);\n });\n };\n\n const determineMode = (docRec) => {\n if (docRec.hasOwnProperty('incomplete')) {\n if (typeof docRec.incomplete === 'boolean') {\n return 'incomplete';\n }\n else if ((docRec.incomplete === 'true')\n || (docRec.incomplete === 'incomplete')) {\n return 'incomplete';\n }\n else if (docRec.incomplete === 'not_started') {\n return 'not_started';\n }\n }\n return 'view';\n };\n\n const handleAllocateSlot = async (body) => {\n let pPerson, pSlot, pRelease, pIndex;\n\n if (body.release) { pRelease = body.release; }\n else { pRelease = false; }\n if (body.hasOwnProperty('index')) {\n pIndex = body.index;\n }\n let workingList = eventSlotList;\n let whereToGo = -1;\n pPerson = makeArray(body.person);\n for (let p = 0; p < pPerson.length; p++) {\n let nArray = pPerson[p].split(/:|%%/);\n if (body.slot) { pSlot = body.slot; }\n else { pSlot = nArray[Math.min(1, nArray.length - 1)]; }\n let newPersonName, newPersonID;\n if (nArray.length === 1) {\n newPersonID = nArray[0];\n newPersonName = await makeName(newPersonID);\n }\n else {\n newPersonID = nArray[1];\n newPersonName = nArray[0];\n }\n let [first, last] = newPersonName.split(/\\s(.*)/);\n let newPersonLocation = null;\n let this_person = await getPerson(newPersonID, '*all');\n if (this_person) {\n if (this_person.location) {\n newPersonLocation = this_person.location.trim();\n }\n if (this_person.name) {\n first = this_person.name.first;\n last = this_person.name.last;\n }\n newPersonName = (`${first || ''} ${last}`).trim();\n }\n let writeRequest = {\n \"client\": pClient,\n \"person_id\": state.session.patient_id,\n \"event\": pEventCode,\n \"occurrence_date\": pOccData.date,\n \"owner\": newPersonID,\n \"override_name\": newPersonName,\n \"slot\": pSlot || newPersonID,\n \"status\": (pRelease ? 'released' : 'selected'),\n \"show_this_slot\": ((pRelease && (pSlot === newPersonID)) ? false : true),\n \"no_messaging\": isEventOwner\n };\n if (pOccData.description) {\n writeRequest.override_description = pOccData.description;\n }\n if (body.notes) { writeRequest.notes = body.notes; }\n\n\n\n\n if (pEvent) {\n if (pEvent.hasOwnProperty('default_forms')) {\n writeRequest.default_forms = deepCopy(pEvent.default_forms);\n }\n if (pEvent.hasOwnProperty('customizations')) {\n writeRequest.customizations = deepCopy(pEvent.customizations);\n }\n if (!reactData.defaultValues.message_override) {\n writeRequest.no_messaging = false;\n }\n else {\n let overrideList = makeArray(reactData.defaultValues.message_override);\n if (overrideList.some(oItem => {\n return oItem.toLowerCase().startsWith('*none');\n })) {\n writeRequest.no_messaging = true;\n }\n else if (overrideList.some(oItem => {\n return oItem.toLowerCase().startsWith('*published');\n })) {\n if (!pEvent.published) {\n writeRequest.no_messaging = true;\n }\n else {\n // event is already published and this instruction asks to message people only when published...\n writeRequest.no_messaging = false;\n writeRequest.overrideRecipient = [];\n for (const this_person of overrideList) {\n let instruction = this_person.split('=');\n if (instruction[0].startsWith('*published')) {\n instruction[0] = instruction[1];\n }\n if (instruction) {\n if (instruction[0].startsWith('slot')) {\n writeRequest.overrideRecipient.push(newPersonID);\n }\n else if (instruction[0].startsWith('event')) {\n writeRequest.overrideRecipient.push(...makeArray(pEvent.owner));\n }\n else {\n writeRequest.overrideRecipient.push(instruction[0]);\n }\n }\n }\n if (writeRequest.overrideRecipient.length === 0) {\n writeRequest.overrideRecipient.push(newPersonID);\n }\n writeRequest.override_subject = `Changes have been made to ${pEvent.description} (${makeDate(pEvent.occurrence_date, { noTime: true }).absolute}) that affect you`;\n writeRequest.override_messageText = `${newPersonName} has been added to this event.`;\n }\n }\n else {\n writeRequest.no_messaging = false;\n writeRequest.overrideRecipient = overrideList;\n }\n }\n }\n\n\n\n\n\n\n\n\n\n\n let slotInfo = await writeSlot(writeRequest);\n whereToGo = -1;\n if (pRelease) {\n if (pSlot !== newPersonID) {\n let updatedSlotData = Object.assign(workingList[pIndex].slotData, {\n name: '',\n owner: '',\n notes: ''\n });\n workingList[pIndex] = {\n event_key: slotInfo.event_key,\n first,\n last,\n display_name: '',\n slotData: updatedSlotData\n };\n }\n else {\n workingList.splice(pIndex, 1);\n }\n }\n else {\n // where in the displayed list of slots should this added entry go?\n if (pIndex > -1) { whereToGo = pIndex; } // we came here from a know spot in the slotList\n else { // look at every workingList entry for something that matches the slot we just registered\n let foundIndex = workingList.findIndex(s => { return (s.slotData.id === writeRequest.slot); });\n if (foundIndex > -1) { whereToGo = foundIndex; }\n }\n\n if ((whereToGo > -1) && (whereToGo < workingList.length)) {\n workingList[whereToGo] = {\n event_key: slotInfo.event_key,\n first,\n last,\n display_name: newPersonName,\n slotData: {\n name: newPersonName,\n display_name: newPersonName,\n id: pSlot,\n owner: newPersonID,\n owner_location: newPersonLocation,\n notes: body.notes,\n slot_description: workingList[whereToGo].slotData.slot_description,\n slot_sort: workingList[whereToGo].slotData.slot_sort,\n documents: slotInfo.documents || null\n }\n };\n }\n else {\n whereToGo = workingList.push({\n event_key: slotInfo.event_key,\n first,\n last,\n display_name: newPersonName,\n slotData: {\n name: newPersonName,\n id: newPersonID,\n display_name: newPersonName,\n owner: newPersonID,\n owner_location: newPersonLocation,\n notes: body.notes,\n documents: slotInfo.documents || null\n }\n });\n whereToGo--;\n }\n }\n };\n setEventSlotList(workingList);\n setForceRedisplay(!forceRedisplay);\n return whereToGo;\n };\n\n const handleUpdateEvent = async ([newDescription, newLocation, newDate, newTime]) => {\n let updateExpression = 'set ';\n let expressionAttributeValues = {};\n let expressionAttributeNames = {};\n let previousEntry = false;\n\n if (newDescription) {\n updateExpression += 'description = :d';\n expressionAttributeValues[':d'] = newDescription;\n previousEntry = true;\n pOccData.description = newDescription;\n }\n\n if (newLocation) {\n updateExpression += `${previousEntry ? ', ' : ''}#l = :l`;\n expressionAttributeNames['#l'] = 'location';\n expressionAttributeValues[':l'] = newLocation;\n previousEntry = true;\n pOccData.location = newLocation;\n }\n\n let needsSlotUpdates = false;\n let dNumeric$;\n if (newDate) {\n updateExpression += `${previousEntry ? ', ' : ''}occurrence_date = :date`;\n dNumeric$ = makeDate(newDate).numeric$;\n expressionAttributeValues[':date'] = dNumeric$;\n previousEntry = true;\n pOccData.date = dNumeric$;\n needsSlotUpdates = (eventSlotList && (eventSlotList.length > 0));\n }\n\n let needsSlotTimeMessage = false;\n if (newTime) {\n updateExpression += `${previousEntry ? ', ' : ''}#t = :t`;\n expressionAttributeNames['#t'] = 'time';\n let timeStart;\n let timeEnd;\n let delimiters = ['to', '-', 'through', 'thru', 'until'];\n let foundIt = delimiters.findIndex(d => newTime.toLowerCase().includes(` ${d} `));\n if (foundIt > -1) {\n let [newFrom, newTo] = newTime.toLowerCase().split(` ${delimiters[foundIt]} `);\n timeStart = makeTime(newFrom);\n timeEnd = makeTime(newTo);\n pOccData.time.duration = timeEnd.minutesSinceMidnight - timeStart.minutesSinceMidnight;\n }\n else {\n timeStart = makeTime(newTime);\n let tempEnd = timeStart.minutesSinceMidnight + (pOccData.time.duration || 0);\n let tempMM = tempEnd % 60;\n tempEnd -= tempMM;\n let tempHH = Math.trunc(tempEnd / 60) % 24;\n timeEnd = makeTime((tempHH * 100) + tempMM);\n }\n expressionAttributeValues[':t'] = {\n allDay: pOccData.time.allDay,\n duration: pOccData.time.duration,\n from_minutesSinceMidnight: timeStart.minutesSinceMidnight,\n from: timeStart.time,\n to: timeEnd.time\n };\n pOccData.time = {\n allDay: pOccData.time.allDay,\n duration: pOccData.time.duration,\n from_minutesSinceMidnight: timeStart.minutesSinceMidnight,\n from: timeStart.time,\n to: timeEnd.time\n };\n pOccData.time$ = `${timeStart.time} to ${timeEnd.time}`;\n pOccData.time24 = timeStart.numeric24;\n needsSlotTimeMessage = (eventSlotList && (eventSlotList.length > 0));\n }\n\n let qQ = {\n Key: {\n \"client\": pClient,\n \"event_key\": pEventCode\n },\n UpdateExpression: updateExpression,\n ExpressionAttributeValues: expressionAttributeValues,\n TableName: \"Calendar\"\n };\n if (!isEmpty(expressionAttributeNames)) {\n qQ.ExpressionAttributeNames = expressionAttributeNames;\n }\n\n let goodUpdate = true;\n await dbClient\n .update(qQ)\n .promise()\n .catch(error => {\n cl(`caught error updating Calendar for ${qQ.Key.event_key}; error is: `, error);\n goodUpdate = false;\n });\n\n // if we have to update slots (because of a date change)\n if (needsSlotUpdates) {\n let qS = {\n Key: {\n \"client\": pClient,\n },\n UpdateExpression: `set occurrence_date = :date`,\n ExpressionAttributeValues: {\n ':date': dNumeric$\n },\n TableName: \"Calendar\"\n };\n for (let s = 0; s < eventSlotList.length; s++) {\n let this_slot = eventSlotList[s];\n qS.Key.event_key = `${pEventCode}#${this_slot.slotData.slot}`;\n await dbClient\n .update(qS)\n .promise()\n // eslint-disable-next-line\n .catch(error => {\n cl(`caught error updating Calendar for ${qS.Key.event_key}; error is: `, error);\n goodUpdate = false;\n });\n }\n }\n\n if (goodUpdate) {\n enqueueSnackbar('Event info updated!', { variant: 'success' });\n }\n else {\n enqueueSnackbar('AVA could not update the Event info', { variant: 'error', persist: true });\n }\n return (needsSlotUpdates || needsSlotTimeMessage);\n };\n\n const checkOtherOccurrences = async () => {\n let this_event = pEventCode;\n let [this_eventID, this_occurrence] = this_event.split('#');\n let other_occurrences = [];\n // does this event have other occurrences?\n\n let queryObj = {\n TableName: 'Calendar',\n KeyConditionExpression: 'client = :c and begins_with(event_key, :eV)',\n FilterExpression: 'record_type = :t',\n ExpressionAttributeValues: {\n ':c': pClient,\n ':eV': `${this_eventID}#`,\n ':t': 'occurrence'\n }\n };\n let queryResult = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading ${queryObj.TableName} id ${error}`);\n });\n if (recordExists(queryResult)) {\n for (let this_oRec of queryResult.Items) {\n if ((this_oRec.occurrence_date !== this_occurrence) && (!this_oRec.occurrence_cancelled)) {\n other_occurrences.push(this_oRec.occurrence_date);\n }\n }\n }\n updateReactData({\n other_occurrences,\n cancelPending: false,\n ask_cancelSeries: (other_occurrences.length > 0)\n }, true);\n return (other_occurrences.length > 0);\n };\n\n const handleCancelEvent = async () => {\n let updateExpression = 'set occurrence_cancelled = :true';\n let expressionAttributeValues = { ':true': true };\n let goodUpdate = true;\n await dbClient\n .update({\n Key: {\n \"client\": pClient,\n \"event_key\": pEventCode\n },\n UpdateExpression: updateExpression,\n ExpressionAttributeValues: expressionAttributeValues,\n TableName: \"Calendar\"\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Calendar; error is: `, error);\n goodUpdate = false;\n });\n // remove all the slots\n if (goodUpdate) {\n if (eventSlotList && (eventSlotList.length > 0)) {\n let recipientList = [];\n for (const [index, this_item] of eventSlotList.entries()) {\n if (this_item.slotData?.status?.current?.selected) {\n recipientList.push(this_item.slotData.owner);\n }\n await handleAllocateSlot({\n person: `${this_item.slotData.name}%%${this_item.slotData.owner}`,\n slot: this_item.slotData.id,\n release: true,\n index: (index || 0)\n });\n };\n if (recipientList.length > 0) {\n let messageText = `${pOccData.description} ${makeDate(pOccData.date).relative} has been cancelled`;\n let messageObj = {\n client: state.session.client_id,\n author: state.session.patient_id,\n messageText: messageText,\n thread_id: `cancel_${pEventCode}`,\n recipientList: eventSlotList.map(),\n subject: `${pOccData.description} ${makeDate(pOccData.date).relative} has been cancelled`\n };\n await sendMessages(messageObj);\n }\n }\n enqueueSnackbar('Event cancelled!', { variant: 'success' });\n }\n else {\n enqueueSnackbar('AVA could not cancel the Event', { variant: 'error', persist: true });\n }\n return goodUpdate;\n };\n\n const handleUpdateOwner = async (newOwners) => {\n let eventKey = pEventCode.split('#')[0];\n let updateExpression = 'set';\n let expressionAttributeValues = {};\n let expressionAttributeNames = {};\n updateExpression += ' #eData.#e.#o = :o';\n expressionAttributeValues[':o'] = Object.keys(newOwners);\n expressionAttributeNames['#eData'] = 'eventData';\n expressionAttributeNames['#e'] = 'event_data';\n expressionAttributeNames['#o'] = 'owner';\n let goodUpdate = true;\n await dbClient\n .update({\n Key: {\n \"client\": pClient,\n \"event_key\": eventKey\n },\n UpdateExpression: updateExpression,\n ExpressionAttributeValues: expressionAttributeValues,\n ExpressionAttributeNames: expressionAttributeNames,\n TableName: \"Calendar\"\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Calendar; error is: `, error);\n goodUpdate = false;\n });\n if (!goodUpdate) {\n enqueueSnackbar('AVA could not update the Event owners', { variant: 'error', persist: true });\n }\n else {\n pOccData.owner = Object.keys(newOwners);\n enqueueSnackbar('Event owners updated', { variant: 'success' });\n }\n return goodUpdate;\n };\n\n const handleChangeNotes = async (updatedIndex, pNote) => {\n eventSlotList[updatedIndex].slotData.notes = pNote;\n let slotUpdate = Object.assign(\n {},\n eventSlotList[updatedIndex],\n eventSlotList[updatedIndex].slotData,\n {\n event: eventSlotList[updatedIndex].event_key,\n client: pClient\n }\n );\n slotUpdate.status = 'notes';\n slotUpdate.no_messaging = true;\n await writeSlot(slotUpdate);\n setEventSlotList(eventSlotList);\n setEditNoteNumber(-1);\n setForceRedisplay(!forceRedisplay);\n return eventSlotList;\n };\n\n // ********************\n\n React.useEffect(() => {\n async function buildIt() {\n setLoading(true);\n await getEventSlots(pEventCode);\n let attachedRequest = await getServiceRequests({\n foreign_key: pEventCode,\n client_id: state.session.client_id\n });\n if (attachedRequest.length === 0) {\n updateReactData({\n attachedSR: false\n }, false);\n }\n else {\n attachedRequest[0].assigned_to_name = await makeName(attachedRequest[0].assigned_to);\n updateReactData({\n attachedSR: attachedRequest[0]\n }, false);\n }\n setLoading(false);\n }\n buildIt();\n }, [pEventCode]); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n \n {/* Screen header - Description, Date, Location... */}\n\n \n {\n e.preventDefault();\n enqueueSnackbar(`AVA event=${pEventCode}`, { variant: 'info', persist: true });\n }}\n >\n {loading &&\n {`Loading`}\n }\n \n {titleCase(pOccData.description)}\n \n {pOccData.date &&\n \n {`${makeDate(pOccData.date).relative}${(!isEmpty(pOccData.time)) ? ' - ' + pOccData.time$ : ''}`}\n \n }\n {pOccData.location &&\n \n {pOccData.location}\n \n }\n {reactData.attachedSR &&\n \n {`Assigned to ${reactData.attachedSR.assigned_to_name}`}\n \n }\n \n {rowsWritten = 0}\n \n \n {\n handleClick(event);\n updateReactData({\n popupMenuOpen: true\n }, true);\n }}\n alt=''\n src={state.session?.client_logo || process.env.REACT_APP_AVA_LOGO}\n />\n {isEventOwner &&\n {\n updateReactData({\n popupMenuOpen: false\n }, true);\n }}\n keepMounted>\n \n {(pOccData.signup_type === 'none') && isEventOwner &&\n {\n await setChoices({ pGroups: peopleList });\n updateReactData({\n editIndex: false,\n popupMenuOpen: false,\n }, false);\n setEditSlot(false);\n setSelectNewSlotOwner(true);\n }}\n >\n \n \n {'Add a person'}\n \n \n }\n {isEventOwner && reactData.defaultValues.allowAssign &&\n {\n await setChoices({ pGroups: reactData.defaultValues.allowAssign });\n updateReactData({\n selectAssignTo: true,\n popupMenuOpen: false,\n }, true);\n }}\n >\n \n \n {'Assign'}\n \n \n }\n {\n await handlePrint(pEventCode, 'full');\n updateReactData({\n popupMenuOpen: false,\n }, true);\n }}\n >\n \n \n {'Detail report'}\n \n \n {\n await handlePrint(pEventCode, 'sign-up');\n updateReactData({\n popupMenuOpen: false,\n }, true);\n }}\n >\n \n \n {'Sign-up sheet'}\n \n \n {(reactData.numberOfOwnedSlots > 0) &&\n {\n let filteredList = eventSlotList.filter(e => {\n return (e.slotData.status !== 'released');\n });\n updateReactData({\n promptForMessage: true,\n popupMenuOpen: false,\n messageType: 'group',\n recipient: (filteredList.map(e => {\n return `${e.slotData.display_name}%%${e.slotData.id}`;\n }))\n }, true);\n }}\n >\n \n \n {'Message All'}\n \n \n }\n {\n updateReactData({\n popupMenuOpen: false,\n editEventInfo: true,\n editInfoErrorList: []\n }, true);\n }}\n >\n \n \n {'Update event info'}\n \n \n {\n updateReactData({\n popupMenuOpen: false,\n cancelPending: true,\n }, true);\n }}\n >\n \n \n {'Cancel this event'}\n \n \n {\n updateReactData({\n popupMenuOpen: false,\n editOwnerInfo: true,\n }, true);\n\n }}\n >\n \n \n {'Add owners'}\n \n \n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n {`User ${state.session.user_id}${state.session.patient_id !== state.session.user_id ? (' (' + state.session.patient_id + ')') : ''}`}\n {`Event: ${pEventCode}`}\n \n \n \n
    \n }\n \n\n {/* Slots */}\n \n \n {eventSlotList && eventSlotList.length > 0 && eventSlotList.map((this_item, index) => (\n (!this_item.slotData.hasOwnProperty('show_this_slot') || this_item.slotData.show_this_slot) &&\n \n \n {rowsWritten++}\n \n {/* Slot Name above Slot owner info */}\n \n {/* Slot Name */}\n {(this_item.slotData.id !== this_item.slotData.owner) &&\n \n \n {this_item.slotData.hasOwnProperty('slot_description')\n ? this_item.slotData.slot_description\n : makeSlotName(this_item.slotData.id)\n }\n \n \n }\n {/* Slot Owner */}\n {isOwned(this_item.slotData) &&\n \n \n {/* Mark an item - Radio button */}\n\n \n {(isEventOwner || isSlotOwner(this_item.slotData)) && \n {\n let { timestamp, location } = await getMarker();\n let currentHistory = this_item.slotData.slotData.status.history;\n if (!currentHistory || isEmpty(currentHistory)) {\n currentHistory = [];\n }\n currentHistory.unshift({\n timestamp,\n user: state.session.patient_id,\n action: `Checked ${this_item.marked ? 'out' : 'in'}`,\n location\n });\n await dbClient\n .update({\n Key: {\n \"client\": pClient,\n \"event_key\": `${pEventCode}#${this_item.slotData.id}`\n },\n UpdateExpression: 'set marked = :m, #sd.#st.#h = :h, check_in = :t',\n ExpressionAttributeValues: {\n ':m': !this_item.marked,\n ':h': currentHistory,\n ':t': (this_item.marked ? '' : timestamp)\n },\n ExpressionAttributeNames: {\n '#sd': 'slotData',\n '#st': 'status',\n '#h': 'history'\n },\n TableName: \"Calendar\"\n })\n .promise()\n .catch(error => { cl(`caught error updating Calendar; error is: `, error); });\n if (this_item.marked) {\n eventSlotList[index].marked = false;\n eventSlotList[index].check_in = null;\n }\n else {\n eventSlotList[index].marked = true;\n eventSlotList[index].check_in = timestamp;\n }\n setEventSlotList(eventSlotList);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n {this_item.marked\n ? ((isSlotOwner(this_item.slotData)\n || (this_item.slotData.documents && (this_item.slotData.documents.length > 0)))\n ? \n : \n )\n : ((isSlotOwner(this_item.slotData)\n || (this_item.slotData.documents && (this_item.slotData.documents.length > 0)))\n ? \n : \n )\n }\n \n }\n \n {/* Image and Name */}\n {(!(state.user.account_class\n && ['family', 'guest', 'vendor', 'other'].includes(state.user.account_class)\n && !(isEventOwner || isSlotOwner(this_item.slotData))\n )) &&\n \n }\n \n \n {(state.user.account_class\n && ['family', 'guest', 'vendor', 'other'].includes(state.user.account_class)\n && !(isEventOwner || isSlotOwner(this_item.slotData))\n ) ? 'Reserved' : this_item.slotData.display_name\n }\n \n {this_item.marked\n && (isSlotOwner(this_item.slotData) || (this_item.slotData.documents && (this_item.slotData.documents.length > 0)))\n && (this_item.check_in || this_item.slotData.check_in)\n &&\n \n {`Checked in since ${makeDate(this_item.check_in || this_item.slotData.check_in).date.toLocaleString([], { hour: 'numeric', minute: '2-digit' })}`}\n \n }\n {/* There are notes and I am the event or slot owner \n OR You've asked to edit notes (which you only could do if you are the owner) */}\n {((this_item.slotData.notes && (isEventOwner || isSlotOwner(this_item.slotData))) || (editNoteNumber === index)) &&\n (editNoteNumber === index ?\n \n { setNewNote(event.target.value); }}\n autoComplete='off'\n />\n {((pOccData.notes_required && newNote) || !pOccData.notes_required) &&\n {\n handleChangeNotes(index, newNote);\n }}\n edge=\"end\"\n />\n }\n {(!pOccData.notes_required || this_item.slotData.notes) &&\n { setEditNoteNumber(-1); }}\n edge=\"end\"\n />\n }\n \n :\n \n {this_item.slotData.notes}\n \n )\n }\n {pOccData.notes_required && (pOccData.notes_required !== '') && (editNoteNumber === index) &&\n \n {pOccData.notes_required}\n \n }\n\n {(isEventOwner || isSlotOwner(this_item.slotData)) &&\n (editNoteNumber === -1) &&\n \n {(isEventOwner || isSlotOwner(this_item.slotData)) &&\n (this_item.slotData.documents) &&\n (this_item.slotData.documents.length > 0) &&\n \n \n {\n if (this_item.slotData.documents.length > 1) {\n let docRecs = [];\n for (const this_doc of this_item.slotData.documents) {\n let dR = await getDoc(this_doc);\n if (!isEmpty(dR)) {\n docRecs.push(dR);\n }\n }\n if (docRecs.length > 1) {\n updateReactData({\n selectForm: true,\n selectedDoc_id: docRecs,\n }, true);\n return;\n }\n else if (docRecs.length === 1) {\n updateReactData({\n editForm: true,\n selectedDoc_id: docRecs[0].document_id,\n selectedPerson_id: docRecs[0].person_id,\n selectedDocMode: determineMode(docRecs[0])\n }, true);\n }\n }\n else {\n let docRec = await getDoc(this_item.slotData.documents[0]);\n if (!isEmpty(docRec)) {\n updateReactData({\n editForm: true,\n selectedDoc_id: this_item.slotData.documents[0],\n selectedPerson_id: docRec.person_id,\n selectedDocMode: determineMode(docRec)\n }, true);\n }\n }\n }}\n />\n \n \n }\n {isEventOwner && !isSlotOwner(this_item.slotData) &&\n \n \n {\n updateReactData({\n promptForMessage: true,\n messageType: '',\n recipient: (`${this_item.slotData.display_name}%%${this_item.slotData.owner}`)\n }, true);\n }}\n />\n \n \n }\n \n \n {\n setEditNoteNumber(index);\n }}\n />\n \n \n {!pViewOnly &&\n ((isEventOwner)\n || (isSlotOwner(this_item.slotData) && !reactData.defaultValues.prohibit_removeSelf)\n ) &&\n \n \n {\n await handleAllocateSlot({\n person: `${this_item.slotData.name}%%${this_item.slotData.owner}`,\n slot: this_item.slotData.id,\n release: true,\n index: (index || 0)\n });\n }}\n />\n \n \n }\n {(isEventOwner && !pViewOnly) &&\n (this_item.slotData.documents && (this_item.slotData.documents.length > 0)) &&\n \n \n {\n updateReactData({\n editTimeEntries: Object.assign({},\n this_item.slotData,\n {\n index,\n title: `${pOccData.description} ${makeDate(pOccData.date).relative}${(!isEmpty(pOccData.time)) ? ' - ' + pOccData.time$ : ''}`,\n appointmentDateTimeStamp: makeDate(pOccData.date, { noTime: true }).timestamp\n }\n )\n }, true);\n }}\n />\n \n \n }\n \n }\n \n \n\n \n }\n {!isOwned(this_item.slotData) && (isEventOwner || !pViewOnly) &&\n (editNoteNumber === -1) &&\n \n \n {\n if (isEventOwner) {\n updateReactData({ editIndex: index }, false);\n setEditSlot(true);\n await setChoices({ pGroups: peopleList });\n setSelectNewSlotOwner(true);\n }\n else {\n let pName = await makeName(pPatient);\n await handleAllocateSlot({\n person: `${pName}:${pPatient}`,\n slot: this_item.slotData.id,\n index: (index || 0)\n });\n }\n if (pOccData.notes_required) {\n setEditNoteNumber(index);\n }\n }}\n />\n \n \n }\n \n \n ))}\n {!loading && (!eventSlotList || (eventSlotList.length === 0) || (rowsWritten === 0)) &&\n \n \n Nobody Yet!\n \n {isEventOwner ? `Tap \"Add Someone\" below` : `Tap \"Add Myself\" below`}\n \n \n \n }\n \n \n {reactData.editForm &&\n {\n updateReactData({\n editForm: false\n }, true);\n }}\n />\n }\n {reactData.selectForm &&\n {\n return `[checkbox]${d.title || d.document_title}`;\n })}\n options={{ selectOne: true }}\n onCancel={() => {\n updateReactData({\n selectForm: false\n }, true);\n }}\n onSave={async (selectedForm) => {\n let ndx = selectedForm.findIndex(f => f === 'checked');\n let foundDoc = reactData.selectedDoc_id[ndx];\n updateReactData({\n selectForm: false,\n editForm: true,\n selectedDoc_id: foundDoc.document_id,\n selectedPerson_id: foundDoc.pertains_to || foundDoc.person_id || state.session.patient_id,\n selectedDocMode: determineMode(foundDoc)\n }, true);\n }}\n />\n }\n {selectNewSlotOwner &&\n {\n setSelectNewSlotOwner(false);\n }}\n onSelect={async (selectedPerson) => {\n setSelectNewSlotOwner(false);\n let nArray = selectedPerson.split('%%');\n let pID = nArray[Math.min(1, nArray.length - 1)];\n let availability_list = await (myAvailability(\n {\n check_date: pOccData.date,\n check_person_id: pID,\n check_client: state.session.client_id\n }\n ));\n console.log(availability_list);\n let slotObj = { person: selectedPerson };\n let newSlotStart24;\n let newSlotEnd24;\n if (editSlot) {\n let listIndex = reactData.editIndex;\n if (!reactData.editIndex && (reactData.editIndex !== 0)) {\n listIndex = eventSlotList.findIndex(slot => {\n return (slot.slotData.status === 'available');\n });\n }\n if ((listIndex < 0) || (!listIndex && (listIndex !== 0))) { // no assigned slot\n slotObj.slot = selectedPerson.person_id;\n slotObj.index = eventSlotList.length;\n newSlotStart24 = 0;\n newSlotEnd24 = 2359;\n }\n else {\n slotObj.slot = eventSlotList[listIndex].slotData.id;\n slotObj.index = listIndex;\n newSlotStart24 = eventSlotList[listIndex].slotData.slot_start_time24;\n newSlotEnd24 = eventSlotList[listIndex].slotData.slot_end_time24;\n }\n if (!reactData.signUpObject.hasOwnProperty(pID)) {\n reactData.signUpObject[pID] = [];\n }\n reactData.signUpObject[pID].push(Object.assign({},\n {\n occurrence_date: pOccData.occurrence_date,\n event_id: pOccData.event_id,\n event_description: pOccData.description,\n start_time24: newSlotStart24,\n end_time24: newSlotEnd24\n },\n ));\n updateReactData({\n signUpObject: reactData.signUpObject\n }, false);\n }\n await handleAllocateSlot(slotObj);\n }}\n >\n \n }\n {reactData.promptForMessage &&\n (reactData.messageType !== 'group') &&\n { return r.split('%%')[1]; })\n : [reactData.recipient.split('%%')[1]])\n }\n pRecipientName={reactData.messageRecipientNames\n || (Array.isArray(reactData.recipient)\n ? reactData.recipient.map(r => { return r.split('%%')[0]; })\n : [reactData.recipient.split('%%')[0]])\n }\n onCancel={() => {\n updateReactData({\n promptForMessage: false\n }, true);\n }}\n onComplete={() => {\n updateReactData({\n promptForMessage: false\n }, true);\n }}\n setMethod={null}\n allowCancel={true}\n />\n }\n {reactData.promptForMessage &&\n (reactData.messageType === 'group') &&\n { return r.split('%%')[1]; })\n : [reactData.recipient.split('%%')[1]])\n }\n pRecipientName={reactData.messageRecipientNames\n || (Array.isArray(reactData.recipient)\n ? reactData.recipient.map(r => { return r.split('%%')[0]; })\n : [reactData.recipient.split('%%')[0]])\n }\n onCancel={() => {\n updateReactData({\n promptForMessage: false\n }, true);\n }}\n onComplete={() => {\n updateReactData({\n promptForMessage: false\n }, true);\n }}\n setMethod={null}\n allowCancel={true}\n />\n }\n {reactData.editEventInfo &&\n {\n reactData.editInfoErrorList = [];\n reactData.editEventInfo = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onSave={async (updatedValues) => {\n reactData.editInfoErrorList = [];\n let updatedDate = makeDate(updatedValues[2], { noTime: true });\n let reactUpdates = {};\n if (updatedDate.error) {\n reactUpdates.editInfoErrorList = ['', '', 'Please enter a valid date'];\n }\n else {\n reactUpdates.editEventInfo = false;\n let newDescription = ((pOccData.description !== updatedValues[0]) ? updatedValues[0] : null);\n let newLocation = ((pOccData.location !== updatedValues[1]) ? updatedValues[1] : null);\n let OGDate = (pOccData.date ? makeDate(pOccData.date, { noTime: true }) : { error: true });\n let newDate = ((OGDate.numeric$ !== updatedDate.numeric$) ? updatedDate.numeric$ : null);\n let newTime = ((pOccData.time$ !== updatedValues[3]) ? updatedValues[3] : null);\n if (newDescription || newLocation || newDate || newTime) {\n let messageSubject = pOccData.description;\n if (!OGDate.error) {\n messageSubject += ` scheduled for ${OGDate.absolute}`;\n }\n let messageText = `The ${pOccData.description} has been rescheduled. It is now scheduled for ${updatedValues[3] ? updatedValues[3] + ' ' : ''}${updatedDate.absolute_full}`;\n let needsMessage = await handleUpdateEvent([newDescription, newLocation, newDate, newTime]);\n if (needsMessage) {\n let filteredList = eventSlotList.filter(e => {\n return (e.slotData.status !== 'released');\n });\n Object.assign(reactUpdates, {\n promptForMessage: true,\n messageSubject: messageSubject,\n messageText: messageText,\n messageType: 'group',\n messageRecipientIDs: (filteredList.map(e => {\n return e.slotData.id;\n })),\n messageRecipientNames: (filteredList.map(e => {\n return e.slotData.display_name;\n }))\n });\n }\n }\n }\n updateReactData(reactUpdates, true);\n }}\n />\n }\n {reactData.editTimeEntries &&\n {\n reactData.editInfoErrorList = [];\n reactData.editTimeEntries = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onSave={async ([newIn, newOut, newNote]) => {\n let errorFree = true;\n let currentHistory = reactData.editTimeEntries.slotData.status.history;\n const this_userName = await makeName(state.session.user_id);\n const nowTime = makeDate(new Date());\n let inTime = makeTime(newIn);\n if (inTime.good) {\n currentHistory.unshift({\n timestamp: reactData.editTimeEntries.appointmentDateTimeStamp + (inTime.minutesSinceMidnight * 60000),\n user: reactData.editTimeEntries.slotData.owner,\n action: `Checked in`,\n location: `by ${this_userName} ${nowTime.oaDate}`\n });\n }\n else {\n errorFree = false;\n }\n let outTime = makeTime(newOut);\n if (outTime.good) {\n if (outTime.minutesSinceMidnight < inTime.minutesSinceMidnight) {\n outTime.minutesSinceMidnight += 1440;\n }\n currentHistory.unshift({\n timestamp: reactData.editTimeEntries.appointmentDateTimeStamp + (outTime.minutesSinceMidnight * 60000),\n user: reactData.editTimeEntries.slotData.owner,\n action: `Checked out`,\n location: `by ${this_userName} ${nowTime.oaDate}`,\n note: newNote\n });\n }\n else {\n errorFree = false;\n }\n if (errorFree) {\n await dbClient\n .update({\n Key: {\n \"client\": pClient,\n \"event_key\": `${pEventCode}#${reactData.editTimeEntries.id}`\n },\n UpdateExpression: 'set #sd.#st.#h = :h, check_in = :null',\n ExpressionAttributeValues: {\n ':h': currentHistory,\n ':null': ''\n },\n ExpressionAttributeNames: {\n '#sd': 'slotData',\n '#st': 'status',\n '#h': 'history'\n },\n TableName: \"Calendar\"\n })\n .promise()\n .catch(error => { cl(`caught error updating Calendar; error is: `, error); });\n eventSlotList[reactData.editTimeEntries.index].check_in = (newOut ? null : newIn.timestamp);\n eventSlotList[reactData.editTimeEntries.index].marked = (newOut ? false : (newIn ? true : false));\n setEventSlotList(eventSlotList);\n reactData.editTimeEntries = false;\n }\n else {\n reactData.editTimeEntries.errors = [\n (inTime.good ? '' : 'Clock in time is invalid'),\n (outTime.good ? '' : 'Clock out time is invalid'),\n ];\n }\n updateReactData({\n editTimeEntries: reactData.editTimeEntries\n }, true);\n }}\n />\n }\n {reactData.editOwnerInfo &&\n {\n reactData.editOwnerInfo = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onSelect={async (selectedPeople) => {\n await handleUpdateOwner(selectedPeople);\n reactData.editOwnerInfo = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n allowRandom={true}\n multiSelect={true}\n returnValue={'object'}\n />\n }\n {reactData.cancelPending &&\n {\n reactData.cancelPending = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n }}\n onConfirm={async () => {\n let othersExist = await checkOtherOccurrences();\n if (!othersExist) {\n await handleCancelEvent();\n reactData.cancelPending = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n onReset({ event_cancelled: true });\n }\n }}\n allowCancel={true}\n />\n }\n {reactData.ask_cancelSeries &&\n {\n await handleCancelEvent();\n reactData.cancelPending = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n onReset({ event_cancelled: true });\n }}\n onConfirm={async () => {\n await handleCancelEvent();\n let eventID = pEventCode.split('#')[0];\n for (let next_event of reactData.other_occurrences) {\n pEventCode = `${eventID}#${next_event}`;\n await handleCancelEvent();\n }\n reactData.cancelPending = false;\n setReactData(reactData);\n setForceRedisplay(!forceRedisplay);\n onReset({ event_cancelled: true });\n }}\n allowCancel={true}\n />\n }\n {reactData.selectAssignTo &&\n {\n updateReactData({\n selectAssignTo: false,\n choiceList: []\n }, true);\n }}\n onSelect={async (selectedPerson) => {\n let currentTime = makeDate(new Date());\n let assigned_to = selectedPerson.split('%%')[1];\n let assigned_to_name = await makeName(assigned_to);\n let putSR = {\n client: state.session.client_id,\n author: state.session.patient_id,\n proxy_user: state.session.user_id,\n requestType: 'checklist',\n activity_key: \"\",\n onBehalfOf: state.session.patient_display_name,\n foreign_key: pEventCode,\n history: [`Checklist assigned to ${assigned_to_name} ${currentTime.oaDate}`],\n assign_to: assigned_to,\n last_status: 'assigned',\n request: {},\n messaging: {}\n };\n let result = await putServiceRequest(putSR);\n result.assigned_to_name = assigned_to_name;\n let messageText = `${state.session.patient_display_name} has assigned you to \"${pOccData.description}\" - ${makeDate(pOccData.date).relative}`;\n let messageObj = {\n client: state.session.client_id,\n author: state.session.patient_id,\n messageText: messageText,\n thread_id: `svc_checklist/${result.request_id}`,\n recipientList: [assigned_to],\n subject: `${pOccData.description} assigned to you`\n };\n await sendMessages(messageObj);\n updateReactData({\n selectAssignTo: false,\n popupMenuOpen: false,\n choiceList: [],\n attachedSR: result\n }, true);\n }}\n />\n }\n {reactData.editWaitList &&\n {\n updateReactData({\n editWaitList: false,\n }, true);\n }}\n onSelect={async (selectedPerson) => {\n await handleUpdateWaitList(selectedPerson);\n updateReactData({\n waitList: selectedPerson,\n editWaitList: false\n }, true);\n }}\n />\n }\n {!loading &&\n \n \n \n {\n let summaryInfo = {\n totalSlots: 0,\n ownedSlots: 0,\n markedSlots: 0,\n listComplete: false,\n slot_owners: {}\n };\n if (eventSlotList) {\n eventSlotList.forEach(s => {\n if (s.slotData) {\n summaryInfo.totalSlots++;\n if (s.slotData.owner) {\n summaryInfo.ownedSlots++;\n summaryInfo.slot_owners[s.slotData.owner] = s.slotData.slot_description || s.slotData.id;\n }\n if (s.marked) {\n summaryInfo.markedSlots++;\n }\n }\n });\n summaryInfo.listComplete = ((summaryInfo.ownedSlots > 0) && (summaryInfo.markedSlots >= summaryInfo.ownedSlots));\n }\n pOccData.summaryInfo = summaryInfo;\n onReset(pOccData);\n }}\n startIcon={}\n >\n {'Done'}\n \n {['time', 'seats'].includes(pOccData.signup_type) &&\n (eventSlotList.length <= reactData.numberOfOwnedSlots) &&\n (!ownerOfSlots || isEventOwner) &&\n {\n if (isEventOwner) {\n await setChoices({ pGroups: peopleList, noCurrent: true });\n updateReactData({\n editWaitList: true\n }, true);\n }\n else {\n if (!isWaitListed(pPatient)) {\n reactData.waitList.push(pPatient);\n }\n else {\n let foundAt = reactData.waitList.findIndex(wl_entry => {\n return (wl_entry === pPatient);\n });\n if (foundAt > -1) {\n reactData.waitList.splice(foundAt, 1);\n }\n }\n await handleUpdateWaitList(reactData.waitList);\n updateReactData({\n waitList: reactData.waitList,\n }, true);\n }\n }}\n >\n {`${!isEventOwner ? (isWaitListed(pPatient) ? 'Remove me from ' : 'Add me to ') : ''}Wait List`}\n \n }\n {((!ownerOfSlots && !pViewOnly) || isEventOwner) &&\n (!['time', 'seats'].includes(pOccData.signup_type)) &&\n {\n console.log(firstAvailableSlot);\n if (isEventOwner) {\n setEditSlot(true);\n await setChoices({ pGroups: peopleList });\n setSelectNewSlotOwner(true);\n }\n else {\n let pName = await makeName(pPatient);\n let request = { person: `${pName}:${pPatient}` };\n let addedIndexAt = await handleAllocateSlot(request);\n setOwnerOfSlots(true);\n if (pOccData.signup_type !== 'none') {\n request.slot = firstAvailableSlot;\n }\n if (pOccData.notes_required) {\n setEditNoteNumber(addedIndexAt);\n }\n }\n }}\n startIcon={}\n >\n {isEventOwner ? `Add someone` : `Add myself`}\n \n }\n \n \n \n }\n \n \n );\n};","import React from 'react';\nimport { useSnackbar } from 'notistack';\n\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport ListItem from '@material-ui/core/ListItem';\nimport Slide from '@material-ui/core/Slide';\n\nimport AVATextInput from '../forms/AVATextInput';\n\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Button from '@material-ui/core/Button';\nimport CloseIcon from '@material-ui/icons/Close';\n\nimport TextField from '@material-ui/core/TextField';\n\nimport Paper from '@material-ui/core/Paper';\nimport { cl, isObject } from '../../util/AVAUtilities';\nimport { makeDate } from '../../util/AVADateTime';\nimport { getServiceRequests, updateServiceRequest } from '../../util/AVAServiceRequest';\nimport { getImage, makeName } from '../../util/AVAPeople';\n\nimport useSession from '../../hooks/useSession';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport Typography from '@material-ui/core/Typography';\n\nimport { AVAclasses, AVATextStyle } from '../../util/AVAStyles';\n\n\nconst useStyles = makeStyles(theme => ({\n formControl: {\n margin: 0,\n paddingTop: 0,\n },\n AVAButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n freeInput: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: 0,\n width: '90%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n minHeight: theme.typography.fontSize * 1.8,\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n firstName: {\n marginLeft: theme.spacing(1),\n fontSize: '0.8rem',\n },\n lastName: {\n fontWeight: 'bold',\n },\n groupName: {\n fontWeight: 'bold',\n color: 'red'\n },\n orSeparator: {\n marginTop: theme.spacing(1),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(2),\n fontSize: theme.typography.fontSize * 0.8,\n },\n idText: {\n paddingTop: 6,\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(1)\n },\n}));\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ open, last_selected, priority_list, onClose }) => {\n\n const { state } = useSession();\n const { accessList } = state;\n const { enqueueSnackbar } = useSnackbar();\n\n const [person_filter, setPersonFilter] = React.useState('');\n const [forceRedisplay, setForceRedisplay] = React.useState(true);\n const [rowLimit, setRowLimit] = React.useState(20);\n\n const selectedClient = state.session.client_id;\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const handleClose = () => {\n onClose(reactData.last_selected_person);\n };\n\n const [reactData, setReactData] = React.useState({\n screen_mode: 'select',\n selected_person: null,\n selection_list: buildSelectionList()\n });\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n function buildSelectionList() {\n let inList = [];\n if (last_selected) {\n inList.push(...last_selected);\n }\n if (priority_list) {\n inList.push(...priority_list);\n }\n if (accessList) {\n inList.push(...accessList[selectedClient].list);\n }\n let finalList = [];\n let existingIDs = [];\n for (let w = 0; w < inList.length; w++) {\n let this_row = inList[w];\n if (typeof (this_row) === 'string') {\n this_row = accessList[selectedClient].list.find(r => {\n return (r.person_id === this_row);\n });\n }\n else if ((!this_row.hasOwnProperty.location) && accessList) {\n let a_row = accessList[selectedClient].list.find(r => {\n return (r.person_id === (this_row.id || this_row.person_id));\n });\n if (a_row.groups.some(r => {\n return (state.session.inactiveGroupList.includes(r));\n })) {\n continue;\n }\n this_row.location = a_row.location;\n }\n if (!existingIDs.includes(this_row.id)) {\n existingIDs.push(this_row.id);\n finalList.push({\n id: this_row.id,\n location: this_row.location,\n name: this_row.displayName || (`${this_row.first} ${this_row.last}`.trim()) || (`${this_row?.name.first} ${this_row?.name.last}`.trim()) || this_row.id || this_row.person_id\n });\n }\n };\n return finalList;\n }\n\n const subMenuHead = React.useRef(null);\n\n const scrollValue = 20;\n var rowsWritten;\n let filterTimeOut;\n\n const onScroll = event => {\n let newLimit = rowLimit + scrollValue;\n setRowLimit(newLimit);\n };\n\n const handleChangePersonFilter = vCheck => {\n clearTimeout(filterTimeOut);\n cl(`set timeout with ${vCheck} at ${new Date().getTime()}`);\n filterTimeOut = setTimeout(() => {\n cl(`timeout ended ${vCheck} at ${new Date().getTime()}`);\n if (!vCheck) {\n setPersonFilter(null);\n }\n else {\n let filterInput = vCheck.trim();\n setPersonFilter(filterInput.toLowerCase());\n }\n setForceRedisplay(!forceRedisplay);\n }, 500);\n return;\n };\n\n async function onSelect(newClient, newPatient) {\n updateReactData({\n last_selected_person: [newPatient],\n screen_mode: 'checkIn',\n selected_person: newPatient,\n statusObj: await getCurrentStatus(newClient, newPatient, 'staff')\n }, true);\n };\n\n async function getCurrentStatus(client_id, personRec, mode) {\n let person;\n if (isObject(personRec)) {\n person = personRec.person_id || personRec.id;\n }\n else {\n person = personRec;\n }\n let reqArray = await getServiceRequests({ client_id, person_id: person, foreign_key: mode, request_type: \"checkout\" });\n if (reqArray.length === 0) {\n let now = new Date().getTime();\n return {\n last_status: 'none',\n last_update: 0,\n history: [],\n last_visited_name: await makeName(state.patient.person_id),\n reqRec: {\n client_id,\n \"request_id\": `${personRec.person_id}_checkout`,\n \"requestor\": personRec.person_id,\n \"on_behalf_of\": `${personRec.first} ${personRec.last}`,\n \"request_type\": 'checkout',\n \"request_date\": now,\n \"original_request\": {},\n \"history\": [],\n \"local_key\": `${personRec.person_id}_checkout`,\n \"foreign_key\": mode,\n \"last_update\": now,\n \"type_date\": `checkout~${now}`,\n \"last_status\": 'none',\n }\n };\n }\n else {\n let returnObj = {\n last_update: reqArray[0].last_update,\n last_visited: reqArray[0].last_visited,\n history: reqArray[0].history,\n reqRec: reqArray[0]\n };\n if ((reqArray[0].last_visited && (reqArray[0].last_status === 'in'))) {\n returnObj.last_status = 'in';\n returnObj.last_visited_name = (reqArray[0].last_visited ? await makeName(reqArray[0].last_visited) : '');\n }\n else {\n returnObj.last_status = 'out';\n returnObj.last_visited_name = await makeName(state.patient.person_id);\n }\n return returnObj;\n }\n }\n\n function makeGreeting(pName) {\n if (state.session?.custom_greeting) { return `${state.session.custom_greeting}${pName ? ', ' + pName : ''}!`; }\n else { return `Good ${makeDate(new Date()).dayPart}${pName ? ', ' + pName : ''}!`; }\n }\n\n function okToShow(pLine) {\n if (!pLine) { return false; }\n if (pLine.access === 'none') { return false; }\n if (pLine.access === 'view') { return false; }\n if (!person_filter) { return true; }\n return Object.values(pLine).toString().toLowerCase().includes(person_filter);\n };\n\n React.useEffect(() => {\n if (subMenuHead && subMenuHead.current) {\n subMenuHead.current.scrollIntoView({\n behavior: 'instant',\n block: 'start',\n });\n }\n }, [selectedClient]);\n\n return (\n \n \n {`Where are you checking in to?`}\n \n (handleChangePersonFilter(event.target.value))}\n className={classes.freeInput}\n autoComplete='off'\n variant=\"standard\"\n />\n \n {`You may filter the list below`}\n \n \n {accessList && (selectedClient !== '*none') &&\n \n \n {rowsWritten = 0}\n \n {reactData.selection_list.map((listEntry, x) => (\n ((rowsWritten <= rowLimit) && okToShow(listEntry) &&\n {\n await onSelect(selectedClient, listEntry);\n }}\n button\n ref={(rowsWritten === 0) ? subMenuHead : null}\n onContextMenu={async (e) => {\n e.preventDefault();\n enqueueSnackbar(
    \n ID: {listEntry.id}
    \n Grp(s): {listEntry.groups}
    \n
    ,\n { variant: 'info', persist: true });\n }}\n >\n \n \n {rowsWritten++}\n \n \n \n {listEntry.location}\n {listEntry.name}\n \n \n \n )))}\n {(rowsWritten === 0) &&\n \n {'No selections available'}\n \n }\n
    \n }\n {!accessList &&\n \n \n {'AVA is still loading'}\n \n \n {'Please try again in a moment.'}\n \n \n }\n
    \n { /* **********************************\n We are checking in/out\n ********************************** */\n reactData.screen_mode === 'checkIn'\n &&\n (['in'].includes(reactData.statusObj.last_status) ?\n {\n updateReactData({\n screen_mode: 'select'\n }, true);\n }}\n onSave={async (responses) => {\n let now = makeDate(new Date());\n reactData.statusObj.reqRec.last_status = 'out';\n reactData.statusObj.reqRec.last_update = now.timestamp;\n reactData.statusObj.reqRec.type_date = `${reactData.statusObj.reqRec.request_type}~${now.timestamp}`;\n let hNote = `Checked out on ${now.absolute}`;\n /* if we have other data to capture (\"did you complete your task?\", \"issues to note\", etc.)\n those notes would be captured in prompts and be saved here\n responses.forEach((r, x) => {\n if (r && reactData.residentPrompts) {\n hNote += ` ${reactData.residentPrompts[x]}: ${r}.`;\n }\n });\n */\n reactData.statusObj.reqRec.history.unshift(hNote);\n await updateServiceRequest(reactData.statusObj.reqRec);\n // enqueueSnackbar(`Check-out successful!`, { variant: 'success', persist: false });\n handleClose();\n }}\n allowCancel={true}\n options={{ save_on_enter: true }}\n />\n :\n {\n updateReactData({\n screen_mode: 'select'\n }, true);\n }}\n onSave={async () => {\n let now = makeDate(new Date());\n reactData.statusObj.reqRec.last_status = 'in';\n reactData.statusObj.reqRec.last_update = now.timestamp;\n reactData.statusObj.reqRec.type_date = `${reactData.statusObj.reqRec.request_type}~${now.timestamp}`;\n let hNote = `Checked in on ${now.absolute} to visit ${reactData.statusObj.last_visited_name}`;\n reactData.statusObj.reqRec.history.unshift(hNote);\n reactData.statusObj.reqRec.last_visited = state.patient.person_id;\n await updateServiceRequest(reactData.statusObj.reqRec);\n handleClose();\n }}\n allowCancel={true}\n />\n )\n }\n \n {\n handleClose();\n }}\n startIcon={}\n >\n {'Exit'}\n \n \n
    \n );\n};\n","import React from 'react';\nimport { sentenceCase, deepCopy, makeArray, isMobile, cl, titleCase, dbClient, recordExists, listFromArray, restAPI } from '../../util/AVAUtilities';\nimport { makeDate } from '../../util/AVADateTime';\nimport { getImage, getPerson, makeName } from '../../util/AVAPeople';\nimport { getMemberList } from '../../util/AVAGroups';\nimport { getCalendarEntries } from '../../util/AVACalendars';\nimport { getServiceRequests, updateServiceRequest, printServiceRequest } from '../../util/AVAServiceRequest';\nimport { getMessages, messageHistory, sendMessages } from '../../util/AVAMessages';\nimport { printRawData } from '../../util/AVAPrintServiceRequest';\nimport MakeMessage from '../forms/MakeMessage';\nimport AVATextInput from '../forms/AVATextInput';\nimport CalendarEventEditForm from '../forms/CalendarEventEditForm';\nimport StaffAccess from './StaffAccess';\n\nimport Menu from '@material-ui/core/Menu';\nimport MenuList from '@material-ui/core/MenuList';\nimport MenuItem from '@material-ui/core/MenuItem';\n\nimport AVA_AlertSound from '../../ava_alert.mp3';\nimport SearchIcon from '@material-ui/icons/Search';\n\nimport IdleTimer from 'react-idle-timer';\n\nimport useSound from 'use-sound';\n\nimport { useSnackbar } from 'notistack';\nimport useSession from '../../hooks/useSession';\n\nimport List from '@material-ui/core/List';\nimport PersonFilter from '../forms/PersonFilter';\n\nimport PersonAddIcon from '@material-ui/icons/PersonAdd';\nimport ListAltIcon from '@material-ui/icons/ListAlt';\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport CheckIcon from '@material-ui/icons/DoneSharp';\nimport SwapVertIcon from '@material-ui/icons/SwapVert';\nimport ClearAllIcon from '@material-ui/icons/ClearAll';\nimport DoneAllIcon from '@material-ui/icons/DoneAll';\nimport OpenDoorIcon from '@material-ui/icons/MeetingRoom';\nimport DashboardIcon from '@material-ui/icons/Dashboard';\nimport ListIcon from '@material-ui/icons/List';\nimport HomeIcon from '@material-ui/icons/Home';\nimport SaveAltIcon from '@material-ui/icons/SaveAlt';\n\nimport Button from '@material-ui/core/Button';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\n\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\n\nimport TextField from '@material-ui/core/TextField';\n\nimport SendIcon from '@material-ui/icons/Send';\nimport PrintIcon from '@material-ui/icons/Print';\n\nimport { AVAclasses, AVATextStyle, AVADefaults, AVATextVariableStyle } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n page: {\n height: 950,\n maxWidth: 1000\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n freeInput: {\n marginLeft: '2px',\n marginRight: 2,\n marginBottom: theme.spacing(1),\n marginTop: theme.spacing(1),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: theme.spacing(1),\n width: '90%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n },\n imageArea: {\n minWidth: '80px',\n maxWidth: '80px',\n minHeight: '80px',\n maxHeight: '80px',\n marginRight: theme.spacing(1),\n },\n formControlLbl: {\n marginRight: 0,\n marginTop: 0,\n marginBottom: 0,\n marginLeft: 2,\n paddingTop: 0,\n height: theme.spacing(2.5),\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 5,\n },\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n AVAButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n listItem: {\n justifyContent: 'space-between',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n makeIconStyle: {\n marginRight: theme.spacing(1),\n },\n locationLine: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n preferenceLine: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n mrowhead: {\n marginTop: 10,\n fontSize: theme.typography.fontSize * 1.2,\n fontWeight: 'bold'\n },\n mrowdetail: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n mrowqual: {\n fontSize: theme.typography.fontSize * 1.0,\n marginLeft: 10,\n },\n techInfoLine: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(2),\n },\n techInfoLine2: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(4),\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n firstName: {\n fontSize: theme.typography.fontSize * 1.4,\n marginRight: theme.spacing(1),\n },\n timeLine: {\n fontSize: theme.typography.fontSize * 1.4,\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1.5),\n },\n lastName: {\n fontWeight: 'bold',\n fontSize: theme.typography.fontSize * 1.8,\n marginTop: theme.spacing(-0.75),\n },\n messageArea: {\n alignItems: 'start',\n justifyContent: 'flex-start',\n marginTop: theme.spacing(1.5),\n marginBottom: theme.spacing(1),\n marginLeft: theme.spacing(0),\n marginRight: theme.spacing(0),\n },\n title: {\n marginTop: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginLeft: theme.spacing(2),\n marginBottom: 0,\n fontSize: theme.typography.fontSize * 1.5,\n fontWeight: 'bold',\n },\n subTitle: {\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(0.5),\n marginLeft: theme.spacing(2),\n fontSize: theme.typography.fontSize * 1.2\n },\n popUpMenu: {\n marginRight: theme.spacing(3),\n paddingRight: 2,\n },\n popUpMenuRow: {\n marginLeft: theme.spacing(1),\n fontSize: theme.typography.fontSize * 1.0,\n },\n popUpFooter: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n}));\n\nexport default ({ session, title, filter = { 'person_id': session.patient_id }, options = {}, onClose }) => {\n\n /*\n filter: {\n person_id - only show requests made by or assigned to this person\n request_type - (optional) only show requests of this type\n selection - (optional) pre-set filter criteria\n request_date - (optional)\n if string or number or array with one entry, choose only this date\n if array with exactly two entries, use as start and end\n }\n options: {\n shortForm - when true, don't show image, history, or message details\n textForm - when true, show only requestor and selections (in a text format)\n selectOnly: newStatus - show only the name and very brief info; select an item to automatically change ths status\n allowAssign - when items are selected, the \"assign\" button will be shown. allowAssign should contain an array (list) of groups that assignees can be selected from\n updateMode - preselect first item\n viewMode - no search field; no changes allowed; show \"add new request\"; onClose carries instruction for next step\n noSelect - suppress checkbox and buttons for updates, etc.\n woNumber - edit work order number in foreign key\n }\n */\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const { state } = useSession();\n\n const firstSelectedRowRef = React.useRef(null);\n\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n\n const [loading, setLoading] = React.useState('no_value');\n const [unmount, setUnmount] = React.useState();\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const [popupMenuOpen, setPopupMenuOpen] = React.useState(false);\n\n const [anchorEl, setAnchorEl] = React.useState(null);\n\n const handleClick = async (event) => {\n setAnchorEl(event.currentTarget);\n };\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n let filterIn = Object.assign(filter, { filtering: false });\n if (filter.status || ((filter.statusNot && !filter.showNotBox))) {\n filterIn.statusNot = false;\n filterIn.filtering = true;\n filterIn.fields = { status: {} };\n filter.status = (filter.status || []).concat((filter.statusNot || []));\n filter.status.forEach(f => {\n filterIn.fields.status[f] = true;\n });\n }\n else if (filter.statusNot && filter.showNotBox) {\n filterIn.statusNot = true;\n filterIn.filtering = true;\n filterIn.fields = { status: {} };\n filter.statusNot.forEach(f => {\n filterIn.fields.status[f] = true;\n });\n }\n\n const [reactData, setReactData] = React.useState({\n rebuilding: false,\n selectedPersonName: null,\n displayVersion: 0,\n dataRows: [],\n OGFilter: deepCopy(filter),\n pageTitle: titleCase(title.split(/\\(/).shift().toLowerCase().replace('list', '').trim()),\n requestIDs: [],\n showDashboard: false,\n showSummary: false,\n selectionsChanged: false,\n selectAssignTo: false,\n showUpdateForm: false,\n showEventEdit: false,\n detailEdit: {},\n choiceList: [],\n statusList: [],\n isMobile: isMobile(),\n showStaffAccess: false,\n statusObj: {},\n checkInStatusObj: {},\n rowOpen: [],\n display_summary: {},\n display_summaryList: [],\n filter: deepCopy(filterIn),\n filterTextLower: (filter.filterText ? filter.filterText.toLowerCase() : null)\n });\n\n const [promptForMessage, setPromptForMessage] = React.useState(false);\n\n const [play] = useSound(AVA_AlertSound, { volume: 1 });\n\n let rowsDisplayed = [];\n let TELS_isUpdating = false;\n\n let dashboard_idleTimer = React.createRef();\n const oneMinute = 1000 * 60;\n const msBeforeSleeping = (options.idle_delay || 5) * oneMinute;\n\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n function allRowsSelected() {\n let selectedCount = 0;\n let filtered = reactData.dataRows.filter(f => {\n if (OKToDisplay(f)) {\n if (f.workData.checked) {\n selectedCount++;\n }\n return true;\n }\n return false;\n });\n return { count: filtered.length, allChecked: (selectedCount === filtered.length) };\n }\n\n const statusWords = {\n delivery: 'Delivered',\n open: 'Opened'\n };\n\n React.useEffect(() => {\n if (firstSelectedRowRef && firstSelectedRowRef.current) {\n firstSelectedRowRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n });\n }\n }, [reactData.selectionsChanged]);\n\n function makeGreeting(pName) {\n if (state.session?.custom_greeting) { return `${state.session.custom_greeting}${pName ? ', ' + pName : ''}!`; }\n else { return `Good ${makeDate(new Date()).dayPart}${pName ? ', ' + pName : ''}!`; }\n }\n\n async function handleChangeStatusSelection(statusIn) {\n let statusWord = statusIn.toLowerCase();\n if (!reactData.filter.fields.status.hasOwnProperty(statusWord)\n || !reactData.filter.fields.status[statusWord]) {\n reactData.filter.fields.status[statusWord] = true;\n reactData.filter.filtering = true;\n }\n else {\n reactData.filter.fields.status[statusWord] = false;\n reactData.filter.filtering = Object.values(reactData.filter.fields.status).some(f => {\n return f;\n });\n }\n let reactUpdateObj = {\n filter: reactData.filter\n };\n if (reactData.showSummary) {\n await prepareSummary();\n reactUpdateObj.display_summary = reactData.display_summary;\n }\n updateReactData(reactUpdateObj, true);\n\n };\n\n const handleStatusNot = event => {\n if (!reactData.filter.hasOwnProperty('statusNot')) {\n reactData.filter.statusNot = true;\n }\n else {\n reactData.filter.statusNot = !reactData.filter.statusNot;\n }\n updateReactData({\n filter: reactData.filter\n }, true);\n\n };\n\n async function handleUpdates(pOptions) {\n let historyLine;\n let messageStatusText;\n let assignedToName;\n if (pOptions.newStatus) {\n switch (pOptions.newStatus.toLowerCase()) {\n case 'printed': {\n historyLine = `Printed`;\n break;\n }\n case 'completed':\n case 'complete': {\n historyLine = `Marked complete by ${await getPerson(session.user_id, 'name')}`;\n messageStatusText = `marked it as complete`;\n break;\n }\n case 'assigned': {\n break;\n }\n default: {\n historyLine = `${await getPerson(session.user_id, 'name')} changed status to ${titleCase(pOptions.newStatus.replace('_', ' '))}`;\n messageStatusText = `changed the status to ${(pOptions.newStatus.replace('_', ' '))}`;\n }\n }\n }\n if (pOptions.assigned_to) {\n if (historyLine) {\n historyLine += ` and `;\n }\n else {\n historyLine = '';\n }\n assignedToName = await getPerson(pOptions.assigned_to, 'name');\n historyLine += `Assigned to ${assignedToName}`;\n }\n let AVAdate = makeDate(new Date());\n if (pOptions.history_update) {\n historyLine = pOptions.history_update;\n }\n else if (historyLine) {\n historyLine += ` on ${AVAdate.absolute}`;\n }\n let updateRows = [];\n let rowChanged = [];\n let rowSelected = [];\n let statusChanged = [];\n let assignmentChanged = [];\n let myNote;\n if (pOptions.enteredNote) {\n myNote = `Note added by ${await getPerson(session.user_id, 'name')} on ${AVAdate.absolute}: ${pOptions.enteredNote}`;\n }\n let OGHistoryLine = historyLine;\n for (let x = 0; x < reactData.dataRows.length; x++) {\n let r = reactData.dataRows[x];\n rowChanged[x] = false;\n rowSelected[x] = false;\n statusChanged[x] = false;\n assignmentChanged[x] = false;\n historyLine = OGHistoryLine;\n if (r.workData.checked && OKToDisplay(r)) {\n rowSelected[x] = true;\n if (pOptions.woNumber && (pOptions.woNumber !== reactData.dataRows[x].foreign_key)) {\n if (historyLine) {\n historyLine += ` and `;\n }\n else {\n historyLine = '';\n }\n historyLine += `Set Work Order number to ${pOptions.woNumber}`;\n }\n if (historyLine) {\n if (('history' in reactData.dataRows[x]) && Array.isArray(reactData.dataRows[x].history)) {\n reactData.dataRows[x].history.unshift(historyLine);\n }\n else { reactData.dataRows[x].history = [historyLine]; }\n }\n if (myNote) {\n if (('history' in reactData.dataRows[x]) && Array.isArray(reactData.dataRows[x].history)) {\n reactData.dataRows[x].history.unshift(myNote);\n }\n else { reactData.dataRows[x].history = [myNote]; }\n }\n if ((pOptions.newStatus) && (r.last_status.toLowerCase() !== pOptions.newStatus)\n && reactData.statusList.some(v => {\n return (v.value.toLowerCase() === pOptions.newStatus.toLowerCase());\n })) {\n reactData.dataRows[x].last_status = pOptions.newStatus;\n statusChanged[x] = true;\n rowChanged[x] = true;\n }\n if (pOptions.woNumber && (pOptions.woNumber !== reactData.dataRows[x].foreign_key)) {\n reactData.dataRows[x].foreign_key = pOptions.woNumber;\n statusChanged[x] = true;\n rowChanged[x] = true;\n }\n if (pOptions.assigned_to) {\n if (reactData.dataRows[x].assigned_to !== pOptions.assigned_to) {\n reactData.dataRows[x].assigned_to = pOptions.assigned_to;\n assignmentChanged[x] = true;\n rowChanged[x] = true;\n }\n }\n else {\n if (!reactData.dataRows[x].assigned_to) {\n reactData.dataRows[x].assigned_to = 'unassigned';\n }\n }\n reactData.dataRows[x].last_update = AVAdate.timestamp;\n reactData.dataRows[x].workData.update_date = AVAdate.relative;\n reactData.dataRows[x].workData.checked = false;\n let newFormattedRequest = await buildRequestDetails(reactData.dataRows[x]);\n reactData.dataRows[x].workData.formatted_request = newFormattedRequest.workData.formatted_request;\n updateRows.push(reactData.dataRows[x]);\n }\n };\n await updateServiceRequest(updateRows.map(u => {\n let w = Object.assign({}, u);\n delete w.workData;\n return w;\n }));\n rowsDisplayed = [];\n // if we assigned one or more requests to somebody, send them message(s) notifying them\n if (pOptions.assigned_to) {\n for (let this_index = 0; this_index < reactData.dataRows.length; this_index++) {\n if (rowChanged[this_index]) {\n let messageText = `A ${reactData.dataRows[this_index].workData.formatted_type},`;\n messageText += ` entered by ${reactData.dataRows[this_index].workData.enteredBy_name}`;\n messageText += ` on ${reactData.dataRows[this_index].workData.display_date}`;\n messageText += ` has been assigned to you. \\r\\n`;\n if (reactData.dataRows[this_index].hasOwnProperty('current_request')) {\n if (reactData.dataRows[this_index].current_request.selections\n && reactData.dataRows[this_index].current_request.selections.length > 0) {\n messageText += `${reactData.dataRows[this_index].workData.enteredBy_name.split(' ').shift()} selected`;\n messageText += ` ${listFromArray(reactData.dataRows[this_index].current_request.selections)}. \\r\\n`;\n }\n for (let topic in reactData.dataRows[this_index].current_request.textInput) {\n messageText += `${topic}: ${reactData.dataRows[this_index].current_request.textInput[topic]} \\r\\n`;\n }\n }\n else {\n if (reactData.dataRows[this_index].original_request.selections\n && reactData.dataRows[this_index].original_request.selections.length > 0) {\n messageText += `${reactData.dataRows[this_index].workData.enteredBy_name.split(' ').shift()} selected`;\n messageText += ` ${listFromArray(reactData.dataRows[this_index].original_request.selections)}. \\r\\n`;\n }\n for (let topic in reactData.dataRows[this_index].original_request.textInput) {\n messageText += `${topic}: ${reactData.dataRows[this_index].original_request.textInput[topic]} \\r\\n`;\n }\n }\n let messageObj = {\n client: session.client_id,\n author: session.user_id,\n messageText: messageText,\n thread_id: `svc_${reactData.dataRows[this_index].request_type}/${reactData.dataRows[this_index].request_id}`,\n recipientList: pOptions.assigned_to,\n subject: `${reactData.dataRows[this_index].workData.formatted_type} assigned to you`\n };\n await sendMessages(messageObj);\n reactData.dataRows[this_index].messages.unshift(messageObj);\n }\n }\n }\n // this section sends messages to those that were flagged to be notified\n if (pOptions.notify && pOptions.notify.length > 0) {\n let messageAuthor = await getPerson(session.user_id, 'name');\n for (let this_index = 0; this_index < reactData.dataRows.length; this_index++) {\n if (rowSelected[this_index]) {\n let notifyMessage;\n if (messageStatusText && statusChanged[this_index]) {\n notifyMessage = `${messageAuthor} has updated your ${reactData.dataRows[this_index].workData.formatted_type} from ${reactData.dataRows[this_index].workData.display_date}. They`;\n notifyMessage += ` ${messageStatusText}`;\n }\n if (assignedToName && assignmentChanged[this_index]) {\n if (notifyMessage) {\n notifyMessage += ` and assigned it to ${assignedToName}.`;\n }\n else {\n notifyMessage = `${messageAuthor} assigned your ${reactData.dataRows[this_index].workData.formatted_type} from ${reactData.dataRows[this_index].workData.display_date} to ${assignedToName}.`;\n }\n }\n if (pOptions.enteredNote) {\n if (notifyMessage) {\n notifyMessage += ` They also added this note: \"${pOptions.enteredNote}\".`;\n }\n else {\n notifyMessage = `${messageAuthor} added a note to your ${reactData.dataRows[this_index].workData.formatted_type} from ${reactData.dataRows[this_index].workData.display_date}. It says \"${pOptions.enteredNote}\"`;\n }\n }\n let recipientList = pOptions.notify.filter(n => {\n return ((n === reactData.dataRows[this_index].workData.enteredBy) || (n = reactData.dataRows[this_index].requestor));\n });\n if (notifyMessage) {\n let messageObj = {\n client: session.client_id,\n author: session.user_id,\n messageText: notifyMessage,\n thread_id: `svc_${reactData.dataRows[this_index].request_type}/${reactData.dataRows[this_index].request_id}`,\n recipientList: recipientList,\n subject: `Update to your ${reactData.dataRows[this_index].workData.formatted_type}`\n };\n await sendMessages(messageObj);\n reactData.dataRows[this_index].messages.unshift(messageObj);\n }\n }\n }\n }\n updateReactData({\n dataRows: reactData.dataRows\n }, true);\n }\n\n function sortDataRows(direction) {\n let sort_factor;\n if (direction.startsWith('des')) {\n sort_factor = -1;\n }\n else {\n sort_factor = 1;\n }\n reactData.dataRows.sort((a, b) => {\n if (!a.this_sort) {\n if (!a.workData.orderForDate.error) {\n a.this_sort = a.workData.orderForDate.timeStamp;\n }\n else {\n a.this_sort = a.request_date;\n }\n }\n if (!b.this_sort) {\n if (!b.workData.orderForDate.error) {\n b.this_sort = b.workData.orderForDate.timeStamp;\n }\n else {\n b.this_sort = b.request_date;\n }\n }\n if (a.this_sort < b.this_sort) {\n return -1 * sort_factor;\n }\n else if (a.this_sort > b.this_sort) {\n return 1 * sort_factor;\n }\n else if (a.request_date < b.request_date) {\n return -1 * sort_factor;\n }\n else {\n return 1 * sort_factor;\n }\n });\n updateReactData({\n dataRows: reactData.dataRows,\n }, true);\n }\n\n function exitModule(instruction) {\n onClose(instruction);\n setUnmount(true);\n return;\n }\n\n function getSelectedDetails() {\n let selectedIDs = [];\n let selectedName = [];\n reactData.dataRows.forEach(row => {\n if (row.workData.checked && !selectedIDs.includes(row.workData.requestor_id)) {\n selectedIDs.push(row.requestor);\n selectedName.push(row.workData.requestor_name);\n }\n });\n return { selectedIDs, selectedName };\n }\n\n async function handlePrintRequest() {\n let printList = [];\n reactData.dataRows.forEach(r => {\n if (r.workData.checked) { printList.push(r); }\n return;\n });\n let result = await printServiceRequest(printList, { PDF: true, fileName: 'test_PDF', request_type: \"force_print\" });\n enqueueSnackbar(result.message, { variant: (result.success ? 'success' : 'error'), persist: false });\n if (result.success) {\n result.preparedMessages.forEach(m => {\n if (m.preferred_method !== 'email') {\n if (m.attachments) {\n window.open(m.attachments.Location);\n }\n else if (m.pdfInfo && m.pdfInfo.s3Location) {\n window.open(m.pdfInfo.s3Location);\n }\n }\n });\n await handleUpdates({\n newStatus: 'Printed',\n });\n }\n }\n\n async function handleCreateTELS() {\n let sendList = [];\n reactData.dataRows.forEach(r => {\n if (r.workData.checked) { sendList.push(r); }\n return;\n });\n for (let x = 0; x < reactData.dataRows.length; x++) {\n let this_row = reactData.dataRows[x];\n if (!this_row.workData.checked || !OKToDisplay(this_row)) {\n continue;\n }\n // check for work order number already assigned\n if (reactData.dataRows[x].foreign_key.startsWith('TELS:')) {\n let woNum = reactData.dataRows[x].foreign_key.split('TELS:')[1].trim();\n if (!!woNum) {\n enqueueSnackbar(`The request you selected already has TELS work order number ${woNum} assigned.`, { variant: 'warning', persist: true });\n continue;\n }\n }\n\n let AVAdate = makeDate(new Date());\n let summaryDescription = `On ${this_row.workData.display_date}, `;\n if (this_row.workData.enteredBy !== this_row.requestor) {\n summaryDescription += `${this_row.workData.enteredBy_name} on behalf of `;\n }\n summaryDescription += `${this_row.workData.requestor_name} said:\\n\\r`;\n summaryDescription += this_row.workData.summary_request.filter((this_line) => {\n return (this_line[0] !== 'head');\n }).map(this_filteredLine => this_filteredLine[1]).join('\\n\\r');\n\n let user_display_name = await makeName(state.session.user_id);\n\n let TELS_facility = 138266; // 138266 is TELS global test facility\n let this_env = window.location.href.split('//')[1].charAt(0).toUpperCase();\n if ((this_env === 'D') && (this_row.workData.TELSfacilityID)) {\n TELS_facility = this_row.workData.TELSfacilityID;\n }\n\n let newTELSworkorder = {\n \"facilityId\": TELS_facility,\n \"title\": `AVA Request number ${this_row.local_key}`,\n \"description\": summaryDescription,\n \"priority\": 2,\n \"requestedBy\": this_row.workData.requestor_name,\n \"whereLocated\": this_row.workData.requestor_location,\n \"categoryId\": 1,\n \"customCategory\": \"\",\n \"customArea\": \"\",\n \"status\": 1,\n \"hasPermissionToEnter\": 1,\n \"comments\": `${user_display_name} used AVA to auto-generate this workorder in TELS on ${AVAdate.absolute}`\n };\n\n let newTELSrequest = {\n path: '/workOrders/v1/workOrders',\n method: 'POST',\n };\n\n let response = await restAPI(newTELSrequest, newTELSworkorder);\n cl(response);\n let newWOassigned = response.entityIdentifier;\n enqueueSnackbar(\n
    AVA request sent to TELS!
    \n TELS work order {newWOassigned} created.\n
    , { variant: 'success', persist: false });\n reactData.dataRows[x].foreign_key = `TELS: ${newWOassigned}`;\n let historyLine = `AVA request sent to TELS on ${AVAdate.absolute}, TELS work order ${newWOassigned} created`;\n if (('history' in reactData.dataRows[x]) && Array.isArray(reactData.dataRows[x].history)) {\n reactData.dataRows[x].history.unshift(historyLine);\n }\n else { reactData.dataRows[x].history = [historyLine]; }\n reactData.dataRows[x].last_update = AVAdate.timestamp;\n reactData.dataRows[x].workData.update_date = AVAdate.relative;\n reactData.dataRows[x].workData.checked = false;\n let newFormattedRequest = await buildRequestDetails(reactData.dataRows[x]);\n reactData.dataRows[x].workData.formatted_request = newFormattedRequest.workData.formatted_request;\n let notifyMessage = `The AVA request you entered on ${this_row.workData.display_date} has been issued a Work Order by ${user_display_name}. `;\n notifyMessage += `The Work Order number is ${newWOassigned}.`;\n if (this_row.workData.enteredBy !== this_row.requestor) {\n summaryDescription += `${this_row.workData.enteredBy_name} on behalf of `;\n }\n let messageObj = {\n client: session.client_id,\n author: session.user_id,\n messageText: notifyMessage,\n thread_id: `svc_${reactData.dataRows[x].request_type}/${reactData.dataRows[x].request_id}`,\n recipientList: reactData.dataRows[x].workData.enteredBy,\n subject: `Update to your ${reactData.dataRows[x].workData.formatted_type}`\n };\n await sendMessages(messageObj);\n reactData.dataRows[x].messages.unshift(messageObj);\n await updateServiceRequest([reactData.dataRows[x]].map(u => {\n let w = Object.assign({}, u);\n delete w.workData;\n return w;\n }));\n }\n updateReactData({\n dataRows: reactData.dataRows\n }, true);\n }\n\n let filterTimeOut;\n const handleChangeFilter = vCheck => {\n clearTimeout(filterTimeOut);\n cl(`set timeout with ${vCheck} at ${new Date().getTime()}`);\n filterTimeOut = setTimeout(() => {\n cl(`timeout ended ${vCheck} at ${new Date().getTime()}`);\n if (vCheck.length === 0) {\n updateReactData({\n filterTextLower: ''\n }, true);\n }\n else {\n updateReactData({\n filterTextLower: vCheck.toLowerCase()\n }, true);\n }\n }, 500);\n };\n\n async function prepareSummary() {\n reactData.display_summary = {};\n reactData.display_summaryList = [];\n reactData.rowOpen = [];\n let observations;\n let oType = {};\n let last_fKey;\n for (let x = 0; x < reactData.dataRows.length; x++) {\n let this_item = reactData.dataRows[x];\n if (this_item.foreign_key !== last_fKey) {\n let pDate = makeDate(this_item.foreign_key);\n observations = await dbClient\n .query({\n KeyConditionExpression: 'client_id = :c and date_key = :d',\n ExpressionAttributeValues: { ':c': this_item.client_id, ':d': pDate.ymd },\n TableName: \"Observations\",\n IndexName: \"date_key-index\"\n })\n .promise()\n .catch(error => { cl(`ERROR reading Observations by date *** caught error is: ${error}`); });\n if (recordExists(observations)) {\n last_fKey = this_item.foreign_key;\n observations.Items.forEach(o => {\n let check = o.composite_key.toLowerCase();\n ['entree', 'salad', 'soup', 'bread', 'side', 'dessert', 'beverage'].forEach(t => {\n if (check.includes(t)) {\n oType[o.observation_code] = sentenceCase(t);\n }\n });\n });\n }\n }\n if (OKToDisplay(this_item)) {\n await countThisLine(this_item, oType);\n }\n }\n // clean up Other (if possible)\n for (let oKey in reactData.display_summary) {\n if (reactData.display_summary[oKey].menuType === 'Other') {\n if (oType.hasOwnProperty(oKey)) {\n reactData.display_summary[oKey].menuType = oType.oKey;\n }\n else {\n observations = await dbClient\n .query({\n KeyConditionExpression: 'client_id = :c and begins_with(observation_code, :o)',\n ExpressionAttributeValues: { ':c': session.client_id, ':o': oKey.slice(0, 10) },\n TableName: \"Observations\",\n IndexName: \"observation_code-index\"\n })\n .promise()\n .catch(error => { cl(`ERROR reading Observations by obs_code *** caught error is: ${error}`); });\n if (recordExists(observations)) {\n let keepGoing = true;\n for (let i = 0; ((i < observations.Items.length) && (keepGoing)); i++) {\n let o = observations.Items[i];\n let check = `${o.composite_key} ${o.sort_order}`.toLowerCase();\n // eslint-disable-next-line\n ['entree', 'salad', 'soup', 'bread', 'side', 'dessert', 'beverage'].forEach(t => {\n if (check.includes(t)) {\n reactData.display_summary[oKey].menuType = sentenceCase(t);\n oType[o.observation_code] = sentenceCase(t);\n keepGoing = false;\n }\n });\n };\n }\n }\n }\n }\n ['Entree', 'Salad', 'Soup', 'Bread', 'Side', 'Dessert', 'Beverage', 'Other'].forEach(t => {\n let this_group = [];\n for (let oKey in reactData.display_summary) {\n if (reactData.display_summary[oKey].menuType === t) {\n this_group.push(reactData.display_summary[oKey]);\n }\n }\n if (this_group.length > 0) {\n this_group.sort((a, b) => {\n return (a.description > b.description ? 1 : -1);\n });\n reactData.display_summaryList.push(...this_group);\n }\n });\n return reactData.display_summaryList;\n }\n\n async function countThisLine(this_item, oType) {\n let parent;\n for (let x = 0; x < this_item.workData.summary_request.length; x++) {\n let line = this_item.workData.summary_request[x];\n if ((line[0] === 'detail') || (line[0] === 'qual')) {\n if (line[0] === 'detail') {\n if (((x + 1) < this_item.workData.summary_request.length)\n && (this_item.workData.summary_request[x + 1][0] === 'qual')) {\n parent = line[1];\n }\n else {\n parent = null;\n }\n }\n // let this_prop = `${(line[0] === 'qual') ? parent + ' - ' : ''}${line[1]}`;\n if (line[0] === 'detail') {\n if (!reactData.display_summary.hasOwnProperty(line[1])) {\n reactData.display_summary[line[1]] = {\n description: line[1],\n count: 1,\n type: line[0],\n menuType: oType[line[1]] || 'Other',\n qual: {}\n };\n reactData.rowOpen.push(false);\n }\n else {\n reactData.display_summary[line[1]].count++;\n }\n }\n else {\n if (!reactData.display_summary.hasOwnProperty(parent)) {\n reactData.display_summary[parent] = {\n description: parent,\n count: 1,\n type: line[0],\n menuType: oType[parent] || 'Other',\n qual: {\n [line[1]]: 1\n }\n };\n reactData.rowOpen.push(false);\n }\n else if (!reactData.display_summary[parent].qual.hasOwnProperty(line[1])) {\n reactData.display_summary[parent].qual[line[1]] = 1;\n }\n else {\n reactData.display_summary[parent].qual[line[1]]++;\n }\n }\n }\n };\n }\n\n function OKToDisplay(this_item) {\n if (reactData.filter.filtering) {\n if (this_item.last_status && reactData.filter.fields.status[this_item.last_status.toLowerCase()]) {\n // We know we're filtering for something, and it turns out we care about this item\n // because it's status is checked off. Reject the line if we are looking for rows\n // whose status is NOT this status\n if (reactData.filter.statusNot) {\n return false;\n }\n }\n else if (!reactData.filter.statusNot) {\n // We know we're filtering for something, but this item's status is not being filtered for at all\n // If status NOT is false, then we are rejecting items that have a status that is not\n // checked off, so reject me\n return false;\n }\n }\n // You are OK on status. Check for search words...\n if ((!this_item.workData) || (!reactData.filterTextLower)) {\n return true;\n }\n else {\n let response = (`${this_item.workData.enteredBy_name} ${this_item.workData.search_data}`).toLowerCase().includes(reactData.filterTextLower);\n if (!response && this_item.workData.notes_section) {\n response = this_item.workData.notes_section.some(note => {\n return note[1].toLowerCase().includes(reactData.filterTextLower);\n });\n }\n return response;\n }\n }\n\n function OKToDisplayStatus(this_status) {\n if (!(reactData.statistics.count.hasOwnProperty(this_status))) {\n return false;\n }\n if (reactData.filter.filtering) {\n if (reactData.filter.fields.status[this_status]) {\n // this status IS checked off\n return !!!reactData.filter.statusNot;\n }\n else {\n // this status IS NOT checked off\n return !!reactData.filter.statusNot;\n }\n }\n return true;\n }\n\n function toggleCheck(pI) {\n reactData.dataRows[pI].workData.checked = !reactData.dataRows[pI].workData.checked;\n updateReactData({\n dataRows: reactData.dataRows\n }, true);\n }\n\n function commonFKey() {\n let commonKey;\n let multipleKeys = reactData.dataRows.some(row => {\n if (row.workData.checked) {\n if (!commonKey) {\n commonKey = row.foreign_key;\n return false;\n }\n return (row.foreign_key !== commonKey);\n }\n return false;\n });\n if (multipleKeys) {\n return null;\n }\n else {\n return commonKey;\n }\n }\n\n function getRequestors() {\n let response = {};\n reactData.dataRows.forEach(r => {\n if (r.workData.checked) {\n if (response.hasOwnProperty(r.workData.enteredBy)) {\n response[r.workData.enteredBy].count++;\n }\n else {\n response[r.workData.enteredBy] = {\n name: r.workData.enteredBy_name,\n count: 1\n };\n }\n if (r.requestor !== r.workData.enteredBy) {\n if (response.hasOwnProperty(r.requestor)) {\n response[r.requestor].count++;\n }\n else {\n response[r.requestor] = {\n name: r.on_behalf_of,\n count: 1\n };\n }\n }\n }\n });\n let responseList = [];\n for (let key in response) {\n let this_obj = {\n value: key,\n label: response[key].name,\n count: response[key].count\n };\n responseList.push(this_obj);\n };\n return responseList;\n }\n\n function anyRowsSelected() {\n return reactData.dataRows.some(r => {\n return (r.workData.checked && OKToDisplay(r));\n });\n }\n\n function allowTELS() {\n return reactData.dataRows.some(r => {\n return (r.workData.checked && r.workData.allowTELS && OKToDisplay(r));\n });\n }\n\n function checklistSelected() {\n let selectedRow = false;\n let checklistRow = { OK: false, reason: 'No checklist row selected' };;\n reactData.dataRows.forEach(r => {\n if (r.workData.checked && OKToDisplay(r)) {\n // a selected row that is visible\n if (selectedRow && (checklistRow.OK || (r.workData.flavor === 'checklist'))) { // is there already a selected row? if so, reject\n return { OK: false, reason: 'You selected multiple rows, which included at least one checklist' };\n }\n selectedRow = true;\n if (r.workData.flavor === 'checklist') { // is this row a checklist type of request?\n checklistRow = {\n OK: true,\n rowIndex: r,\n foreign_key: r.foreign_key\n };\n }\n }\n });\n return checklistRow;\n }\n\n const firstSelectedRow = () => {\n return reactData.dataRows.findIndex(this_row => { // find first checked row\n return this_row.workData.checked;\n });\n };\n\n async function toggleOpen(pI) {\n reactData.dataRows[pI].workData.open = !reactData.dataRows[pI].workData.open;\n if (!reactData.dataRows[pI].workData.messageRecs) {\n reactData.dataRows[pI].workData.messageRecs = await prepareMessageHistory(reactData.dataRows[pI].request_id);\n }\n updateReactData({\n dataRows: reactData.dataRows\n }, true);\n }\n\n async function getCurrentStatus(client_id, person_id, mode) {\n let reqArray = await getServiceRequests({ client_id, person_id, foreign_key: mode, request_type: \"checkout\" });\n if (reqArray.length === 0) {\n return {\n last_status: 'none',\n last_update: 0,\n history: [],\n last_visited_name: await makeName(state.patient.person_id)\n };\n }\n else {\n let returnObj = {\n last_update: reqArray[0].last_update,\n last_visited: reqArray[0].last_visited,\n history: reqArray[0].history,\n reqRec: reqArray[0]\n };\n if ((reqArray[0].last_visited && (reqArray[0].last_status === 'in'))) {\n returnObj.last_status = 'in';\n returnObj.last_visited_name = (reqArray[0].last_visited ? await makeName(reqArray[0].last_visited) : '');\n }\n else {\n returnObj.last_status = 'out';\n returnObj.last_visited_name = await makeName(state.patient.person_id);\n }\n return returnObj;\n }\n }\n\n async function prepareMessageHistory(thread) {\n let qR = await getMessages({ 'thread_id': thread });\n let mRow = [];\n let workingKey = '';\n qR.forEach(r => {\n switch (r.record_type) {\n case 'message': {\n mRow.push({\n 'sort': `${r.composite_key}.000`,\n 'body': ['head', `Message ${makeDate(r.created_time).relative}`]\n });\n mRow.push({\n 'sort': `${r.composite_key}.001`,\n 'body': ['detail', 'Sent to:']\n });\n mRow.push({\n 'sort': `${r.composite_key}~Z999.000`,\n 'body': ['detail', 'Message said:']\n });\n r.content.current['EN-US'].text.split('\\r\\n').forEach((m, mX) => {\n mRow.push({\n 'sort': `${r.composite_key}~Z999.${mX + 100}`,\n 'body': ['qual', m]\n });\n });\n workingKey = r.composite_key;\n break;\n }\n case 'delivery': {\n let nameOut = (`${r.recipient_list.name.first} ${r.recipient_list.name.last}`).trim();\n let postedWord = makeDate(r.results[0].posted_time).relative;\n mRow.push({\n 'sort': `${workingKey}.${r.recipient_list.name.last}/${r.recipient_list.name.first}`,\n 'body': ['qual', `${nameOut} - ${statusWords[r.results[0].result] || r.results[0].result} ${postedWord}`]\n });\n break;\n };\n default: { }\n }\n });\n mRow.sort((a, b) => {\n if (a.sort > b.sort) { return 1; }\n if (a.sort < b.sort) { return -1; }\n return 0;\n });\n return mRow.map(r => { return r.body; });\n };\n\n const buildDashboard = async () => {\n await setStatusList();\n let qList = [];\n if (filter.assigned_to) {\n updateReactData({\n selectedPersonName: `Requests assigned to ${await makeName(filter.assigned_to)}`\n }, true);\n }\n else if (filter.person_id) {\n let pName = await makeName(filter.person_id);\n updateReactData({\n selectedPersonName: `${pName}'${pName.slice(-1) === 's' ? '' : 's'} Activity`\n }, true);\n }\n if ((!filter.hasOwnProperty('client_id') || !filter.client_id)) {\n filter.client_id = session.client_id;\n }\n filter.request_type = makeArray(filter.request_type, ',');\n if (!filter.hasOwnProperty('sort')) {\n filter.sort = 'desc';\n };\n qList = await getServiceRequests(filter);\n let maxTimeStamp = 0;\n reactData.dataRows = [];\n reactData.requestIDs = [];\n for (let x = 0; (x < qList.length); x++) {\n if (qList[x].request_date > maxTimeStamp) {\n maxTimeStamp = qList[x].request_date;\n }\n if (qList[x].request_id !== `${qList[x].requestor}_checkout`) {\n reactData.dataRows.push(await buildRequestDetails(qList[x]));\n reactData.requestIDs.push(qList[x].request_id);\n if ((x % 5) === 0) { // every 5th entry, commit to the screen\n updateReactData({\n lastTimeStamp: maxTimeStamp,\n dataRows: reactData.dataRows,\n requestIDs: reactData.requestIDs,\n rebuilding: false,\n }, true);\n }\n }\n }\n if (loading !== 'rebuild') {\n if (filter.person_id\n && (!filter.request_type\n || (filter.request_type.length === 0)\n || ((filter.request_type.length > 0) && filter.request_type.includes('event')))) {\n let eList = await getCalendarEntries({ person_id: filter.person_id });\n for (let x = 0; (x < eList.length); x++) {\n reactData.dataRows.push(await buildRequestFromEvent(eList[x]));\n }\n sortDataRows(filter.sort);\n }\n updateReactData({\n lastTimeStamp: maxTimeStamp,\n dataRows: reactData.dataRows,\n requestIDs: reactData.requestIDs,\n rebuilding: false,\n }, true);\n }\n if ((qList.length === 0) || (reactData.dataRows.length === 0)) {\n enqueueSnackbar(`No requests were found`, { variant: 'error', persist: false });\n }\n else {\n // Capture statistics\n let nowTime = new Date().getTime();\n const msInADay = 1000 * 60 * 60 * 24;\n let count = {};\n let open_closed = {\n 'closed': 'na',\n 'open': 'na'\n };\n let total_open_time = {};\n let total_idle_time = {}; // time since last activity\n let oldest_requests = {}; // track 5 oldest\n qList.forEach(this_request => {\n let row_status = this_request.last_status;\n do {\n if (count.hasOwnProperty(row_status)) {\n count[row_status]++;\n if (open_closed[row_status] === 'closed') {\n total_open_time[row_status] += (this_request.last_update - this_request.request_date);\n total_idle_time[row_status] += 0;\n }\n else {\n total_open_time[row_status] += (nowTime - this_request.request_date);\n total_idle_time[row_status] += (nowTime - this_request.last_update);\n }\n if (this_request.request_date < oldest_requests[row_status][4].request_date) {\n let age = (nowTime - this_request.request_date) / msInADay;\n oldest_requests[row_status][4] = {\n request_date: this_request.request_date,\n request_id: this_request.request_id,\n age,\n };\n oldest_requests[row_status].sort((a, b) => {\n if (a.request_date < b.request_date) {\n return -1;\n }\n else {\n return 1;\n }\n });\n }\n }\n else {\n if (!open_closed.hasOwnProperty(row_status)) {\n // eslint-disable-next-line\n if (reactData.statusObj.hasOwnProperty(row_status)) {\n open_closed[row_status] = (!!reactData.statusObj[row_status].open ? 'open' : 'closed');\n }\n else {\n open_closed[row_status] = 'closed';\n }\n }\n count[row_status] = 1;\n if (open_closed[row_status] === 'closed') {\n total_open_time[row_status] = (this_request.last_update - this_request.request_date);\n total_idle_time[row_status] = 0;\n }\n else {\n total_open_time[row_status] = (nowTime - this_request.request_date);\n total_idle_time[row_status] = (nowTime - this_request.last_update);\n }\n oldest_requests[row_status] = [{\n request_date: this_request.request_date,\n request_id: this_request.request_id,\n age: (nowTime - this_request.request_date) / msInADay\n }];\n for (let x = 1; x <= 4; x++) {\n oldest_requests[row_status][x] = {\n request_date: Number.MAX_SAFE_INTEGER,\n request_id: ''\n };\n }\n };\n row_status = open_closed[row_status];\n } while (row_status !== 'na');\n });\n let average_open_time = {};\n let average_time_since_last_activity = {};\n let color = {};\n let value_word = {};\n for (let this_status in count) {\n // will give average time in days\n average_open_time[this_status] = (total_open_time[this_status] / count[this_status]) / msInADay;\n if (reactData.statusObj.hasOwnProperty(this_status)) {\n [color[this_status], value_word[this_status]] = setColor(average_open_time[this_status], (reactData.statusObj[this_status].age));\n }\n else {\n color[this_status] = '#a7d2f8';\n }\n if (open_closed[this_status] === 'open') {\n average_time_since_last_activity[this_status] = (total_idle_time[this_status] / count[this_status]) / msInADay;\n }\n }\n updateReactData({\n statistics: {\n count,\n total_open_time,\n total_idle_time, // time since last activity\n oldest_requests,\n average_open_time,\n average_time_since_last_activity,\n color,\n value_word,\n open_closed\n }\n }, false);\n }\n if (dashboard_idleTimer && dashboard_idleTimer.current) {\n dashboard_idleTimer.current.start();\n cl(`Idle timer started in dashboard at ${new Date().toLocaleString()}.`);\n }\n };\n\n function setColor(value, rangeObj) {\n const color_gradient = ['#5ffb76', '#00fbbb', '#00f5ec', '#53ecff', '#9fe0ff', '#a7d2f8', '#b0c3ed', '#b8b5dd', '#c177bc', '#cb4f99', '#ce0e6a'];\n const gradient_word = ['Excellent', 'Excellent', 'Good', 'Good', 'OK', 'OK', 'OK', 'Low', 'Low', 'Poor', 'Poor'];\n let low = 0;\n let med = 5;\n let high = 10;\n if (rangeObj) {\n low = rangeObj.good || 0;\n med = rangeObj.ok || 5;\n high = rangeObj.bad || 10;\n }\n let x;\n if (value <= low) {\n x = 0;\n }\n else if (value >= high) {\n x = 10;\n }\n else if (value < med) {\n x = Math.round(((value - low) / (med - low)) * 5);\n }\n else {\n x = Math.round(((high - value) / (high - med)) * 5) + 6;\n }\n return [color_gradient[x], gradient_word[x]];\n }\n\n const extendDashboard = async () => {\n if (reactData.rebuilding) {\n return;\n }\n let qQ = { TableName: 'ServiceRequestLog' };\n qQ.KeyConditionExpression = 'client_id = :c and log_time > :lt';\n qQ.ExpressionAttributeValues = { ':c': session.client_id, ':lt': reactData.lastTimeStamp };\n let qR = await dbClient\n .query(qQ)\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n console.log(`Security Violation or no Internet Connection`);\n }\n console.log({ 'Error reading ServiceRequests': error, index: qQ.IndexName, qQ });\n });\n let newRecordsFound = false;\n let maxTimeStamp = reactData.lastTimeStamp;\n let playAlert = false;\n if (recordExists(qR)) {\n for (let x = 0; (x < qR.Items.length); x++) {\n let newKey = qR.Items[x].request_id;\n if (!reactData.requestIDs.includes(newKey)) {\n let request_timestamp = Number(newKey.split('~').pop());\n if (!isNaN(request_timestamp)) {\n maxTimeStamp = Math.max(maxTimeStamp, request_timestamp);\n reactData.requestIDs.push(newKey);\n let qList = await getServiceRequests({\n client_id: session.client_id,\n request_id: newKey\n });\n if (filter.foreign_key && (filter.foreign_key === qList[0].foreign_key)) {\n /*\n if ((filter.statusNot && filter.statusNot.includes(qList[0].last_status.toLowerCase()))\n || (filter['status'] && !(filter.status.includes(qList[0].last_status.toLowerCase())))) {\n continue;\n }\n else {\n */\n newRecordsFound = true;\n let newRow = await buildRequestDetails(qList[0]);\n reactData.dataRows.push(newRow);\n if (OKToDisplay(newRow)) {\n playAlert = true;\n }\n // }\n }\n }\n }\n }\n }\n if (newRecordsFound) {\n updateReactData({\n lastTimeStamp: maxTimeStamp,\n dataRows: reactData.dataRows\n }, true);\n if (playAlert) {\n play();\n }\n }\n if (dashboard_idleTimer && dashboard_idleTimer.current) {\n dashboard_idleTimer.current.start();\n cl(`Idle timer restarted in dashboard at ${new Date().toLocaleString()}.`);\n }\n };\n\n async function orderWarning(pKey) {\n const showWarning = new Promise((resolve, reject) => {\n let response = '';\n const snackAction = (\n \n \n \n \n );\n enqueueSnackbar(\n `You marked off all ${pKey} items on the list. Would you like to mark the request complete and close it?`,\n { variant: 'warning', persist: true, action: snackAction }\n );\n });\n let rValue = await showWarning;\n closeSnackbar();\n return rValue;\n }\n\n async function buildRequestDetails(this_request) {\n this_request.workData = {};\n this_request.workData.search_data = '';\n if (!this_request.hasOwnProperty('current_request')) {\n this_request.current_request = deepCopy(this_request.original_request);\n }\n if (session.service_request_types.hasOwnProperty(this_request.request_type)) {\n this_request.workData.formatted_type = session.service_request_types[this_request.request_type].description || `${titleCase(this_request.request_type)}`;\n this_request.workData.flavor = session.service_request_types[this_request.request_type].flavor || '';\n this_request.workData.allowTELS = session.service_request_types[this_request.request_type].allowTELS || false;\n this_request.workData.TELSfacilityID = session.service_request_types[this_request.request_type].TELSfacilityID || false;\n }\n else {\n cl(`request type \"${this_request.request_type}\" not in session.service_request_types`);\n this_request.workData.formatted_type = titleCase(this_request.request_type.replace('_', ' '));\n this_request.workData.flavor = '';\n this_request.workData.allowTELS = false;\n }\n let [enteredBy, requestTimeStamp] = this_request.request_id.split('~');\n this_request.workData.enteredBy = enteredBy;\n if (!('request_date' in this_request)) { this_request.request_date = requestTimeStamp; }\n let AVAupdateDate = makeDate(this_request.last_update);\n let AVArequestDate = makeDate(this_request.request_date);\n this_request.workData.display_date = AVArequestDate.relative; // the date/time the request was first created\n let anonymous = false;\n if (!this_request.requestor) {\n if (this_request.composite_key) {\n this_request.requestor = this_request.composite_key.split('%')[0];\n }\n else {\n this_request.requestor = this_request.request_id.split('~')[0];\n }\n }\n let requestorRec = await getPerson(this_request.requestor, '*all');\n this_request.workData.requestor_name = await makeName(this_request.requestor);\n if (this_request.requestor !== enteredBy) {\n this_request.workData.enteredBy_name = await makeName(enteredBy);\n }\n else {\n this_request.workData.enteredBy_name = this_request.workData.requestor_name;\n }\n this_request.workData.requestor_location = requestorRec.location;\n this_request.workData.requestor_image = await getImage(this_request.requestor);\n this_request.workData.formatted_request = [];\n this_request.workData.summary_request = [];\n this_request.workData.notes_section = [];\n this_request.workData.textBased_request = [];\n this_request.workData.update_date = AVAupdateDate.relative;\n this_request.workData.requestTime = AVArequestDate.timestamp;\n this_request.workData.orderForDate = makeDate(this_request.foreign_key); // result is intentionally an invalid date\n this_request.workData.this_status = sentenceCase(this_request.last_status);\n if (!options.textForm && !options.selectOnly) {\n let aName = '';\n if (this_request.assigned_to && (this_request.assigned_to !== 'unassigned') && (reactData.statusObj[this_request.last_status] && reactData.statusObj[this_request.last_status].open)) {\n aName = await makeName(this_request.assigned_to);\n }\n if (this_request.last_status) {\n this_request.workData.formatted_request.push(['head', `${(titleCase(this_request.last_status.replace('_', ' ')))} ${aName ? ('- ' + aName) : ''}`]);\n }\n }\n if ((!options.shortForm) && (!options.textForm) && !options.selectOnly) {\n if (this_request.foreign_key.startsWith('TELS:')) {\n this_request.workData.formatted_request.push(['head', `TELS work order ${this_request.foreign_key.split('TELS:')[1].trim()}`]);\n }\n if (AVAupdateDate.relative !== AVArequestDate.relative) {\n this_request.workData.formatted_request.push(['head', `Updated: ${this_request.workData.update_date}`]);\n }\n this_request.workData.formatted_request.push(['head', 'Details']);\n }\n this_request.workData.textBased_request[0] = AVArequestDate.relative;\n this_request.workData.textBased_request.push(`${this_request.workData.formatted_type}`);\n if (!anonymous) {\n let pLine = '';\n if (!filter.person_id) {\n pLine += this_request.workData.requestor_name;\n }\n if (this_request.workData.enteredBy !== this_request.requestor) {\n pLine += `by ${this_request.workData.enteredBy_name}`;\n }\n if (pLine) {\n this_request.workData.textBased_request.push(pLine);\n }\n }\n if (('current_request' in this_request) && (typeof (this_request.current_request) !== 'string')) {\n anonymous = (this_request.current_request.selections && this_request.current_request.selections.join(' ').includes('anonymous'));\n let [fReq, fSearch, fText] = formatRequest(this_request, this_request.current_request);\n this_request.workData.textBased_request.push(fText);\n this_request.workData.formatted_request.push(...fReq);\n this_request.workData.search_data += ` ${fSearch}`;\n }\n else if ('current_request' in this_request) {\n anonymous = this_request.current_request.includes('anonymous');\n this_request.workData.formatted_request.push(['detail', this_request.current_request || 'No information available']);\n this_request.workData.textBased_request.push(this_request.current_request);\n this_request.workData.search_data += ` ${this_request.current_request}`;\n }\n else if (('original_request' in this_request) && (typeof (this_request.original_request) !== 'string')) {\n anonymous = (this_request.original_request.selections && this_request.original_request.selections.join(' ').includes('anonymous'));\n let [fReq, fSearch, fText] = formatRequest(this_request, this_request.original_request);\n this_request.workData.textBased_request.push(fText);\n this_request.workData.formatted_request.push(...fReq);\n this_request.workData.search_data += ` ${fSearch}`;\n }\n else {\n anonymous = this_request.original_request.includes('anonymous');\n this_request.workData.formatted_request.push(['detail', this_request.original_request || 'No information available']);\n this_request.workData.textBased_request.push(this_request.original_request);\n this_request.workData.search_data += ` ${this_request.original_request}`;\n }\n if (this_request.attachments && (this_request.attachments.length > 0)) {\n this_request.attachments.forEach(a => {\n let fNArr = a.split('/').pop().split('.');\n fNArr.pop();\n let fName = decodeURI(fNArr.join('.'));\n this_request.workData.formatted_request.push([`href=${a}`, fName]);\n });\n }\n if (anonymous) {\n this_request.workData.requestor_name = 'Anonymous';\n this_request.workData.enteredBy_name = 'Anonymous';\n this_request.workData.requestor_location = null;\n this_request.workData.requestor_image = null;\n }\n this_request.workData.search_data += this_request.workData.requestor_name;\n this_request.workData.summary_request = this_request.workData.formatted_request;\n let historyList = [];\n let noteList = [];\n if ((!options.textForm) && (!options.selectOnly)) {\n this_request.workData.formatted_request = [];\n if ('history' in this_request) {\n // updateHistoryList takes each history line and determines if it contains \"note added\"\n // if it does, then it includes that information on the notelist, otherwise the line is added to historylist\n if (typeof (this_request.history) === 'string') {\n updateHistoryList(this_request.history);\n }\n else if (Array.isArray(this_request.history)) {\n this_request.history.forEach(h => {\n if (typeof h === 'string') {\n updateHistoryList(h);\n }\n });\n }\n else {\n Object.values(this_request.history).forEach(h => {\n updateHistoryList(h);\n });\n }\n }\n\n this_request.workData.formatted_request.push(['head', 'History']);\n if (historyList.length === 0) {\n this_request.workData.formatted_request.push(['detail', '*** None ***']);\n }\n else {\n historyList.forEach(hLine => {\n this_request.workData.formatted_request.push(['detail', hLine]);\n });\n }\n\n if (noteList.length > 0) {\n this_request.workData.notes_section.push(['head', 'Notes']);\n noteList.forEach(nLine => {\n this_request.workData.notes_section.push(['detail', nLine]);\n });\n }\n\n let mHist = await messageHistory({\n thread_id: `svc_${this_request.request_type}/${this_request.request_id}`,\n type: 'delivery'\n });\n if (mHist && (mHist.length > 0)) {\n this_request.workData.formatted_request.push(['head', 'Messages']);\n mHist.map(h => { return this_request.workData.formatted_request.push(['detail', h]); });\n }\n this_request.workData.search_data += `~ ${requestorRec.location} ~ ${this_request.workData.requestor_name} ~ ${this_request.workData.enteredBy_name}`;\n if (this_request.last_status && ['closed', 'completed', 'complete', 'cancelled'].includes(this_request.last_status.toLowerCase())) {\n this_request.workData.search_data += ` ~ closed`;\n }\n else { this_request.workData.search_data += ` ~ open`; }\n }\n this_request.workData.checked = false;\n this_request.workData.open = false;\n return this_request;\n\n function updateHistoryList(text) {\n if (text.startsWith('Note added')) {\n noteList.push(text.replace('Note added by ', ''));\n }\n else {\n historyList.push(text);\n }\n return;\n }\n }\n\n async function buildRequestFromEvent(this_event) {\n let response = {\n workData: {\n search_data: ''\n }\n };\n response.workData.this_status = 'Signed-up';\n response.workData.flavor = 'event';\n response.workData.formatted_type = 'Event';\n if (session.service_request_types.hasOwnProperty('event')) {\n response.workData.formatted_type = session.service_request_types['event'].description || `Event`;\n if (session.service_request_types['event'].hasOwnProperty('statusList')) {\n let foundStatus = (session.service_request_types['event'].statusList.find(x => {\n return (x.value === this_event?.slotData?.status?.current);\n }));\n if (foundStatus) {\n response.workData.this_status = foundStatus.display;\n }\n }\n }\n\n let AVArequestDate = makeDate(this_event.event_key.split('#')[1]);\n let AVAupdateDate = null;\n response.request_date = AVArequestDate.date.getTime();\n response.workData.display_date = AVArequestDate.relative; // the date/time the request was first created\n response.workData.requestTime = AVArequestDate.timestamp;\n\n if (this_event.slotData?.status) {\n if (this_event.slotData?.status?.history) {\n AVAupdateDate = makeDate(this_event.slotData?.status?.history[0].date);\n response.workData.update_date = AVAupdateDate.relative;\n }\n }\n\n response.requestor = this_event.slotData.owner;\n response.workData.enteredBy = this_event.slotData.owner;\n response.workData.requestor_name = this_event.slotData.name;\n response.workData.enteredBy_name = this_event.slotData.name;\n\n let requestorRec = await getPerson(this_event.slotData.owner, '*all');\n response.workData.requestor_location = requestorRec.location;\n response.workData.requestor_image = await getImage(this_event.slotData.owner);\n\n response.workData.formatted_request = [];\n response.workData.summary_request = [];\n response.workData.notes_section = [];\n response.workData.textBased_request = [];\n\n if ((!options.shortForm) && (!options.textForm) && !options.selectOnly) {\n if (AVAupdateDate.relative !== AVArequestDate.relative) {\n response.workData.formatted_request.push(['head', `Updated: ${AVAupdateDate.relative}`]);\n }\n response.workData.formatted_request.push(['head', 'Details']);\n }\n response.workData.textBased_request[0] = AVArequestDate.relative;\n response.workData.textBased_request.push(`${response.workData.formatted_type}`);\n\n response.workData.search_data += response.workData.requestor_name;\n response.workData.summary_request = response.workData.formatted_request;\n response.workData.checked = false;\n response.workData.open = false;\n return response;\n }\n\n function formatRequest(this_request, req) {\n let returnMessage = [];\n let returnText = '';\n let returnSearch = '';\n if (!('textInput' in req)) { req.textInput = {}; }\n if (!('qualifiers' in req)) { req.qualifiers = []; }\n if (!('selections' in req)) { req.selections = []; }\n if (!filter.person_id && (this_request.workData.requestor_name !== this_request.on_behalf_of)) {\n returnMessage.push(['detail', `For ${this_request.on_behalf_of}`]);\n returnText += ` on behalf of ${this_request.on_behalf_of}`;\n }\n let textLink = '';\n req.selections.forEach(s => {\n let dLine = s.trim();\n let [selection, ...opts] = dLine.split(/[();,]/);\n let options = opts.map(o => { return o.trim(); });\n if (req.hasOwnProperty('qualifiers')\n && req.qualifiers.hasOwnProperty(selection.trim())\n ) {\n Object.values(req.qualifiers[selection.trim()]).forEach(choiceList => {\n choiceList.forEach(c => {\n let choice = c.trim();\n if (!options.includes(choice)) {\n options.push(choice);\n }\n });\n });\n }\n returnMessage.push(['detail', selection.trim()]);\n returnText += `${textLink} ${selection.trim()}`;\n let rTextList = [];\n if (options.length > 0) {\n // let q = parts.shift().split(/[;,]/);\n options.forEach(qx => {\n let outO = titleCase(qx.trim());\n if (outO !== '') {\n returnMessage.push(['qual', outO]);\n rTextList.push(outO);\n }\n });\n }\n if (s in req.textInput) {\n returnMessage.push(['qual', req.textInput[s]]);\n rTextList.push(req.textInput[s]);\n delete req.textInput[s];\n }\n if (rTextList.length > 0) {\n returnText += `(${rTextList.join(', ')})`;\n textLink = ';';\n }\n returnSearch += ` ${dLine}`;\n }); // done with all selections; is there any text left?\n for (let k in req.textInput) {\n if (['-stamped', '-date', '-ymd'].some(w => { return k.includes(w); })) { continue; }\n if (typeof req.textInput[k] === 'string') {\n if (req.textInput[k] !== this_request.on_behalf_of) {\n let kLow = k.toLowerCase().trim();\n returnSearch += ` ${req.textInput[k]}`;\n if (['description', 'summary', 'details'].some(w => { return kLow.includes(w); })) {\n returnMessage.unshift(['text', req.textInput[k]]);\n returnText += `${textLink} ${req.textInput[k]}`;\n }\n else {\n returnMessage.push(['text', `${k} - ${req.textInput[k]}`]);\n returnText += `${textLink} ${k} - ${req.textInput[k]}`;\n }\n }\n }\n };\n return [returnMessage, returnSearch, returnText];\n }\n\n const setChoices = async (inList) => {\n if (reactData.choiceList.length > 0) { return; }\n let response = [];\n let memberInfo = await getMemberList(inList, session.client_id, { \"sort\": true, \"exclude\": false });\n /* getMemberList returns\n {\n peopleList: [],\n groupList: []\n }\n */\n let mInfo;\n let pLL = memberInfo.peopleList.length;\n for (let e = 0; e < pLL; e++) {\n let p = memberInfo.peopleList[e];\n let searchString = [...Object.values(p.name), p.search_data, p.location].join(' ');\n if (p.messaging) { searchString += Object.values(p.messaging).join(' '); }\n // list is of the form ::\n try {\n mInfo = `${p.name.last}, ${p.name.first}:${p.person_id}:${searchString}`;\n response.push(mInfo);\n }\n catch (error) {\n cl(`response push error at index ${e} with ${mInfo}`);\n }\n };\n updateReactData({\n choiceList: response\n }, false);\n };\n\n const setStatusList = async (inList) => {\n if (reactData.statusList.length > 0) { return; }\n let response = [];\n let responseObj = {};\n if (filter.request_type\n && (state.session.service_request_types.hasOwnProperty(filter.request_type[0]))\n && state.session.service_request_types[filter.request_type[0]].statusList) {\n response = state.session.service_request_types[filter.request_type[0]].statusList;\n state.session.service_request_types[filter.request_type[0]].statusList.forEach(s => {\n responseObj[s.value] = s;\n });\n }\n else {\n response = [\n {\n display: 'Submitted',\n value: 'submitted'\n },\n {\n display: 'In Process',\n value: 'in_process'\n },\n {\n display: 'Complete/Closed',\n value: 'complete'\n }\n ];\n responseObj = {\n 'submitted': {\n display: 'Submitted',\n value: 'submitted'\n },\n 'in_process': {\n display: 'In Process',\n value: 'in_process'\n },\n 'complete': {\n display: 'Complete/Closed',\n value: 'complete'\n }\n };\n }\n updateReactData({\n statusList: response,\n statusObj: responseObj\n }, false);\n };\n\n\n React.useEffect(() => {\n async function initialize() {\n setLoading('initial_load');\n await buildDashboard();\n setLoading('load_complete');\n }\n initialize();\n }, [session]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n // ******************\n\n return (\n \n {reactData.dataRows &&\n \n {/* Idle timer always running */}\n {\n let now = new Date();\n cl(`Active in dashboard at ${now.toLocaleString()}. Idle since ${new Date(dashboard_idleTimer.current.state.lastIdle).toLocaleString()}`);\n }}\n onIdle={async () => {\n cl(`Idle fired in dashboard at ${new Date().toLocaleString()}. Last active at ${new Date(dashboard_idleTimer.current.state.lastActive).toLocaleString()}. Previous idle at ${new Date(dashboard_idleTimer.current.state.lastIdle).toLocaleString()}`);\n await extendDashboard();\n }}\n startOnMount={true}\n debounce={250}\n />\n\n {/* Header with Avatar, Message, and VertMenu */}\n \n \n \n {((filter.person_id || filter.assigned_to) && reactData.selectedPersonName)\n ? reactData.selectedPersonName\n : reactData.pageTitle\n }\n \n {!options.viewMode && !options.selectOnly &&\n \n \n \n \n (handleChangeFilter(event.target.value))}\n width={'100%'}\n className={classes.freeInput}\n inputProps={{ style: { fontSize: `${user_fontSize}rem`, lineHeight: `${user_fontSize * 1.2}rem` } }}\n variant={'standard'}\n autoComplete='off'\n />\n \n {!reactData.showDashboard && !reactData.showSummary &&\n {\n let sort_factor;\n if (reactData.filter.sort.startsWith('des')) {\n reactData.filter.sort = 'asc';\n sort_factor = 1;\n }\n else {\n reactData.filter.sort = 'des';\n sort_factor = -1;\n }\n reactData.dataRows.sort((a, b) => {\n if (!a.this_sort) {\n if (!a.workData.orderForDate.error) {\n a.this_sort = a.workData.orderForDate.timeStamp;\n }\n else {\n a.this_sort = a.request_date;\n }\n }\n if (!b.this_sort) {\n if (!b.workData.orderForDate.error) {\n b.this_sort = b.workData.orderForDate.timeStamp;\n }\n else {\n b.this_sort = b.request_date;\n }\n }\n if (a.this_sort < b.this_sort) {\n return -1 * sort_factor;\n }\n else if (a.this_sort > b.this_sort) {\n return 1 * sort_factor;\n }\n else if (a.request_date < b.request_date) {\n return -1 * sort_factor;\n }\n else {\n return 1 * sort_factor;\n }\n });\n updateReactData({\n dataRows: reactData.dataRows,\n filter: reactData.filter\n }, true);\n }}\n >\n \n {`Showing ${(reactData?.filter?.sort && reactData?.filter?.sort.startsWith('des')) ? 'Newest' : 'Oldest'} first`}\n \n \n \n }\n \n {(filter.foreign_key || filter.statusNot || filter.status) &&\n \n \n \n {'Filters'}\n \n {filter.showNotBox &&\n }\n label={\n \n {'Not...'}\n }\n />\n }\n \n {filter.foreign_key &&\n \n {`For ${makeDate(filter.foreign_key).absolute}`}\n \n }\n \n {reactData.statusList.map((this_status, this_status_index) => (\n {\n await handleChangeStatusSelection(this_status.value);\n }}\n key={`status_selector_${this_status_index}`}\n id={`status_selector_${this_status_index}`}\n control={\n }\n label={\n \n {titleCase(this_status.display)}\n }\n />\n ))}\n \n \n }\n \n }\n \n {options.selectOnly &&\n \n \n \n {`${makeDate(new Date()).dateOnly.split(',').pop().trim()}`}\n \n \n {`${makeDate(new Date()).timeOnly.split(' ').join('').toLowerCase()}`}\n \n \n \n {\n handleClick(event);\n setPopupMenuOpen(true);\n }}\n alt=''\n src={process.env.REACT_APP_AVA_LOGO}\n />\n { setPopupMenuOpen(false); }}\n keepMounted>\n \n {\n onClose();\n }}>\n \n \n {'Exit'}\n \n \n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n {`User ${state.session.user_id}${state.session.patient_id !== state.session.user_id ? (' (' + state.session.patient_id + ')') : ''}`}\n {`Function: Calendar`}\n \n \n \n
    \n \n \n }\n \n\n {/* Main List */}\n {!reactData.showDashboard && !reactData.showSummary &&\n \n \n \n {rowsDisplayed = []}\n \n {reactData.dataRows.map((this_item, index) => (\n (OKToDisplay(this_item, index) &&\n \n \n {rowsDisplayed.push(index)}\n \n {\n e.preventDefault();\n enqueueSnackbar(
    \n Type={this_item.request_type}
    \n Requestor={this_item.requestor}
    \n ForeignKey={this_item.foreign_key}
    \n LastUpdate={makeDate(this_item.last_update).absolute}
    \n ReqTime={makeDate(this_item.workData.requestTime).absolute}
    \n ForDate={this_item.workData.orderForDate.absolute}
    \n ID={this_item.request_id}\n
    , { variant: 'info', persist: true });\n }}>\n \n \n {!options.noSelect &&\n { toggleCheck(index); }}\n />\n }\n {!filter.person_id &&\n \n }\n
    \n {!options.textForm &&\n { toggleOpen(index); }} flexGrow={1} flexDirection='row' justifyContent='space-between' alignItems='center'>\n \n \n \n {(!filter.request_type || (filter.request_type.length !== 1)) &&\n \n {this_item.workData.formatted_type}\n \n }\n {!filter.person_id &&\n \n {this_item.hasOwnProperty('current_request')\n ?\n \n {`${this_item.workData.requestor_name} ${this_item?.current_request?.textInput['Room Number'] ? ('(' + this_item?.current_request?.textInput['Room Number'] + ')') : (\n this_item.workData.requestor_location ? ('(' + this_item.workData.requestor_location + ')') : '')}`}\n \n :\n \n {`${this_item.workData.requestor_name} ${this_item?.original_request?.textInput['Room Number'] ? ('(' + this_item?.original_request?.textInput['Room Number'] + ')') : (\n this_item.workData.requestor_location ? ('(' + this_item.workData.requestor_location + ')') : '')}`}\n }\n \n }\n {this_item.workData.updated &&\n \n {this_item.workData.updated}\n \n }\n {!options.selectOnly &&\n \n {(this_item.requestor !== this_item.workData.enteredBy) &&\n \n {`By ${this_item.workData.enteredBy_name}`}\n \n }\n \n {this_item.workData.display_date}\n \n {(!options.hasOwnProperty('showForeignKey') || options.showForeignKey)\n && !(this_item?.workData?.orderForDate.error)\n &&\n \n {`For ${this_item?.workData?.orderForDate.relative}`}\n \n }\n \n }\n \n \n {!options.textForm\n && !options.selectOnly\n && this_item?.workData?.summary_request\n && this_item.workData.summary_request.map((mSumLine, mSumIndex) => (\n \n {typeof mSumLine[1] === 'string' ? mSumLine[1] : (alert(mSumIndex, mSumLine))}\n \n ))\n }\n {!options.selectOnly\n && this_item?.workData?.notes_section\n && this_item.workData.notes_section.map((mLine, mIndex) => (\n \n {typeof mLine[1] === 'string' ? mLine[1] : (alert(index, mLine))}\n \n ))}\n {this_item.workData.open\n && !options.selectOnly\n && this_item?.workData?.formatted_request\n && this_item.workData.formatted_request.map((mLine, mIndex) => (\n (mLine[0].startsWith('href=')\n ?\n \n \n {`Attachment: ${mLine[1]}`}\n \n \n :\n < Typography\n key={`prefLine-${mIndex}`}\n className={(`mrow${mLine[0]}` in classes) ? classes[`mrow${mLine[0]}`] : classes.mrowdetail}\n >\n {typeof mLine[1] === 'string' ? mLine[1] : (alert(index, mLine))}\n \n )\n ))}\n {this_item.workData.open && !options.selectOnly &&\n this_item.workData.messageRecs.map((mLine, dX) => (\n \n {mLine[1]}\n \n ))\n }\n \n \n }\n {options.textForm &&\n { toggleOpen(index); }} flexGrow={1} flexDirection='column' justifyContent='center' alignItems='flex-start'>\n {this_item.workData.textBased_request.map((textLine, tX) =>\n ') ? { bold: true } : {})}\n key={`singleTextLine-${index}_${tX}`}\n className={classes.mrowdetail}\n >\n {textLine.replace('', '')}\n \n )}\n \n }\n \n \n \n )\n ))}\n {(rowsDisplayed.length === 0) && (loading === 'load_complete') &&\n \n \n {`No requests match your criteria`}\n \n \n }\n
    \n \n }\n\n {/* Main Dashboard */}\n {reactData.showDashboard &&\n \n \n {reactData.statusList.map((this_status, this_status_index) => (\n (OKToDisplayStatus(this_status.value) &&\n \n \n \n \n \n {reactData.statusObj[this_status.value].display}\n \n \n {`Count: ${reactData.statistics.count[this_status.value]}`}\n \n \n {`Avg ${(reactData.statistics.open_closed[this_status.value] === 'open') ? 'Age' : 'Days to Close'}: ${reactData.statistics.average_open_time[this_status.value].toFixed(1)} days`}\n \n {reactData.statistics.average_time_since_last_activity.hasOwnProperty(this_status.value) &&\n \n \n {`Avg Time Since Last Activity: ${reactData.statistics.average_time_since_last_activity[this_status.value].toFixed(1)} days`}\n \n \n {`Age of Oldest: ${reactData.statistics.oldest_requests[this_status.value][0].age.toFixed(1)} days`}\n \n \n }\n \n \n {reactData.statistics.value_word[this_status.value]}\n \n \n \n \n )\n ))}\n \n \n }\n\n\n {/* Summary */}\n {reactData.showSummary &&\n \n \n {reactData.display_summaryList.map((this_item, this_index) => (\n \n \n {((this_index === 0) || (this_item.menuType !== reactData.display_summaryList[this_index - 1].menuType)) &&\n \n {this_item.menuType}\n \n }\n {\n reactData.rowOpen[this_index] = !reactData.rowOpen[this_index];\n updateReactData({\n rowOpen: reactData.rowOpen\n }, true);\n }}\n >\n \n {`${this_item.description} - ${this_item.count}${(this_item.qual && (Object.keys(this_item.qual).length > 0)) ? '*' : ''}`}\n \n \n {reactData.rowOpen[this_index]\n && Object.keys(this_item.qual).sort().map((qText, qX) => (\n \n {`${qText} - ${this_item.qual[qText]}`}\n \n )\n )}\n \n \n ))}\n \n \n };\n\n {/* Prompts */}\n {\n promptForMessage &&\n { setPromptForMessage(false); }}\n onComplete={() => { setPromptForMessage(false); }}\n setMethod={null}\n allowCancel={true}\n />\n }\n {\n reactData.selectAssignTo &&\n {\n updateReactData({\n selectAssignTo: false\n }, true);\n }}\n onSelect={async (selectedPerson) => {\n let printList = [];\n reactData.dataRows.forEach(r => {\n if (r.workData.checked) { printList.push(r); }\n return;\n });\n await handleUpdates({\n newStatus: 'Assigned',\n assigned_to: selectedPerson.split(/:|%%/)[1]\n });\n updateReactData({\n selectAssignTo: false\n }, true);\n }}\n />\n }\n {reactData.showUpdateForm && (options && options.woNumber) &&\n {\n return !s.hasOwnProperty('selectable') || s.selectable;\n }),\n null,\n getRequestors()\n ]}\n buttonText={'Update'}\n onCancel={() => {\n updateReactData({\n showUpdateForm: false\n }, true);\n }}\n onSave={async (response) => {\n await handleUpdates({\n woNumber: response[0],\n newStatus: response[1],\n enteredNote: response[2],\n notify: response[3]\n });\n updateReactData({\n showUpdateForm: false\n }, true);\n }}\n />\n }\n {reactData.showUpdateForm && (!options || !options.woNumber) &&\n {\n return !s.hasOwnProperty('selectable') || s.selectable;\n }),\n null,\n getRequestors()\n ]}\n buttonText={'Update'}\n onCancel={() => {\n updateReactData({\n showUpdateForm: false\n }, true);\n }}\n onSave={async (response) => {\n await handleUpdates({\n woNumber: null,\n newStatus: response[0],\n enteredNote: response[1],\n notify: response[2]\n });\n updateReactData({\n showUpdateForm: false\n }, true);\n }}\n />\n }\n {\n reactData.showStaffAccess && false &&\n (['in'].includes(reactData.checkInStatusObj.last_status) ?\n {\n updateReactData({\n showStaffAccess: false\n }, true);\n }}\n onSave={async (responses) => {\n let now = makeDate(new Date());\n reactData.checkInStatusObj.reqRec.last_status = 'out';\n reactData.checkInStatusObj.reqRec.last_update = now.timestamp;\n reactData.checkInStatusObj.reqRec.type_date = `${reactData.checkInStatusObj.reqRec.request_type}~${now.timestamp}`;\n let hNote = `Checked out on ${now.absolute}`;\n /* if we have other data to capture (\"did you complete your task?\", \"issues to note\", etc.)\n those notes would be captured in prompts and be saved here\n responses.forEach((r, x) => {\n if (r && reactData.residentPrompts) {\n hNote += ` ${reactData.residentPrompts[x]}: ${r}.`;\n }\n });\n */\n reactData.checkInStatusObj.reqRec.history.unshift(hNote);\n let newFormattedRequest = await buildRequestDetails(reactData.dataRows[reactData.checkInStatusObj.targetIndex]);\n reactData.dataRows[reactData.checkInStatusObj.targetIndex].workData.formatted_request = newFormattedRequest.workData.formatted_request;\n await updateServiceRequest([reactData.checkInStatusObj.reqRec]);\n enqueueSnackbar(`Check-out successful!`, { variant: 'success', persist: false });\n updateReactData({\n showStaffAccess: false\n }, true);\n }}\n allowCancel={true}\n options={{ save_on_enter: true }}\n />\n :\n {\n if (selected_person) {\n /**** FUTURE\n let now = makeDate(new Date());\n Object.assign((reactData.checkInStatusObj.reqRec || {}), reactData.dataRows[reactData.checkInStatusObj.targetIndex]);\n reactData.checkInStatusObj.reqRec.last_status = 'in';\n reactData.checkInStatusObj.reqRec.last_update = now.timestamp;\n reactData.checkInStatusObj.reqRec.type_date = `${reactData.checkInStatusObj.reqRec.request_type}~${now.timestamp}`;\n let hNote = `${state.session.patient_display_name} checked in to ${selected_person} on ${now.absolute}`;\n reactData.checkInStatusObj.reqRec.history.unshift(hNote);\n reactData.checkInStatusObj.reqRec.last_visited = reactData.dataRows[reactData.checkInStatusObj.targetIndex].requestor;\n let newFormattedRequest = await buildRequestDetails(reactData.dataRows[reactData.checkInStatusObj.targetIndex]);\n reactData.dataRows[reactData.checkInStatusObj.targetIndex].workData.formatted_request = newFormattedRequest.workData.formatted_request;\n await updateServiceRequest([reactData.checkInStatusObj.reqRec]);\n enqueueSnackbar(`Check-in successful!`, { variant: 'success', persist: false });\n *****/\n }\n updateReactData({\n showStaffAccess: false,\n dataRows: reactData.dataRows\n }, true);\n }}\n />\n\n )\n }\n\n {\n reactData.showStaffAccess &&\n {\n if (selected_person) {\n /**** FUTURE\n let now = makeDate(new Date());\n Object.assign((reactData.checkInStatusObj.reqRec || {}), reactData.dataRows[reactData.checkInStatusObj.targetIndex]);\n reactData.checkInStatusObj.reqRec.last_status = 'in';\n reactData.checkInStatusObj.reqRec.last_update = now.timestamp;\n reactData.checkInStatusObj.reqRec.type_date = `${reactData.checkInStatusObj.reqRec.request_type}~${now.timestamp}`;\n let hNote = `${state.session.patient_display_name} checked in to ${selected_person} on ${now.absolute}`;\n reactData.checkInStatusObj.reqRec.history.unshift(hNote);\n reactData.checkInStatusObj.reqRec.last_visited = reactData.dataRows[reactData.checkInStatusObj.targetIndex].requestor;\n let newFormattedRequest = await buildRequestDetails(reactData.dataRows[reactData.checkInStatusObj.targetIndex]);\n reactData.dataRows[reactData.checkInStatusObj.targetIndex].workData.formatted_request = newFormattedRequest.workData.formatted_request;\n await updateServiceRequest([reactData.checkInStatusObj.reqRec]);\n enqueueSnackbar(`Check-in successful!`, { variant: 'success', persist: false });\n *****/\n let now = makeDate(new Date());\n await handleUpdates({\n newStatus: `in_process`,\n history_update: `${state.session.patient_display_name} checked in to ${selected_person[0].location} (${selected_person[0].display_name || selected_person[0].name}) on ${now.absolute}`\n });\n }\n updateReactData({\n showStaffAccess: false,\n dataRows: reactData.dataRows\n }, true);\n }}\n />\n }\n\n\n {/* Buttons */}\n {\n ((loading === 'load_complete') || (reactData.dataRows.length > 0)) &&\n (!options.viewMode) && (!options.selectOnly) &&\n // Command Area\n \n \n \n }\n >\n {reactData.isMobile ? 'Exit' : 'Close'}\n \n {options.allowDashboard && reactData.statistics &&\n {\n updateReactData({\n showDashboard: !reactData.showDashboard\n }, true);\n }}\n startIcon={reactData.showDashboard ? : }\n >\n {reactData.showDashboard ? 'List' : 'Dashboard'}\n \n }\n {(rowsDisplayed.length > 0) &&\n \n {anyRowsSelected() &&\n {\n rowsDisplayed.forEach((r) => {\n reactData.dataRows[r].workData.checked = false;\n });\n updateReactData({\n dataRows: reactData.dataRows,\n selectionsChanged: !reactData.selectionsChanged\n }, true);\n }}\n startIcon={}\n >\n {'None'}\n \n }\n {!options.noSelect &&\n {\n rowsDisplayed.forEach((r, x) => {\n reactData.dataRows[r].workData.checked = true;\n });\n updateReactData({\n dataRows: reactData.dataRows,\n selectionsChanged: !reactData.selectionsChanged\n }, true);\n }}\n startIcon={}\n >\n {`All ${allRowsSelected().count}`}\n \n }\n \n }\n {options.allowSummary\n && !options.noSelect\n && ((rowsDisplayed.length > 0) || reactData.showSummary)\n &&\n {\n await prepareSummary();\n updateReactData({\n display_summary: reactData.display_summary,\n showSummary: !reactData.showSummary\n }, true);\n }}\n startIcon={reactData.showSummary ? : }\n >\n {reactData.showSummary ? 'List' : 'Summary'}\n \n }\n {!options.noSelect\n && (rowsDisplayed.length > 0)\n &&\n {\n let allRows = allRowsSelected();\n let anySelected = anyRowsSelected();\n if (!anySelected || allRows.allChecked) {\n await printRawData(\n reactData.dataRows.filter((r, x) => {\n return (OKToDisplay(r));\n }),\n state\n );\n }\n else {\n await printRawData(\n reactData.dataRows.filter((r, x) => {\n return (r.workData.checked && OKToDisplay(r));\n }),\n state\n );\n }\n }}\n startIcon={}\n >\n {`Print Report`}\n \n }\n \n \n {anyRowsSelected() &&\n (!filter.person_id) &&\n {\n setPromptForMessage(getSelectedDetails());\n }}\n startIcon={}\n >\n {reactData.isMobile ? null : 'Message'}\n \n }\n {anyRowsSelected() && options.allowAssign &&\n {\n await setChoices(options.allowAssign);\n updateReactData({\n selectAssignTo: true\n }, true);\n }}\n startIcon={}\n >\n {'Assign'}\n \n }\n {anyRowsSelected() && false &&\n {\n let checkInStatusObj = await getCurrentStatus(session.client_id, session.patient_id, 'staff');\n checkInStatusObj.targetIndex = // check in / check out only applies to the FIRST checked-off row\n reactData.dataRows.findIndex(r => {\n return r.workData.checked;\n });\n let checklist_info = checklistSelected();\n let cEntries;\n let listOfPeopleToVisit = [];\n if (checklist_info.OK) {\n cEntries = await getCalendarEntries({\n client: session.client_id,\n event_id: checklist_info.foreign_key,\n type: 'slot'\n });\n cEntries.forEach(e => {\n if (e.slotData && !e.marked && (e.slotData?.status?.current !== 'released')) {\n let [first, last] = (e.slotData.display_name || e.slotData.name).split(' ');\n listOfPeopleToVisit.push({\n id: e.slot_owner,\n first: first,\n last: last\n });\n }\n });\n }\n else {\n let [first, last] = (reactData.dataRows[checkInStatusObj.targetIndex].workData.requestor_name).split(' ');\n listOfPeopleToVisit = [{\n id: reactData.dataRows[checkInStatusObj.targetIndex].requestor,\n first: first,\n last: last\n }];\n }\n updateReactData({\n showStaffAccess: true,\n listOfPeopleToVisit: listOfPeopleToVisit,\n checkInStatusObj: checkInStatusObj\n }, true);\n }}\n startIcon={}\n >\n {'Access'}\n \n }\n {anyRowsSelected() &&\n {\n let checklist_info = checklistSelected();\n if (checklist_info.OK) {\n let cEntries = await getCalendarEntries({\n person_id: session.patient_id,\n client: session.client_id,\n event_id: checklist_info.foreign_key\n });\n let this_event = {\n event_key: checklist_info.foreign_key\n };\n this_event.occData = Object.assign({},\n cEntries[0].eventData.event_data,\n cEntries[0].eventData,\n { location: cEntries[0].eventData.event_data.location.description },\n { signup_type: cEntries[0].eventData.sign_up.type },\n cEntries[1],\n { date: cEntries[1].occurrence_date },\n { time$: `${cEntries[0].eventData.event_data.time.from}${((cEntries[0].eventData.event_data.time.to && cEntries[0].eventData.event_data.time.to.trim() !== '') ? ' to ' + cEntries[0].eventData.event_data.time.to : '')}` },\n { time24: this_event.time24 }\n );\n updateReactData({\n showEventEdit: true,\n detailEdit: this_event\n }, true);\n }\n else {\n await setStatusList();\n updateReactData({\n showUpdateForm: true\n }, true);\n }\n }}\n startIcon={}\n >\n {'Update'}\n \n }\n {anyRowsSelected()\n &&\n {\n await handlePrintRequest();\n }}\n startIcon={}\n >\n {reactData.isMobile ? null : 'Print'}\n \n }\n {allowTELS()\n &&\n {\n if (!TELS_isUpdating) {\n TELS_isUpdating = true;\n await handleCreateTELS();\n TELS_isUpdating = false;\n }\n }}\n startIcon={}\n >\n {'Send to TELS'}\n \n }\n \n \n \n }\n {\n ((loading === 'load_complete') || (reactData.dataRows.length > 0)) &&\n (options.selectOnly) && (anyRowsSelected()) &&\n // Command Area\n \n \n \n {\n await handlePrintRequest();\n }}\n startIcon={}\n >\n {'Check me in!'}\n \n \n \n \n }\n {\n ((loading === 'load_complete') || (reactData.dataRows.length > 0)) &&\n (options.viewMode) &&\n // Command Area\n \n \n \n {\n onClose('exit');\n }}\n startIcon={}\n >\n {reactData.isMobile ? 'Exit' : 'Close'}\n \n {false && {\n exitModule('continue');\n }}\n startIcon={}\n >\n {reactData.isMobile ? 'Add New' : 'Add a New Request'}\n \n }\n \n \n \n }\n {\n (loading === 'load_complete') && reactData.showEventEdit &&\n {\n if (occData.summaryInfo.listComplete) {\n let requestAction = await orderWarning(occData.summaryInfo.markedSlots);\n if (requestAction === 'close') {\n await handleUpdates({\n newStatus: 'complete',\n enteredNote: `${occData.summaryInfo.markedSlots} of ${occData.summaryInfo.ownedSlots} items marked off`,\n });\n }\n }\n updateReactData({\n showEventEdit: false\n }, true);\n }}\n />\n }\n \n }\n \n );\n};","import React from 'react';\nimport Dialog from '@material-ui/core/Dialog';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport useSession from '../../hooks/useSession';\n\nimport { titleCase, lambda } from '../../util/AVAUtilities';\nimport AVATextInput from './AVATextInput';\n\nexport default ({ report_id, title, buttonText, requestor, options, onClose }) => {\n\n const { state } = useSession();\n const isMobile = useMediaQuery(theme => theme.breakpoints.down('sm')); // checks if current device is a smart phone\n\n const [reactData] = React.useState({\n imageSize: options.safeMode ? 50 : (isMobile ? 100 : 150),\n report_id,\n title,\n buttonText,\n options: [options].flat(),\n payload: {\n client_id: state.session.client_id,\n requestor: requestor || state.session.user_id\n },\n lambda_parms: {\n FunctionName: `arn:aws:lambda:us-east-1:125549937716:function:${report_id}`,\n InvocationType: 'RequestResponse',\n LogType: 'Tail'\n },\n alert: false\n });\n\n // ******************\n\n return (\n \n { return (this_option.prompt || titleCase(this_option.field) || `Field ${oNdx}`); })}\n buttonText={reactData.buttonText || 'Submit'}\n valueText={reactData.options.map((this_option) => { return (this_option.default_value || ''); })}\n onCancel={() => {\n onClose({\n alert: {\n severity: 'info',\n title: 'Cancelled',\n message: `You cancelled the ${reactData.title} request.`\n }\n });\n }}\n onSave={async (response) => {\n let targetObj = {};\n for (let [ndx, this_response] of response.entries()) {\n targetObj[reactData.options[ndx].field_name] = this_response;\n }\n reactData.lambda_parms.Payload = JSON.stringify(Object.assign(reactData.payload, targetObj));\n let goodSubmit = true;\n lambda\n .invoke(reactData.lambda_parms)\n .promise()\n .catch(err => {\n onClose({\n alert: {\n severity: 'error',\n title: 'Error',\n message: `AVA encountered an error while requesting your report. Error is ${err.message}`\n }\n });\n goodSubmit = false;\n });\n if (goodSubmit) {\n onClose({\n alert: {\n severity: 'success',\n title: 'Submitted',\n message: `Your ${reactData.title} report was successfully submitted.\\n\\rYou'll receive a message when it's complete. `\n }\n });\n }\n }}\n />\n \n );\n};","import React from 'react';\nimport { titleCase, cl } from '../../util/AVAUtilities';\nimport { makeDate, makeTime } from '../../util/AVADateTime';\nimport { getImage, getPerson } from '../../util/AVAPeople';\nimport { getCalendarEntries, occurrenceData } from '../../util/AVACalendars';\nimport { getMessages } from '../../util/AVAMessages';\nimport AVAConfirm from '../forms/AVAConfirm';\nimport AVATextInput from '../forms/AVATextInput';\n\nimport { useSnackbar } from 'notistack';\n// import useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport List from '@material-ui/core/List';\n\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport EditIcon from '@material-ui/icons/Edit';\n\nimport Button from '@material-ui/core/Button';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\n\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport TextField from '@material-ui/core/TextField';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport SendIcon from '@material-ui/icons/Send';\nimport SendMessageDialog from '../dialogs/SendMessageDialog';\n\nimport HomeIcon from '@material-ui/icons/Home';\nimport AutorenewIcon from '@material-ui/icons/Autorenew';\n\nimport Avatar from '@material-ui/core/Avatar';\nimport Menu from '@material-ui/core/Menu';\nimport MenuList from '@material-ui/core/MenuList';\nimport MenuItem from '@material-ui/core/MenuItem';\n\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport CircularProgress from '@material-ui/core/CircularProgress';\n\nconst useStyles = makeStyles(theme => ({\n page: {\n height: 950,\n maxWidth: 1000\n },\n freeInput: {\n marginLeft: '25px',\n marginRight: 2,\n marginBottom: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: theme.spacing(1),\n width: '90%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n },\n imageArea: {\n minWidth: '100px',\n maxWidth: '100px',\n minHeight: '100px',\n maxHeight: '100px',\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n buttonArea: {\n maxWidth: 1000,\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n rowButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'contained',\n size: 'small'\n },\n rowButtonDefault: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.primary[theme.palette.type],\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n color: theme.palette.reject[theme.palette.type],\n },\n rowButtonGreen: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.confirm[theme.palette.type],\n },\n rowButtonBlue: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.info[theme.palette.type],\n },\n listItem: {\n justifyContent: 'space-between',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(1),\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n makeIconStyle: {\n marginRight: theme.spacing(1),\n },\n locationLine: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n preferenceLine: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n mrowhead: {\n marginTop: 10,\n fontSize: theme.typography.fontSize * 1.2,\n fontWeight: 'bold'\n },\n mrowdetail: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n mrowqual: {\n fontSize: theme.typography.fontSize * 1.0,\n marginLeft: 10,\n },\n techInfoLine: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(2),\n },\n techInfoLine2: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(4),\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n firstName: {\n fontSize: theme.typography.fontSize * 1.4,\n marginRight: theme.spacing(1),\n },\n timeLine: {\n fontSize: theme.typography.fontSize * 1.4,\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1.5),\n },\n lastName: {\n fontWeight: 'bold',\n fontSize: theme.typography.fontSize * 1.8,\n marginRight: theme.spacing(1),\n },\n messageArea: {\n alignItems: 'center',\n justifyContent: 'space-between',\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(0),\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n title: {\n marginTop: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginLeft: theme.spacing(2),\n marginBottom: 0,\n fontSize: theme.typography.fontSize * 1.5,\n fontWeight: 'bold',\n },\n subTitle: {\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(0.5),\n marginLeft: theme.spacing(2),\n fontSize: theme.typography.fontSize * 1.2\n },\n popUpMenu: {\n marginRight: theme.spacing(3),\n paddingRight: 2,\n },\n popUpMenuRow: {\n marginLeft: theme.spacing(1),\n fontSize: theme.typography.fontSize * 1.0,\n },\n popUpFooter: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n}));\n\nexport default ({ session, filter = {}, onClose }) => {\n\n /*\n filter: {\n person_id - only show this person\n request_type - (optional) only show requests of this type\n request_date - (optional)\n if string or number or array with one entry, choose only this date\n if array with exactly two entries, use as start and end\n }\n */\n\n const { enqueueSnackbar } = useSnackbar();\n\n const classes = useStyles();\n\n const [dataRows, setDataRows] = React.useState();\n const [allRows, setAllRows] = React.useState();\n const [moreRows, setMoreRows] = React.useState();\n\n const [request_filter, setRequestFilter] = React.useState('');\n const [request_filter_lower, setRequestFilterLower] = React.useState('');\n const [singleFilterDigit, setSingleFilterDigit] = React.useState(false);\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n\n const [showReactError,] = React.useState(false);\n const [showAddPrompt, setShowAddPrompt] = React.useState(false);\n const [deletePending, setDeletePending] = React.useState(false);\n const showDeleted = false;\n const [confirmMessage, setConfirmMessage] = React.useState('');\n const [confirmID, setConfirmID] = React.useState('');\n const [confirmIndex, setConfirmIndex] = React.useState('');\n\n const [loading, setLoading] = React.useState();\n\n const [promptForUpdate, setPromptForUpdate] = React.useState(false);\n\n const [popupMenuOpen, setPopupMenuOpen] = React.useState(false);\n const [anchorEl, setAnchorEl] = React.useState(null);\n\n const [progress, setProgress] = React.useState(0);\n const [pWidth, setPWidth] = React.useState(60);\n\n const [rowLimit, setRowLimit] = React.useState(20);\n const scrollValue = 5;\n var rowsWritten;\n\n const handleClick = async (event) => {\n setAnchorEl(event.currentTarget);\n };\n\n const requestNames = {\n maint: 'Maintenance Request',\n meal: 'Meal Order',\n guest_room: 'Guest Room Reservation Request',\n trans: 'Transportation Request',\n breakfast: 'Breakfast Order'\n };\n\n const statusWords = {\n delivery: 'Delivered',\n open: 'Opened'\n };\n\n function createMessageText() {\n let mData = {};\n let mCount = 0;\n let pM = '';\n dataRows.forEach(r => {\n if (r.workData.checked) {\n if (!(r.request_type in mData)) { mData[r.request_type] = []; }\n mData[r.request_type].push(r.workData.display_date);\n mCount++;\n }\n });\n if (mCount === 0) { return null; }\n if (mCount > 1) { pM += ` ${mCount} prior requests:`; }\n let linkWord = '';\n for (let t in mData) {\n let mL = mData[t].length - 1;\n pM += `${linkWord} ${requestNames[t] || 'request'}`;\n if (mL > 0) { pM += 's'; }\n pM += ' from';\n for (let x = 0; x <= mL; x++) {\n if (mData[t][x].startsWith('Last ')) { pM += ` last ${mData[t][x].slice(5)}`; }\n else { pM += ` ${mData[t][x]}`; }\n if ((mL > 1) && (x < mL)) { pM += ','; }\n if ((x + 1) === (mL)) { pM += ' and'; }\n };\n linkWord = ', and';\n }\n return pM.trim();\n }\n\n async function handleUpdates([newStatus, checked, newNote]) {\n let historyLine = '';\n if (newStatus) { historyLine += `Status changed to \"${newStatus}\"`; }\n else if (checked === 'checked') { historyLine += 'Status changed to \"Complete\"'; }\n if (newNote) {\n if (historyLine) { historyLine += ' and '; }\n historyLine += `Note that said \"${newNote.trim()}\" added`;\n }\n let thisPerson = await getPerson(session.patient_id, 'name');\n historyLine += ` by ${thisPerson}`;\n if (session.patient_id !== session.user_id) { historyLine += ` (proxy=${session.user_id})`; }\n let AVAdate = makeDate(new Date());\n historyLine += ` on ${AVAdate.absolute}`;\n let updateRows = [];\n for (let x = 0; x < dataRows.length; x++) {\n let r = dataRows[x];\n if (r.workData.checked) {\n if (newStatus && (newStatus !== '')) { r.last_status = newStatus; }\n else if (checked === 'checked') { r.last_status = 'Complete'; }\n r.last_update = AVAdate.timestamp;\n r.workData.update_date = AVAdate.relative;\n if (newNote) { r.last_note = newNote; }\n if (('history' in r) && Array.isArray(r.history)) {\n r.history.unshift(historyLine);\n }\n else { r.history = [historyLine]; }\n updateRows.push(r);\n dataRows[x] = await buildCalendarDetails(r);\n }\n };\n //updateCalendarRequest(updateRows.map(u => {\n // let w = Object.assign({}, u);\n // delete w.workData;\n // return w;\n //}));\n dataRows.sort((a, b) => {\n if (a.last_update > b.last_update) { return -1; }\n if (a.last_update < b.last_update) { return 1; }\n return 0;\n });\n setDataRows(dataRows);\n setForceRedisplay(!forceRedisplay);\n }\n\n const handleChangeRequestFilter = event => {\n if (event.target.value.length === 0) {\n setRequestFilter(null);\n setRequestFilterLower(null);\n }\n else {\n setRequestFilter(event.target.value);\n setRequestFilterLower(event.target.value.toLowerCase());\n setSingleFilterDigit(event.target.value.length === 1);\n }\n setRowLimit(scrollValue);\n };\n\n const handleRemoveMessage = async (pMessage_id, pIndex) => {\n // will mark request as cancelled as send appropriate messages \n };\n\n\n const onScroll = async (event) => {\n if (dataRows.length < allRows.length) {\n let promiseArr = [];\n let stopAt = Math.min(allRows.length, (dataRows.length + scrollValue));\n for (let x = dataRows.length; x < stopAt; x++) {\n promiseArr.push(\n await buildCalendarDetails(allRows[x])\n .then((good, bad) => {\n if (good) { dataRows[x] = good; }\n else { console.log(bad); }\n })\n );\n }\n await Promise.all(promiseArr);\n setDataRows(dataRows);\n setRowLimit(dataRows.length);\n cl(`scroll done - now ${dataRows.length} rows of ${allRows.length} loaded`);\n setMoreRows(allRows.length > dataRows.length);\n setForceRedisplay(!forceRedisplay);\n }\n else { cl(`scroll ignored`); }\n };\n\n function toggleCheck(pI) {\n dataRows[pI].workData.checked = !dataRows[pI].workData.checked;\n setDataRows(dataRows);\n setForceRedisplay(!forceRedisplay);\n }\n\n async function toggleOpen(pI) {\n dataRows[pI].workData.open = !dataRows[pI].workData.open;\n if (!dataRows[pI].workData.messageRecs) {\n dataRows[pI].workData.messageRecs = await prepareMessage(dataRows[pI].request_id);\n }\n setDataRows(dataRows);\n setForceRedisplay(!forceRedisplay);\n }\n\n async function prepareMessage(thread) {\n let qR = await getMessages({ 'thread_id': thread });\n let mRow = [];\n let workingKey = '';\n qR.forEach(r => {\n switch (r.record_type) {\n case 'message': {\n mRow.push({\n 'sort': `${r.composite_key}.000`,\n 'body': ['head', `Message ${makeDate(r.created_time).relative}`]\n });\n mRow.push({\n 'sort': `${r.composite_key}.001`,\n 'body': ['detail', 'Sent to:']\n });\n mRow.push({\n 'sort': `${r.composite_key}~Z999.000`,\n 'body': ['detail', 'Message said:']\n });\n r.content.current['EN-US'].text.split('\\r\\n').forEach((m, mX) => {\n mRow.push({\n 'sort': `${r.composite_key}~Z999.${mX + 100}`,\n 'body': ['qual', m]\n });\n });\n workingKey = r.composite_key;\n break;\n }\n case 'delivery': {\n let nameOut = (`${r.recipient_list.name.first} ${r.recipient_list.name.last}`).trim();\n let postedWord = makeDate(r.results[0].posted_time).relative;\n mRow.push({\n 'sort': `${workingKey}.${r.recipient_list.name.last}/${r.recipient_list.name.first}`,\n 'body': ['qual', `${nameOut} - ${statusWords[r.results[0].result] || r.results[0].result} ${postedWord}`]\n });\n break;\n };\n default: { }\n }\n });\n mRow.sort((a, b) => {\n if (a.sort > b.sort) { return 1; }\n if (a.sort < b.sort) { return -1; }\n return 0;\n });\n return mRow.map(r => { return r.body; });\n };\n\n function filteredRequest(pRec) {\n if (singleFilterDigit) { return true; }\n else {\n return (`${pRec.workData.search_data} ${pRec.workData.formatted_type}`).toLowerCase().includes(request_filter_lower);\n }\n }\n\n const buildDashboard = async () => {\n let qList = [];\n setProgress(0);\n qList = await getCalendarEntries({\n client_id: session.client_id,\n type: 'occurrence'\n });\n setProgress(25);\n if (qList.length === 0) {\n enqueueSnackbar(`The Calendar is empty!`, { variant: 'error', persist: false });\n onClose();\n }\n setAllRows(qList);\n let workingList = [];\n for (let x = 0; x < Math.min(qList.length, scrollValue); x++) {\n workingList.push(await buildCalendarDetails(qList[x]));\n setProgress(25 + ((x / qList.length) * 75));\n }\n setDataRows(workingList);\n return { dataRows: workingList, allRows: qList };\n };\n\n async function buildCalendarDetails(i) {\n let [e, o,] = i.event_key.split('#');\n let thisEntry = await occurrenceData({\n 'client_id': i.client,\n 'type': 'occurrence',\n 'event': e,\n 'occurrence': o\n });\n i.workData = {};\n i.workData.formatted_type = thisEntry.description;\n i.workData.display_date = thisEntry.date.relative;\n i.workData.formatted_request = [];\n let location = i.location;\n if (thisEntry.location) {\n if (typeof thisEntry.location === 'string') { location = thisEntry.location; }\n else { location = thisEntry.location.description; }\n }\n if (location) {\n i.workData.formatted_request.push(['head', titleCase(location)]);\n }\n i.workData.start_time = thisEntry.time || i.time_from;\n if (i.slotData) {\n let owner = i.slotData.owner || i.slot_owner;\n i.workData.requestor_image = await getImage(owner);\n let this_slot = (i.slotData.slot || i.slotData.id);\n let list_type = (this_slot === owner);\n if (isNaN(Number(this_slot)) && !list_type) { i.workData.formatted_request.push(['detail', this_slot]); }\n else {\n let slot_number = Number(this_slot);\n if ((slot_number > 99) && (slot_number < 2400)) { i.workData.formatted_request.push(['detail', `${makeTime(this_slot).time}`]); }\n else if (this_slot && !list_type) { i.workData.formatted_request.push(['detail', this_slot]); }\n }\n if (i.slotData.status\n && (typeof (i.slotData.status.current) === 'string')\n && (i.slotData.status.current.toLowerCase() !== 'selected')) {\n i.workData.formatted_request.push(['details', titleCase(i.slotData.status.current)]);\n }\n if (i.slotData.notes) { i.workData.formatted_request.push(['qual', `Notes: ${titleCase(i.slotData.notes)}`]); }\n }\n i.workData.checked = false;\n i.workData.open = false;\n return i;\n }\n /*\n function formatRequest(i, req) {\n let returnMessage = [];\n let returnSearch = '';\n if (!('textInput' in req)) { req.textInput = {}; }\n if (!('qualifiers' in req)) { req.qualifiers = []; }\n if (!('selections' in req)) { req.selections = []; }\n returnMessage.push(['detail', `For ${i.on_behalf_of}`]);\n req.selections.forEach(s => {\n let dLine = s;\n if (s in req.textInput) {\n dLine += ` - ${req.textInput[s]}`;\n delete req.textInput[s];\n }\n returnMessage.push(['detail', dLine]);\n returnSearch += ` ${dLine}}`;\n if (s in req.qualifiers) {\n for (let q in req.qualifiers[s]) {\n let qLast = req.qualifiers[s][q].length - 1;\n if (qLast >= 0) {\n let qLine = `${q} -`;\n // eslint-disable-next-line\n req.qualifiers[s][q].forEach((qV, qX) => {\n qLine += ` ${qV}`;\n returnSearch += ` ${qV}`;\n if ((qX < qLast) && (qLast > 1)) { qLine += ','; } // array longer than 2\n if (qX === (qLast - 1)) { qLine += ' and'; } // next to last entry in array\n });\n returnMessage.push(['qual', qLine]);\n }\n }\n }\n }); // done with all selections; is there any text left?\n for (let k in req.textInput) {\n if (['-stamped', '-date', '-ymd'].some(w => { return k.includes(w); })) { continue; }\n if (typeof req.textInput[k] === 'string') {\n if (req.textInput[k] !== i.on_behalf_of) {\n let kLow = k.toLowerCase().trim();\n returnSearch += ` ${req.textInput[k]}`;\n if (['description', 'summary', 'details'].some(w => { return kLow.includes(w); })) {\n returnMessage.unshift(['text', req.textInput[k]]);\n }\n else {\n returnMessage.push(['text', `${k} - ${req.textInput[k]}`]);\n }\n }\n }\n };\n return [returnMessage, returnSearch];\n }\n */\n\n async function initialize() {\n setPWidth(100);\n setLoading('loading');\n await buildDashboard();\n setLoading('complete');\n }\n\n if (!loading) {\n initialize();\n }\n\n if (loading === 'complete') {\n return reactScreen();\n }\n else {\n return loadingScreen();\n }\n\n /*\n React.useEffect(() => {\n async function initialize() {\n await buildDashboard();\n }\n initialize();\n }, [session]); // eslint-disable-line react-hooks/exhaustive-deps\n */\n\n // ******************\n function reactScreen() {\n return (\n \n {dataRows && dataRows.length > 0 &&\n \n {/* Header with Avatar, Message, and VertMenu */}\n \n \n \n Upcoming Events\n \n \n {\n handleClick(event);\n setPopupMenuOpen(true);\n }}>\n \n \n { setPopupMenuOpen(false); }}\n keepMounted>\n \n {\n onClose();\n }}>\n \n \n {'Go to AVA Menu'}\n \n \n {\n let jumpTo = window.location.origin;\n window.location.replace(jumpTo);\n }}>\n \n \n {'Restart AVA'}\n \n \n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n {`User ${session.user_id}${session.patient_id !== session.user_id ? (' (' + session.patient_id + ')') : ''}`}\n {`Function: RequestDashboard`}\n \n \n \n \n \n \n \n \n \n {rowsWritten = 0}\n \n {dataRows.map((this_item, index) => (\n ((rowsWritten <= rowLimit)\n && (!request_filter || filteredRequest(this_item, request_filter))\n && (!this_item.workData.delete_flag || showDeleted) &&\n \n \n {rowsWritten++}\n \n \n \n { toggleOpen(index); }} flexGrow={1} flexDirection='row' justifyContent='space-between' alignItems='center'>\n \n \n \n \n {this_item.workData.formatted_type}\n {this_item.workData.requestor_name}\n {`${this_item.workData.display_date}${this_item.workData.start_time ? (' - ' + this_item.workData.start_time) : ''}`}\n \n \n {this_item && this_item.workData && this_item.workData.formatted_request && this_item.workData.formatted_request.map((mLine, mIndex) => (\n \n {mLine[1]}\n \n ))}\n {this_item.workData.open &&\n this_item.workData.messageRecs.map((mLine, dX) => (\n \n {mLine[1]}\n \n ))\n }\n \n \n { toggleCheck(index); }}\n />\n {\n setConfirmMessage(`Cancel this request`);\n setConfirmID(this_item.message_id);\n setConfirmIndex(index);\n setDeletePending(true);\n setForceRedisplay(false);\n }}\n />\n \n \n \n )\n ))}\n \n \n {\n deletePending &&\n {\n setDeletePending(false);\n }}\n onConfirm={() => {\n handleRemoveMessage(confirmID, confirmIndex);\n setDeletePending(false);\n }}\n >\n \n }\n {\n showAddPrompt &&\n {\n setShowAddPrompt(false);\n }}\n onSelect={(selectedPerson) => {\n }}\n >\n \n }\n {promptForUpdate &&\n { setPromptForUpdate(false); }}\n onSave={async (requestUpdates) => {\n setPromptForUpdate(false);\n await handleUpdates(requestUpdates);\n }}\n />\n }\n { // Command Area\n \n \n \n {\n onClose();\n }}\n startIcon={}\n >\n {'Close'}\n \n {\n setPromptForUpdate(true);\n }}\n startIcon={}\n >\n {'Update Status'}\n \n {\n setShowAddPrompt(true);\n }}\n className={classes.rowButtonGreen}\n startIcon={}\n >\n {`New Request`}\n \n \n \n \n }\n \n }\n {(showReactError) &&\n \n \n {dataRows[dataRows.length + 10].person_id}\n \n \n }\n \n );\n }\n\n function loadingScreen() {\n return (\n \n \n \n \n {`Loading your Calendar`}\n {`version ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n \n \n \n \n \n );\n }\n};","import { clt, cl, s3, titleCase } from './AVAUtilities';\nimport { getCustomizations } from './AVAUtilities';\nimport { makeDate, addDays } from './AVADateTime';\n\nimport { jsPDF } from \"jspdf\";\nimport 'jspdf-autotable';\n\nimport htmlToFormattedText from \"html-to-formatted-text\";\n\nlet page = {};\nlet pdfCurrent = {};\nlet doc;\n\n// Functions\n\nexport async function printCalendar(requestBody) {\n /* \n requestBody expects {\n client_id\n myCalendar\n eventList (from default events.future typically)\n requestor\n first_date\n }\n */\n\n // all calendar entries for the next 90 days are pre-loaded into eventList\n let myCalendar = [];\n if (requestBody.myCalendar) {\n myCalendar = requestBody.myCalendar;\n }\n else {\n requestBody.currentEvent.find(e => {\n return e.hasOwnProperty('eventList');\n });\n }\n\n // make all calendar entries contain a ymd element\n myCalendar.forEach((entry, x) => {\n if (myCalendar[x].hasOwnProperty('dateObj')) {\n myCalendar[x].ymd = myCalendar[x].dateObj.ymd;\n }\n else {\n myCalendar[x].ymd = makeDate(entry.date).ymd;\n }\n });\n\n let firstDate;\n if (requestBody.first_date) {\n // find the Sunday on or before the date passed in\n let bodyFirst = makeDate(requestBody.first_date);\n firstDate = addDays(bodyFirst.date, (-1 * bodyFirst.dayOfWeek));\n }\n else {\n // find the Sunday on or before the first date in myCalendar\n let calFirst = makeDate(myCalendar[0].date || myCalendar[0].dateObj.date);\n firstDate = addDays(calFirst.date, (-1 * calFirst.dayOfWeek));\n }\n\n // Standard 8.5 x 11 output for a Request of any type\n // Prep the PDF output\n await pdfLaunch({\n orientation: 'landscape',\n client_id: requestBody.client_id,\n pdf: {\n pageWidth: 999,\n pageHeight: 999\n }\n });\n\n // this will hold the whole month\n let calendarGrid = []; // inside this grid is an array for each row (week)\n let headRow = [\n [{\n content: makeDate(firstDate).absolute_full.split(' ')[1],\n colSpan: 7,\n styles: { halign: 'center', fontSize: 30, valign: 'middle' }\n }],\n ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n ];\n\n // loop for five weeks\n for (let weekNumber = 0; weekNumber < 5; weekNumber++) {\n let sunday = addDays(firstDate, (weekNumber * 7));\n // fill a week\n let this_week = [];\n for (let dayOfWeek = 0; dayOfWeek < 7; dayOfWeek++) {\n let this_day = makeDate(addDays(sunday, dayOfWeek));\n let dayOfMonth = this_day.date.getDate();\n if (dayOfMonth === 1) {\n this_week[dayOfWeek] = `${this_day.dateOnly}`;\n }\n else {\n this_week[dayOfWeek] = dayOfMonth.toString();\n }\n myCalendar.forEach(entry => {\n if (entry.ymd === this_day.ymd) {\n // new style?\n if (entry.hasOwnProperty('eventList')) {\n entry.eventList.forEach((this_event) => {\n if (okToShow(this_event)) {\n let showTime = '';\n if (this_event.time && this_event.time.from) {\n showTime = this_event.time.from;\n }\n this_week[dayOfWeek] += `\\n\\r${showTime ? (showTime + ' ') : ''}${this_event.description}`;\n }\n });\n }\n else {\n if (okToShow(entry)) {\n let showTime = '';\n if (entry.time) {\n showTime = entry.time.split(' ')[0].trim();\n }\n this_week[dayOfWeek] += `\\n\\r${showTime ? (showTime + ' ') : ''}${entry.description}`;\n }\n }\n }\n });\n }\n calendarGrid.push(this_week);\n }\n\n // set up grid Display\n let columnStyles = {};\n let headStyles = {\n halign: 'center',\n fontSize: 12,\n fontStyle: 'bold',\n minCellHeight: 10\n };\n let bodyStyles = {\n halign: 'center',\n minCellHeight: 120\n };\n\n for (let c = 0; c < 7; c++) {\n columnStyles[c] = {\n halign: 'center',\n cellWidth: 120\n };\n }\n doc.autoTable({\n head: headRow,\n body: calendarGrid,\n startY: 70,\n theme: 'grid',\n columnStyles: columnStyles,\n headStyles: headStyles,\n bodyStyles: bodyStyles\n });\n\n // file name\n if (requestBody.fileName && requestBody.fileName.slice(-4) !== '.pdf') {\n requestBody.fileName += '.pdf';\n }\n let pdfInfo = {\n s3Key: (requestBody.fileName || `Calendar_${requestBody.requestor}_${makeDate(firstDate).ymd}.pdf`),\n s3Bucket: (requestBody.S3_bucket || 'theseus-medical-storage')\n };\n\n // finish and save\n pdfStyle('reset');\n pdfStyle({ size: 'small', before: 1 });\n pdfLine(`***** END *****`, { align: 'center_bottom', noNewPage: true, noNewLine: true, before: 6 });\n let pdfResp = await savePDF(doc, pdfInfo, { local: true, S3: true });\n if (pdfResp.responseData.s3Resp) {\n pdfInfo.s3Location = pdfResp.responseData.s3Resp.Location;\n }\n\n function okToShow(this_event) {\n if (this_event.date === '29991231') { return false; } // event was soft-deleted\n else if (this_event.groups && (this_event.groups[0] !== '*all')) {\n let belongsToASelectedGroup = this_event.groups.some(g => {\n return (requestBody.hasOwnProperty(g));\n });\n if (!belongsToASelectedGroup) {\n return false;\n }\n }\n if (requestBody.onlyRegistered\n && (!this_event.slot_owners.hasOwnProperty(requestBody.onlyRegistered))) {\n return false;\n }\n if (!requestBody.filterTextLower) {\n return true;\n }\n else if (typeof(this_event.location) === 'string') {\n return (`${this_event.description} ${this_event.location}`).toLowerCase().includes(requestBody.filterTextLower);\n }\n else {\n return (`${this_event.description} ${this_event.location.description}`).toLowerCase().includes(requestBody.filterTextLower);\n }\n }\n\n}\n\nasync function savePDF(doc, pdfInfo, options = {}) {\n let s3Resp;\n let responseStatus = 400;\n let responseData = { message: [] };\n if (options.S3) {\n let goodS3 = true;\n s3Resp = await s3\n .upload({\n Bucket: pdfInfo.s3Bucket,\n Key: pdfInfo.s3Key,\n Body: doc.output('blob'),\n ACL: 'public-read-write',\n ContentType: 'application/pdf'\n })\n .promise()\n .catch(err => {\n cl(`PDF not saved by AVA. The reason is ${err.message}`);\n goodS3 = false;\n responseStatus = 401;\n responseData.message = err.message;\n });\n if (goodS3) {\n if (options.onSave === 'print') {\n window.open(s3Resp.Location);\n }\n responseStatus = 200;\n responseData.message.push(`S3 saved at ${s3Resp.Location}`);\n responseData.s3Resp = s3Resp;\n }\n }\n if (options.local) {\n doc.save(pdfInfo.s3Key);\n responseStatus++;\n responseData.message.push(`Locally saved as ${pdfInfo.s3Key}`);\n responseData.saveName = pdfInfo.s3Key;\n }\n return {\n responseStatus,\n responseData\n };\n\n}\n\nasync function pdfLaunch(body) {\n if (!body.hasOwnProperty('pdf')) { body.pdf = {}; }\n if (!body.multiPrint || body.multiPrint.firstDoc) {\n doc = new jsPDF({\n orientation: body.orientation || 'portrait',\n unit: \"px\",\n format: ((body.pdf.pageWidth) ? [body.pdf.pageWidth, (body.pdf.pageHeight || 9999)] : [563, 750])\n });\n }\n else {\n doc.addPage({\n orientation: body.orientation || 'portrait',\n format: ((body.pdf.pageWidth) ? [body.pdf.pageWidth, (body.pdf.pageHeight || 9999)] : [563, 750])\n });\n }\n page = {\n orientation: body.orientation || 'portrait',\n width: doc.internal.pageSize.width,\n height: doc.internal.pageSize.height,\n center: (doc.internal.pageSize.width / 2),\n border: (body.pdf.hasOwnProperty('border')) ? body.pdf.border : true,\n font: {\n family: 'Helvetica',\n size: { large: 20, medium: 16, small: 12, tiny: 8 }\n },\n layout: (body.pdf.hasOwnProperty('orientation')) ? body.pdf.orientation : 'portrait',\n info: { author: 'AVA Senior Living' },\n margin: {\n top: (body.pdf.margin && body.pdf.margin.top) || (doc.internal.pageSize.height / 20),\n bottom: (body.pdf.margin && body.pdf.margin.bottom) || (doc.internal.pageSize.height / 15),\n left: (body.pdf.margin && body.pdf.margin.left) || (doc.internal.pageSize.width / 12),\n right: (body.pdf.margin && body.pdf.margin.right) || (doc.internal.pageSize.width / 12)\n }\n };\n page.bottom = page.height - (2 * page.margin.bottom);\n page.right = page.width - page.margin.right;\n page.centerPoint = page.width / 2;\n page.printableArea = page.width - page.margin.left - page.margin.right;\n\n\n page.title = body.pdf.title || 'Calendar';\n page.info.title = page.title;\n clt({ page });\n\n let nowTime = makeDate(new Date());\n pdfCurrent = {\n yPos: page.margin.top,\n xPos: page.margin.left,\n pageNumber: ((body.multiPrint && !body.multiPrint.firstDoc) ? doc.internal.getNumberOfPages() + 1 : 1),\n indent: 0,\n reportTime: nowTime.absolute,\n timestamp: nowTime.numeric24\n };\n let customizations = await getCustomizations('*all', body.client_id);\n if (customizations['client_name']) {\n pdfCurrent.client_name = customizations['client_name'];\n }\n else {\n pdfCurrent.client_name = `Client = ${body.client_id}`;\n };\n if (customizations['print']) {\n let print_specs = customizations['print'];\n if (print_specs.size) {\n page.font.size = {\n large: ((print_specs.size <= 5) ? 20 * print_specs.size : print_specs.size),\n medium: ((print_specs.size <= 5) ? 16 * print_specs.size : print_specs.size),\n small: ((print_specs.size <= 5) ? 12 * print_specs.size : print_specs.size),\n tiny: ((print_specs.size <= 5) ? 8 * print_specs.size : print_specs.size),\n };\n }\n }\n else {\n pdfCurrent.client_name = `Client = ${body.client_id}`;\n };\n if (customizations['logo']) {\n pdfCurrent.logo = customizations['logo'];\n if (customizations['logo_dimensions']) {\n pdfCurrent.logo_width = customizations['logo_dimensions'][0] / 2;\n pdfCurrent.logo_height = customizations['logo_dimensions'][1] / 2;\n }\n else {\n pdfCurrent.logo_width = 75;\n pdfCurrent.logo_height = 75;\n }\n }\n pdfStyle('reset');\n}\n\nfunction pdfHeader(pageN) {\n clt({ pdfCurrent });\n let savedStyle = Object.assign({}, pdfCurrent);\n pdfCurrent.yPos = page.margin.top;\n if (pageN > 1) {\n pdfStyle('reset');\n doc.addPage({\n orientation: page.orientation,\n unit: \"px\",\n format: (page.width ? [page.width, page.height] : 'letter')\n });\n }\n else if (pdfCurrent.logo) {\n // doc.addImage(pdfCurrent.logo, 'PNG', page.center - (pdfCurrent.logo_width / 2), pdfCurrent.yPos, pdfCurrent.logo_width, pdfCurrent.logo_height);\n // pdfCurrent.yPos += pdfCurrent.logo_height;\n }\n pdfStyle({ size: 'large', align: 'center', style: 'bold' });\n doc.text(pdfCurrent.client_name, page.center, pdfCurrent.yPos, { align: 'center' });\n pdfStyle({ size: 'medium', before: 1, style: 'normal' });\n doc.text(page.title, page.center, pdfCurrent.yPos, { align: 'center' });\n pdfDown(1);\n doc.text(pdfCurrent.reportTime, page.center, pdfCurrent.yPos, { align: 'center' });\n if (pageN > 1) {\n pdfStyle({ size: 'small', before: 1 });\n doc.text(`Page ${pdfCurrent.pageNumber}`, page.width / 2, pdfCurrent.yPos, { align: 'center' });\n pdfDown(2);\n if (pdfCurrent.key) {\n pdfStyle({ size: 'medium', align: 'left', style: 'bold' });\n doc.text(titleCase(pdfCurrent.key), page.margin.left, pdfCurrent.yPos);\n let newX = page.margin.left + doc.getTextWidth(titleCase(pdfCurrent.key)) + 5;\n pdfStyle({ size: 'small', style: 'normal' });\n doc.text('(continued)', newX, pdfCurrent.yPos);\n }\n pdfCurrent = Object.assign({}, savedStyle, { yPos: pdfCurrent.yPos });\n pdfStyle(pdfCurrent);\n }\n else {\n pdfStyle('reset');\n pdfDown(2);\n }\n}\n\nfunction pdfLine(text, options = {}) {\n clt({ pdfLine: text, options });\n if (options) { pdfStyle(options); }\n if (options.before) { pdfDown(options.before); }\n if (options.yPos && !isNaN(options.yPos)) {\n pdfCurrent.yPos = options.yPos;\n }\n else if (options.yPos && (options.yPos === 'footer')) {\n pdfCurrent.yPos = page.height - page.margin.bottom - 54;\n pdfCurrent.xPos = page.margin.left;\n options.noNewPage = true;\n }\n else if (options.yPos && (options.yPos === 'header')) {\n pdfCurrent.yPos = page.margin.top;\n options.noNewPage = true;\n }\n else if (!options.noNewLine) {\n pdfDown(1);\n }\n if (!options.noNewPage && (pdfCurrent.yPos >= (page.bottom - page.margin.bottom))) {\n pdfHeader(++pdfCurrent.pageNumber);\n }\n if (options.image) {\n let imageSize = pdfCurrent.fontSize * 5;\n let xOffset;\n switch (pdfCurrent.align) {\n case 'center': {\n xOffset = page.centerPoint - (imageSize / 2);\n doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos, imageSize, imageSize);\n pdfCurrent.xPos = page.centerPoint + (imageSize / 2);\n break;\n }\n case 'right': {\n xOffset = page.width - page.margin.right - imageSize;\n doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos, imageSize, imageSize);\n pdfCurrent.xPos = page.width - page.margin.right;\n break;\n }\n default: {\n xOffset = pdfCurrent.xPos + pdfCurrent.indent;\n // doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos, imageSize, imageSize);\n doc.addImage(options.image, 'JPEG', xOffset, pdfCurrent.yPos);\n pdfCurrent.xPos = xOffset + imageSize;\n }\n }\n pdfCurrent.yPos += imageSize;\n }\n else if (options.html) {\n delete options.html;\n pdfLine(htmlToFormattedText(text), options);\n }\n else {\n // this little chunk deals with text overflow\n {\n let tWords = [];\n if ((pdfCurrent.align === 'center') && (doc.getTextWidth(text) > page.printableArea)) {\n tWords = doc.splitTextToSize(text, page.printableArea);\n }\n else if ((pdfCurrent.align !== 'center') && ((doc.getTextWidth(text) + pdfCurrent.xPos + pdfCurrent.indent) > page.right)) {\n tWords = doc.splitTextToSize(text, (page.right - (pdfCurrent.xPos + pdfCurrent.indent)));\n }\n if (tWords.length > 0) {\n for (let t = 0; t < tWords.length - 1; t++) {\n pdfLine(tWords[t], options);\n }\n pdfDown(1);\n text = tWords[tWords.length - 1];\n }\n }\n if (pdfCurrent.align === 'center') {\n let xOffset = page.centerPoint - (doc.getTextWidth(text) / 2);\n doc.text(text, xOffset, pdfCurrent.yPos);\n pdfCurrent.xPos = page.centerPoint + (doc.getTextWidth(text) / 2) + pdfCurrent.fontSize;\n }\n else if (pdfCurrent.align === 'center_bottom') {\n let xOffset = page.centerPoint - (doc.getTextWidth(text) / 2);\n doc.text(text, xOffset, page.height - page.margin.bottom - 10);\n pdfCurrent.xPos = page.centerPoint + (doc.getTextWidth(text) / 2) + pdfCurrent.fontSize;\n }\n else if (pdfCurrent.align === 'right') {\n doc.text(text, page.width - page.margin.right, pdfCurrent.yPos, { align: 'right' });\n pdfCurrent.xPos = page.margin.right;\n }\n else if (pdfCurrent.noNewLine) {\n doc.text(text, pdfCurrent.xPos + pdfCurrent.indent, pdfCurrent.yPos);\n pdfCurrent.xPos += doc.getTextWidth(text) + pdfCurrent.fontSize;\n }\n else {\n doc.text(text, pdfCurrent.xPos + pdfCurrent.indent, pdfCurrent.yPos);\n pdfCurrent.xPos = (pdfCurrent.xPos + pdfCurrent.indent) + doc.getTextWidth(text) + pdfCurrent.fontSize;\n }\n }\n if (options.after) { pdfDown(options.after); }\n return;\n}\n\n\nfunction pdfDown(n = 1) {\n pdfCurrent.yPos += ((isNaN(n) ? 1 : n) * (pdfCurrent.fontSize * 0.75));\n pdfCurrent.xPos = page.margin.left;\n}\n\nfunction pdfStyle(options = {}) {\n if (options === 'reset') {\n pdfCurrent.style = 'normal';\n doc.setFont(page.font.family, 'normal');\n pdfCurrent.fontSize = page.font.size['medium'];\n doc.setFontSize(pdfCurrent.fontSize);\n pdfCurrent.indent = 0;\n pdfCurrent.align = '';\n }\n else {\n if (options.style) {\n pdfCurrent.style = options.style;\n doc.setFont(page.font.family, options.style);\n }\n if (options.size) {\n if (isNaN(options.size)) {\n if (page.font.size.hasOwnProperty(options.size)) {\n pdfCurrent.fontSize = page.font.size[options.size];\n }\n }\n else { pdfCurrent.fontSize = options.size; }\n doc.setFontSize(pdfCurrent.fontSize);\n }\n if (options.fontSize) {\n pdfCurrent.fontSize = options.fontSize;\n doc.setFontSize(pdfCurrent.fontSize);\n }\n if (options.hasOwnProperty('indent')) { // different because when options.indent === 0, options.indent is false\n pdfCurrent.indent = options.indent;\n }\n if (options.align) {\n pdfCurrent.align = options.align;\n }\n }\n}\n","import React from 'react';\n\nimport { makeTime, makeDate, addDays } from '../../util/AVADateTime';\nimport { isObject, deepCopy, titleCase, makeArray, isEmpty } from '../../util/AVAUtilities';\nimport { getCalendarEntries, writeSlot, getSlotList, publishCalendar } from '../../util/AVACalendars';\nimport { getImage, getPerson, makeName } from '../../util/AVAPeople';\nimport AVATextInput from './AVATextInput';\nimport { make_rgba } from '../../util/AVAStyles';\n\nimport { Alert, AlertTitle } from '@material-ui/lab/';\n\nimport { Snackbar, Box, Typography, Avatar } from '@material-ui/core';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport CloseIcon from '@material-ui/icons/ExitToApp';\nimport FilterListIcon from '@material-ui/icons/FilterList';\n\nimport CalendarEventEditForm from './CalendarEventEditForm';\n\nimport SwapHorizIcon from '@material-ui/icons/SwapHoriz';\nimport HomeIcon from '@material-ui/icons/Home';\nimport AutorenewIcon from '@material-ui/icons/Autorenew';\nimport PrintIcon from '@material-ui/icons/Print';\nimport AddEventIcon from '@material-ui/icons/Event';\nimport DateRangeIcon from '@material-ui/icons/DateRange';\nimport CalendarViewDayIcon from '@material-ui/icons/CalendarViewDay';\nimport GroupIcon from '@material-ui/icons/Group';\nimport PersonAddDisabledIcon from '@material-ui/icons/PersonAddDisabled';\nimport FormatAlignJustifyIcon from '@material-ui/icons/FormatAlignJustify';\nimport FormatLineSpacingIcon from '@material-ui/icons/FormatLineSpacing';\nimport TextureIcon from '@material-ui/icons/Texture';\nimport EventIcon from '@material-ui/icons/Event';\nimport AssignmentTurnedInIcon from '@material-ui/icons/AssignmentTurnedIn';\n\nimport ArrowBackIcon from '@material-ui/icons/ArrowBack';\nimport ArrowForwardIcon from '@material-ui/icons/ArrowForward';\n\nimport Menu from '@material-ui/core/Menu';\nimport MenuList from '@material-ui/core/MenuList';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport Dialog from '@material-ui/core/Dialog';\n\nimport NewCalendarEvent from '../dialogs/NewCalendarEvent';\nimport PersonFilter from '../forms/PersonFilter';\n\nimport Button from '@material-ui/core/Button';\n\nimport { AVAclasses, AVATextStyle, AVADefaults, contrastColor, hexColors } from '../../util/AVAStyles';\nimport useSession from '../../hooks/useSession';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport { printCalendar } from '../../util/AVACalendarPrint';\n\nconst useStyles = makeStyles(theme => ({\n formControl: {\n margin: 0,\n paddingTop: 0,\n },\n formControlLbl: {\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n },\n picture: {\n width: theme.spacing(16),\n height: theme.spacing(16),\n [theme.breakpoints.down('xs')]: {\n width: theme.spacing(8),\n height: theme.spacing(8),\n },\n },\n photoButton: {\n alignSelf: 'center',\n size: 'sm',\n variant: 'outlined',\n verticalAlign: 'middle',\n },\n avatar: {\n marginTop: 0,\n marginLeft: theme.spacing(2),\n marginBottom: 0,\n height: 50,\n width: 50,\n paddingTop: 0,\n fontSize: '1.3rem',\n },\n assignment_avatar: {\n marginTop: 0,\n marginBottom: 0,\n height: 40,\n width: 40,\n paddingTop: 0,\n fontSize: '1.2rem',\n },\n tooltipBody: {\n backgroundColor: 'rgba(245, 245, 249, 0.8)',\n color: 'rgba(0, 0, 0, 0.87)',\n minHeight: 30,\n paddingBottom: 1,\n borderRadius: '30px',\n fontSize: 1,\n border: '1px solid #242426',\n },\n arrowBody: {\n color: '#f5f5f9',\n fontSize: theme.typography.pxToRem(12),\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n title: {\n flexGrow: 1,\n },\n subTitle: {\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(0.5),\n marginLeft: theme.spacing(2),\n fontSize: theme.typography.fontSize * 1.2\n },\n popUpMenu: {\n marginRight: theme.spacing(3),\n paddingRight: 2,\n },\n popUpMenuRow: {\n marginLeft: theme.spacing(1),\n fontSize: theme.typography.fontSize * 1.0,\n },\n popUpFooter: {\n fontSize: theme.typography.fontSize * 0.8\n ,\n },\n dragNamesFirst: {\n fontSize: theme.typography.fontSize * 1.2,\n marginTop: '3px',\n marginBottom: '-10px'\n },\n dragNamesLast: {\n fontSize: theme.typography.fontSize * 1.2,\n marginTop: '3px',\n fontWeight: 'bold',\n marginBottom: '-10px'\n },\n AVAButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n freeInput: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(1.5),\n width: '90%'\n },\n peopleBox: {\n paddingTop: 0,\n paddingBottom: theme.spacing(2),\n overflowX: 'auto',\n scrollbarWidth: 'thin',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n display: 'flex',\n width: '100%',\n flexDirection: 'row'\n },\n peopleBoxWithSpace: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(2),\n overflowX: 'auto',\n scrollbarWidth: 'thin',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n display: 'flex',\n width: '100%',\n flexDirection: 'row'\n },\n dateCell: {\n transform: `style(1.4)`,\n display: 'flex',\n flexDirection: 'column',\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(1),\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(2),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n textAlign: 'center'\n },\n subDescriptionText2: {\n marginTop: 0,\n marginBottom: theme.spacing(2),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n fontSize: '1.4rem',\n },\n subDescriptionText: {\n marginTop: 0,\n marginBottom: 0,\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(1),\n fontSize: '1.4rem',\n },\n progressBar: {\n marginBottom: theme.spacing(3),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px'\n },\n radioText: {\n fontSize: theme.typography.fontSize * 1.4,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n dialogBox: {\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n minHeight: '100%',\n },\n denseView: {\n display: 'flex',\n flexDirection: 'column',\n paddingLeft: '16px',\n paddingRight: '16px',\n paddingBottom: '16px',\n marginTop: 0,\n marginBottom: '24px',\n maxWidth: '195px',\n justifyContent: 'flex-start',\n overflow: 'auto',\n overflowX: 'hidden',\n },\n relaxedView: {\n display: 'flex',\n flexDirection: 'column',\n padding: '16px',\n marginTop: 0,\n marginBottom: '8px',\n variant: 'outlined',\n justifyContent: 'flex-start',\n },\n idText: {\n fontSize: theme.typography.fontSize * 1.4,\n marginTop: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n client_background: {\n backgroundColor: isObject(AVADefaults({ client_style: 'get' })) ? AVADefaults({ client_style: 'get' }).calendar_background : null\n },\n client_backgroundCenter: {\n alignItems: 'center',\n backgroundColor: isObject(AVADefaults({ client_style: 'get' })) ? AVADefaults({ client_style: 'get' }).calendar_background : null\n },\n button_area: {\n paddingBottom: 12,\n paddingTop: 4,\n backgroundColor: isObject(AVADefaults({ client_style: 'get' })) ? AVADefaults({ client_style: 'get' }).calendar_background : null\n },\n clientPopUp: {\n borderRadius: '30px 30px 30px 30px',\n backgroundColor: isObject(AVADefaults({ client_style: 'get' })) ? AVADefaults({ client_style: 'get' }).calendar_background : null\n },\n}));\n\nexport default ({ myCalendar, calendarPeople, conflictInfo = {}, person_id, peopleList, onClose, defaultValues = {} }) => {\n\n /*\n DEFAULT VALUES\n slotsView - show all people that are signed up\n agendaView - show in straigh-line \"agenda\" format\n subtitle - if present, text to show under the person name\n onlyRegistered - only show events that I am signed-up for\n onlyPublished - only show events that have alreasdy been published\n viewOnly - do not allow updates to event details\n assignmentView - show list of people you can assign to events\n allowAssign - required when assignmentView is true; this becomes assignment__list\n template__List - a list of event templates to use when creating new appointments\n assignment__list - this is a list of people and groups that you may choose from to assign to events\n message_override - [list of IDs] or [*none*] (default if missing: added slots = message to the event owner)\n colorScheme: { (if this exists at all, ALL colors are overridden; missing keys will be null/black color)\n owned: if the session.patient_id owns any slot, use this color (default: green) \n full: if all slots are filled, use this color (default: red)\n empty: if NO slots are filled, use this color (default: null) \n atLeast_n: if 'n' or more slots are filled, use this color (default: null)\n lessThan_n: if less than 'n'slots are filled, use this color (default: null)\n waitlist: if there is a waitlist, and session.patient_id is NOT on it, use this color (default: orange)\n waitlisted: if there is a waitlist, and session.patient_id IS on it, use this color (default: orange)\n }\n */\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n const { state } = useSession();\n const isDarkMode = useMediaQuery('(prefers-color-scheme: dark)');\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const [anchorEl, setAnchorEl] = React.useState(null);\n\n const selectedDate = React.useRef(null);\n\n if (defaultValues.assignmentView) {\n defaultValues.slotsView = true;\n }\n\n if (!defaultValues.template__List) {\n defaultValues.template__List = [];\n }\n\n const setInitialView = (defaultValues) => {\n if (!defaultValues.hasOwnProperty('%%initialized%%')) {\n if (defaultValues.agendaView) {\n return { '*all': false };\n }\n else if (defaultValues.weekView) {\n return { '*all': true };\n }\n defaultValues['%%initialized%%'] = true;\n if ((!defaultValues.hasOwnProperty('denseView')\n && defaultValues.hasOwnProperty('relaxedView')\n && !defaultValues.relaxedView)\n || (defaultValues.denseView && !defaultValues.relaxedView)) {\n return { '*all': true };\n }\n else {\n return { '*all': false };\n }\n }\n };\n\n const defaultColorScheme = {\n unavailable: 'purple',\n owned: 'green',\n full: 'red',\n waitlist: 'orange',\n waitlisted: 'orange'\n };\n\n const [reactData, setReactData] = React.useState(\n {\n alert: false,\n rowLimit: 50,\n todayYMD: makeDate(new Date()).numeric,\n selectedPerson_id: person_id,\n myCalendar,\n display_name: state.patient?.name?.first || 'My',\n filterTextLower: null,\n selectDate: null,\n clicked_on_date: false,\n popUpOpen: false,\n needRef: false,\n loading: false,\n event_being_edited: false,\n pWidth: 60,\n defaultValues: defaultValues,\n selectedPersonRec: {},\n denseView: setInitialView(defaultValues) || { '*all': false },\n factor7: defaultValues.weekView ? Math.min(((window.window.innerWidth - 220) / 1400), 1) : 1,\n conflictInfo: conflictInfo,\n colorScheme: Object.assign({}, defaultColorScheme, defaultValues.colorScheme),\n calendar_fill: isObject(AVADefaults({ client_style: 'get' })) ? AVADefaults({ client_style: 'get' }).calendar_fill : null,\n calendar_fill_text: isObject(AVADefaults({ client_style: 'get' })) ? AVADefaults({ client_style: 'get' }).calendar_fill_text : null\n }\n );\n\n\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n const handlePublishOptions = async ({ response, results }) => {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Publish warning!',\n message:
    \n There is a filter on. This will cause {results.failedFilter} event(s) to be skipped.

    \n You may:
    \n Continue with the filter as is, skipping the {results.failedFilter} event(s),
    \n Ignore the filter, publishing all available events, or
    \n Cancel and go back without publishing anything
    ,\n action: [\n {\n text: `Continue`,\n function: (async () => {\n response.proceedWithoutWarning = true;\n await executePublish(response);\n updateReactData({\n setPublishDates: false\n }, true);\n })\n },\n {\n text: `Ignore`,\n function: (async () => {\n response.proceedWithoutWarning = true;\n response.ignoreFilters = true;\n await executePublish(response);\n updateReactData({\n setPublishDates: false\n }, true);\n })\n },\n {\n text: `Cancel`,\n function: () => {\n updateReactData({\n setPublishDates: false,\n alert: false\n }, true);\n }\n }\n ]\n }\n }, true);\n };\n\n const executePublish = async (response) => {\n let publishData = await publishCalendar(\n {\n client: {\n client_id: state.session.client_id,\n client_name: state.session.client_name\n },\n myCalendar: reactData.myCalendar,\n requestor: state.session.user_id,\n filters: {\n filterTextLower: response.ignoreFilters ? '' : reactData.filterTextLower,\n ownerFilter: response.ignoreFilters ? false : reactData.idFilter,\n eventFilter: response.ignoreFilters ? false : reactData.eventIDFilter\n },\n startDate: makeDate(response[0]).date,\n endDate: makeDate(response[1]).date,\n proceedWithoutWarning: response.proceedWithoutWarning || false\n }\n );\n if (publishData.warningsExist) {\n await handlePublishOptions({ response, results: publishData.results });\n return;\n }\n else {\n reactData.myCalendar.forEach((pDate, pDx) => {\n pDate.eventList.forEach((pEvent, pEx) => {\n if (publishData.event_list.includes(pEvent.event_key)) {\n reactData.myCalendar[pDx].eventList[pEx].published = true;\n }\n });\n });\n let dateRangeMessage = `Publish complete for ${publishData.dates.from}`;\n if (publishData.dates.from !== publishData.dates.to) {\n dateRangeMessage += ` to ${publishData.dates.to}`;\n }\n let previouslyPublishedMessage = '';\n if (publishData.already_published > 0) {\n previouslyPublishedMessage = `${publishData.already_published} event${(publishData.already_published > 1) ? 's' : ''} had already been published`;\n }\n let skippedMessage = '';\n if (publishData.results && (publishData.results.failedFilter > 0)) {\n skippedMessage = `${publishData.results.failedFilter} event(s) were skipped due to a filter you have set`;\n }\n updateReactData({\n myCalendar: reactData.myCalendar,\n alert: {\n severity: 'success',\n title: `Publish complete`,\n message:
    \n {dateRangeMessage}< br />\n
    \n {publishData.results.willPublish} events were published
    \n {(publishData.people_count === 0) ? 'No' : publishData.people_count} notifications sent
    \n {previouslyPublishedMessage}
    \n {skippedMessage}
    ,\n }\n }, true);\n }\n return;\n };\n\n const handleConflictOptions = ({ conflictingEvent, dragged_id, eventObj }) => {\n let { droppedOn_event, eventIndex, dateIndex, eventStart24, eventEnd24 } = eventObj;\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Conflict warning!',\n message: `This conflicts with ${conflictingEvent}`,\n action: [\n {\n text: `Go ahead`,\n function: (async () => {\n await proceedWithSignUp(dragged_id, { droppedOn_event, eventIndex, dateIndex, eventStart24, eventEnd24 });\n updateReactData({\n alert: false\n }, true);\n return;\n })\n },\n {\n text: `Don't assign`,\n function: () => {\n updateReactData({\n alert: false\n }, true);\n return;\n }\n }\n ]\n }\n }, true);\n };\n\n if (reactData.myCalendar.loadError || (reactData.myCalendar.length === 0)) {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Loading',\n message: `AVA is still loading. Wait just a moment and try again, please.`\n }\n }, true);\n }\n\n if ((reactData.defaultValues.start_date !== defaultValues.start_date)\n || (reactData.defaultValues.end_date !== defaultValues.end_date)\n || (reactData.myCalendar.length !== myCalendar.length)) {\n updateReactData({\n myCalendar,\n defaultValues: Object.assign({},\n reactData.defaultValues,\n {\n start_date: defaultValues.start_date,\n end_date: defaultValues.end_date\n }\n )\n }, true);\n }\n\n React.useEffect(() => {\n if (reactData.defaultValues.selectDate) {\n let checkDate = makeDate(reactData.defaultValues.selectDate).numeric$;\n if (checkDate !== reactData.selectDate) {\n updateReactData({\n selectDate: checkDate,\n needRef: true\n }, true);\n }\n };\n function handleResize() {\n updateReactData({\n factor7: defaultValues.weekView ? Math.min(((window.window.innerWidth - 220) / 1400), 1) : 1,\n }, true);\n }\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n });\n\n React.useEffect(() => {\n if (selectedDate && selectedDate.current) {\n selectedDate.current.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n });\n }\n }, [reactData.needRef]);\n\n const handleClick = async (event) => {\n setAnchorEl(event.currentTarget);\n };\n\n const agendaView = () => {\n return reactData.defaultValues.agendaView || (window.window.innerWidth < 800);\n };\n\n const eventsToShow = (this_date) => {\n return this_date.eventList.some((this_event) => { // an array of events on this date\n return okToShow(this_event);\n });\n };\n\n const isUnAvailable = (this_date, this_person) => {\n return this_date.eventList.some((this_event) => { // an array of events on this date\n if (!this_event.customizations) { return false; }\n if (!this_event.customizations.hasOwnProperty('show_as_unavailable')) { return false; }\n if (!okToShow(this_event)) { return false; }\n return (this_event.slot_owners.hasOwnProperty(this_person));\n });\n };\n\n const getPersonName = (idToFind) => {\n if (!state.accessList?.[state.session.client_id]?.list) {\n return idToFind;\n }\n let this_person = state.accessList[state.session.client_id].list.find(this_member => {\n return (this_member.id === idToFind);\n });\n if (this_person) {\n return this_person.display_name;\n }\n else {\n return idToFind;\n }\n };\n\n const showSlots = () => {\n return reactData.defaultValues.slotsView;\n };\n\n const ownerOfSlots = (this_event, check_person) => {\n if (!this_event.hasOwnProperty('slot_owners')) {\n return false;\n }\n else if (!check_person) {\n return (this_event.slot_owners.hasOwnProperty(reactData.selectedPerson_id));\n }\n else {\n return (this_event.slot_owners.hasOwnProperty(check_person));\n }\n };\n\n const waitListExists = (this_event) => {\n return (this_event.hasOwnProperty('wait_list') && (this_event.wait_list.length > 0));\n };\n\n const isWaitListed = (this_event) => {\n return (\n this_event.hasOwnProperty('wait_list')\n && this_event.wait_list.includes(reactData.selectedPerson_id)\n && (this_event.occurrence_date < reactData.todayYMD)\n );\n };\n\n const allSlotsFull = (this_event) => {\n if ((this_event.type !== 'seats') || (this_event.type !== 'time')) {\n return false;\n }\n else if (!this_event.slotPattern) {\n return false;\n }\n else if (!this_event.slot_owners) {\n return false;\n }\n else {\n return (this_event.slotPattern.length <= Object.keys(this_event.slot_owners).length);\n }\n };\n\n const allSlotsEmpty = (this_event) => {\n return (Object.keys(this_event.slot_owners).length === 0);\n };\n\n function okToShow(this_event) {\n if (this_event.date === '29991231') { return false; } // event was soft-deleted\n if (reactData.defaultValues.hasOwnProperty('onlyRegistered')\n && (!this_event.slot_owners.hasOwnProperty(reactData.selectedPerson_id))) {\n return false;\n }\n if (reactData.defaultValues.hasOwnProperty('onlyPublished')\n && (!this_event.published)) {\n return false;\n }\n if ((reactData.idFilter) && (!this_event.slot_owners.hasOwnProperty(reactData.idFilter))) {\n // console.log(`failed - ${reactData.idFilter} in ${Object.keys(this_event.slot_owners)}`)\n return false;\n }\n else if (reactData.eventIDFilter) {\n return (this_event.event_id === reactData.eventIDFilter);\n }\n else if ((!reactData.idFilter) && (this_event.customizations?.show_as_unavailable)) {\n return false;\n }\n else if (!reactData.filterTextLower) {\n return true;\n }\n else if (reactData.filterTextLower.startsWith('publish')\n && (this_event.published)) {\n return true;\n }\n else if (reactData.filterTextLower.startsWith('unpub')\n && (!this_event.published)) {\n return true;\n }\n else {\n return ((`${this_event.description} ${this_event.location}`).toLowerCase().includes(reactData.filterTextLower));\n }\n }\n\n const handleDragStart = (ev, id) => {\n ev.dataTransfer.setData('id', id);\n };\n\n let dropTarget = {};\n const handleDragOver = (ev, target) => {\n ev.preventDefault();\n dropTarget[target.type] = target.data;\n };\n\n const isTemplate = (id) => {\n return (id.startsWith('template:'));\n };\n\n const getTemplate = (id) => {\n let template_id = id.split('%%')[1];\n return (reactData.defaultValues.template__List.find(this_template => {\n return this_template.event_data.event_id === template_id;\n }));\n };\n\n const handleDrop = async (ev, dropType) => {\n ev.preventDefault();\n let dragged_id = ev.dataTransfer.getData('id');\n console.log(`drop on ${dropType} with ${Object.keys(dropTarget)}`);\n switch (dropType) {\n case 'event': {\n if (!isTemplate(dragged_id)) {\n await eventSignup(dragged_id, dropTarget['event']);\n dropTarget = {};\n break;\n }\n else {\n dropTarget['calendar_cell'].this_date = { dateObj: makeDate(dropTarget['event'].droppedOn_event.occurrence_date) };\n }\n // intentionally drop through to calendar_cell case\n }\n // eslint-disable-next-line\n case 'calendar_cell': {\n if (dropTarget.hasOwnProperty('calendar_cell')) {\n if (isTemplate(dragged_id)) {\n let personRec = null;\n if (reactData.idFilter) {\n personRec = await getPerson(reactData.idFilter);\n }\n updateReactData({\n addTemplateEvent: true,\n selectedTemplate: getTemplate(dragged_id),\n selectedPersonRec: personRec,\n isAppointment: true,\n appointmentStart: null,\n appointmentEnd: null,\n appointmentDate: dropTarget['calendar_cell'].this_date\n }, true);\n }\n else {\n let personRec = await getPerson(dragged_id);\n updateReactData({\n getAppointmentType: true,\n appointmentStart: null,\n appointmentEnd: null,\n appointmentDate: dropTarget['calendar_cell'].this_date,\n selectedPersonRec: personRec,\n }, true);\n /*\n updateReactData({\n addPersonalEvent: true,\n getAppointmentType: false,\n isAppointment: true,\n appointmentStart: response[1],\n appointmentEnd: response[2]\n }, true);\n */\n }\n }\n break;\n }\n case 'filter_button': {\n if (isTemplate(dragged_id)) {\n let templateRec = getTemplate(dragged_id);\n updateReactData({\n eventIDFilter: templateRec.event_data.event_id,\n idFilter: false,\n // filterTextLower: templateRec.event_data.generic_description.toLowerCase()\n }, true);\n }\n else {\n updateReactData({\n eventIDFilter: false,\n idFilter: dragged_id,\n // filterTextLower: `${personRec.name.last.toLowerCase()} ${personRec.name.first.toLowerCase()}`\n }, true);\n }\n break;\n }\n default: { }\n }\n dropTarget = {};\n };\n\n function resolve(request, ownerRec) {\n let response = deepCopy(request);\n do {\n let result = response.match(/(.*?)(%%)(.*?)(%%)(.*)/);\n if (!result) {\n break;\n }\n let [, front, , middle, , back] = result;\n if (middle) {\n switch (middle) {\n case 'last_name': {\n response = `${front}${ownerRec.name.last}${back}`;\n break;\n }\n case 'first_name': {\n response = `${front}${ownerRec.name.first}${back}`;\n break;\n }\n case 'location': {\n response = `${front}${ownerRec.location || ''}${back}`;\n break;\n }\n default: {\n response = `${front}${middle}${back}`;\n }\n }\n }\n } while (response.includes('%%'));\n return response;\n }\n\n async function eventSignup(dragged_id, { droppedOn_event, eventIndex, dateIndex }) {\n console.log(`dropped ${dragged_id} onto ${droppedOn_event.description}`);\n if (ownerOfSlots(droppedOn_event, dragged_id)) {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Already included',\n message: `${dragged_id} is already included in ${droppedOn_event.description}`\n }\n }, true);\n }\n else {\n // does this person have a conflict with this event?\n // what is the start time of this event?\n let eventStart24 = droppedOn_event.time?.from ? makeTime(droppedOn_event.time.from.trim()).numeric24 : 0;\n let eventEnd24 = droppedOn_event.time?.to ? makeTime(droppedOn_event.time.to.trim()).numeric24 : 2359;\n if (!isEmpty(reactData.conflictInfo)\n && reactData.conflictInfo.hasOwnProperty(dragged_id)\n && reactData.conflictInfo[dragged_id].hasOwnProperty(droppedOn_event.occurrence_date)\n ) {\n let isAvailable = true;\n let conflictingEvent;\n reactData.conflictInfo[dragged_id][droppedOn_event.occurrence_date].some(this_time => {\n if (this_time.time < eventStart24) {\n // event hasn't started - hold onto current availability and (if not available) the event that causes the potential conflict,\n isAvailable = this_time.open;\n conflictingEvent = !this_time.open ? this_time.event_title : null;\n }\n else if (this_time.time >= eventEnd24) {\n // the event started and ended before this possible conflict came up; \n // your availability for the event will depend on what your availabilty was immediately BEFORE the event - which was stored in the earlier step(s)\n return true; // break the loop and use the current value of isAvailable\n }\n else {\n // implied (this_time.time < eventEnd24)\n // this entry is changing your availability DURING the event; \n // if this conflict marker marks you as unavailable OR you were unavailable from before the event, there is a conflict\n if (!this_time.open) {\n isAvailable = false;\n conflictingEvent = this_time.event_title;\n }\n if (!isAvailable) {\n return true;\n }\n }\n return false; // return false to the .some function to keep it running\n });\n if (!isAvailable) {\n handleConflictOptions({\n conflictingEvent,\n dragged_id,\n eventObj: { droppedOn_event, eventIndex, dateIndex, eventStart24, eventEnd24 }\n });\n return;\n }\n }\n await proceedWithSignUp(dragged_id, { droppedOn_event, eventIndex, dateIndex, eventStart24, eventEnd24 });\n }\n }\n\n async function proceedWithSignUp(dragged_id, { droppedOn_event, eventIndex, dateIndex, eventStart24, eventEnd24 }) {\n let { slotAssigned, slotUpdates } = await handleAllocateSlot({\n person_id: dragged_id,\n this_event: droppedOn_event,\n eventIndex,\n dateIndex\n });\n if ((eventIndex > -1) && (dateIndex > -1)) {\n if (slotUpdates.newDescription) {\n reactData.myCalendar[dateIndex].eventList[eventIndex].description = slotUpdates.newDescription;\n }\n if (slotAssigned) {\n if (!reactData.myCalendar[dateIndex].eventList[eventIndex].hasOwnProperty('slot_owners')) {\n reactData.myCalendar[dateIndex].eventList[eventIndex].slot_owners = {};\n }\n reactData.myCalendar[dateIndex].eventList[eventIndex].slot_owners[dragged_id] = slotAssigned;\n if (!reactData.conflictInfo.hasOwnProperty(dragged_id)) {\n reactData.conflictInfo[dragged_id] = {};\n }\n let this_date = makeDate(droppedOn_event.occurrence_date);\n let this_Sunday = makeDate(addDays(this_date.date, -(this_date.dayOfWeek)));\n if (!reactData.conflictInfo[dragged_id].hasOwnProperty('summaries')) {\n reactData.conflictInfo[dragged_id].summaries = {\n [this_Sunday.numeric$]: {\n description: this_Sunday.dateOnly,\n minutes: 0\n }\n };\n }\n else if (!reactData.conflictInfo[dragged_id].summaries.hasOwnProperty(this_Sunday.numeric$)) {\n reactData.conflictInfo[dragged_id].summaries[this_Sunday.numeric$] = {\n description: this_Sunday.dateOnly,\n minutes: 0\n };\n }\n let start_time = makeTime(eventStart24);\n let end_time = makeTime(eventEnd24);\n let minutes_booked = 0;\n if (end_time.minutesSinceMidnight < start_time.minutesSinceMidnight) {\n minutes_booked = end_time.minutesSinceMidnight + (1440 - start_time.minutesSinceMidnight);\n }\n else {\n minutes_booked = end_time.minutesSinceMidnight - start_time.minutesSinceMidnight;\n }\n if (minutes_booked < 1200) {\n reactData.conflictInfo[dragged_id].summaries[this_Sunday.numeric$].minutes += minutes_booked;\n }\n if (!reactData.conflictInfo[dragged_id].hasOwnProperty(droppedOn_event.occurrence_date)) {\n reactData.conflictInfo[dragged_id][droppedOn_event.occurrence_date] = [];\n }\n reactData.conflictInfo[dragged_id][droppedOn_event.occurrence_date].push(\n {\n time: eventStart24,\n open: false,\n event_id: reactData.myCalendar[dateIndex].eventList[eventIndex].event_id,\n event_title: reactData.myCalendar[dateIndex].eventList[eventIndex].description\n },\n { time: eventEnd24, open: true }\n );\n reactData.conflictInfo[dragged_id][droppedOn_event.occurrence_date].sort((a, b) => {\n if (a.time === b.time) {\n return (!a.open ? 1 : -1);\n }\n else {\n return ((a.time < b.time) ? -1 : 1);\n }\n });\n updateReactData({\n myCalendar: reactData.myCalendar\n }, true);\n }\n }\n updateReactData({\n checkConflict: false,\n conflictProceed: false\n }, true);\n return;\n }\n\n const handleAllocateSlot = async ({ this_event, person_id, eventIndex, dateIndex }) => {\n let slotToUse;\n if (!['time', 'seats'].includes(this_event.type)) {\n slotToUse = person_id;\n }\n else {\n let slotInfo = await getSlotList({\n client: state.session.client_id,\n \"event\": this_event.event_key\n });\n let slotList = Object.keys(slotInfo.slotObj).sort();\n let foundAt = slotList.findIndex(this_slot => {\n return (!slotInfo.slotObj[this_slot].status || ['released', 'available'].includes(slotInfo.slotObj[this_slot].status));\n });\n if (foundAt < 0) {\n console.log(`No available slots`);\n let [eventInfo, occInfo] = await getCalendarEntries({\n person_id,\n client: this_event.client,\n event_id: this_event.event_key\n });\n this_event.occData = Object.assign({},\n eventInfo.eventData.event_data,\n eventInfo.eventData,\n { location: eventInfo.eventData.event_data.location.description },\n { signup_type: eventInfo.eventData.sign_up.type },\n occInfo,\n { date: occInfo.occurrence_date },\n { time$: `${eventInfo.eventData.event_data.time.from}${((eventInfo.eventData.event_data.time.to && eventInfo.eventData.event_data.time.to.trim() !== '') ? ' to ' + eventInfo.eventData.event_data.time.to : '')}` },\n { time24: this_event.time24 }\n );\n this_event.date_index = dateIndex;\n this_event.event_index = eventIndex;\n updateReactData({\n event_being_edited: this_event\n }, true);\n return null;\n }\n else {\n slotToUse = slotList[foundAt];\n }\n }\n let writeRequest = {\n \"client\": state.session.client_id,\n \"event\": this_event.event_key,\n \"occurrence_date\": this_event.occurrence_date,\n \"owner\": person_id,\n \"slot\": slotToUse,\n \"status\": 'selected',\n \"show_this_slot\": true\n };\n if (this_event.hasOwnProperty('default_forms')) {\n writeRequest.default_forms = deepCopy(this_event.default_forms);\n }\n if (this_event.hasOwnProperty('customizations')) {\n writeRequest.customizations = deepCopy(this_event.customizations);\n }\n if (!reactData.defaultValues.message_override) {\n writeRequest.no_messaging = false;\n }\n else {\n let overrideList = makeArray(reactData.defaultValues.message_override);\n if (overrideList.some(oItem => {\n return oItem.toLowerCase().startsWith('*none');\n })) {\n writeRequest.no_messaging = true;\n }\n else if (overrideList.some(oItem => {\n return oItem.toLowerCase().startsWith('*published');\n })) {\n if (!this_event.published) {\n writeRequest.no_messaging = true;\n }\n else {\n // event is already published and this instruction asks to message people only when published...\n writeRequest.no_messaging = false;\n writeRequest.overrideRecipient = [];\n for (const this_person of overrideList) {\n let instruction = this_person.split('=');\n if (instruction[0].startsWith('*published')) {\n instruction[0] = instruction[1];\n }\n if (instruction) {\n if (instruction[0].startsWith('slot')) {\n writeRequest.overrideRecipient.push(person_id);\n }\n else if (instruction[0].startsWith('event')) {\n writeRequest.overrideRecipient.push(...makeArray(this_event.owner));\n }\n else {\n writeRequest.overrideRecipient.push(instruction[0]);\n }\n }\n }\n if (writeRequest.overrideRecipient.length === 0) {\n writeRequest.overrideRecipient.push(person_id);\n }\n writeRequest.override_subject = `Changes have been made to ${this_event.description} (${makeDate(this_event.occurrence_date, { noTime: true }).absolute}) that affect you`;\n writeRequest.override_messageText = `${await makeName(person_id)} has been added to this event.`;\n }\n }\n else {\n writeRequest.no_messaging = false;\n writeRequest.overrideRecipient = overrideList;\n }\n }\n let slotUpdates = await writeSlot(writeRequest);\n localStorage.setItem(`calendarChanged`, true);\n console.log(`Added ${person_id} to ${this_event.description}${(slotToUse === person_id) ? '' : ' - ' + slotToUse}`);\n return { slotAssigned: slotToUse, slotUpdates };\n };\n\n const isDense = (this_date) => {\n if (window.window.innerWidth < 800) {\n return false;\n }\n else if (reactData.denseView.hasOwnProperty(this_date)) {\n return reactData.denseView[this_date];\n }\n else {\n return reactData.denseView['*all'];\n }\n };\n\n const setTextColor = (this_event, this_date, agendaView) => {\n if (!agendaView && reactData.idFilter && isUnAvailable(this_date, reactData.idFilter)) {\n return { color: contrastColor(hexColors[reactData.colorScheme.unavailable]) };\n }\n else if (!this_event) {\n return { color: reactData.calendar_fill_text };\n }\n else if (this_event.customizations && this_event.customizations.show_as_unavailable && reactData.colorScheme.unavailable) {\n return { color: reactData.colorScheme.empty };\n }\n else if (ownerOfSlots(this_event) && !reactData.defaultValues.onlyRegistered && reactData.colorScheme.owned) { return { color: reactData.colorScheme.owned }; }\n else if (allSlotsFull(this_event) && reactData.colorScheme.full) { return { color: reactData.colorScheme.full }; }\n else if (allSlotsEmpty(this_event) && reactData.colorScheme.empty) { return { color: reactData.colorScheme.empty }; }\n else {\n let numberToCheck, keyColor;\n Object.keys(reactData.colorScheme).forEach(scheme => {\n if (scheme.startsWith('lessThan')) {\n numberToCheck = scheme.split('_')[1].trim();\n keyColor = reactData.colorScheme[scheme];\n }\n });\n if (numberToCheck\n && !isNaN(Number(numberToCheck))\n && (Object.keys(this_event.slot_owners).length < Number(numberToCheck))\n ) {\n return { color: keyColor };\n }\n numberToCheck = null;\n Object.keys(reactData.colorScheme).forEach(scheme => {\n if (scheme.startsWith('atLeast')) {\n numberToCheck = scheme.split('_')[1].trim();\n keyColor = reactData.colorScheme[scheme];\n }\n });\n if (numberToCheck\n && !isNaN(Number(numberToCheck))\n && (Object.keys(this_event.slot_owners).length >= Number(numberToCheck))\n ) {\n return { color: keyColor };\n }\n if (isWaitListed(this_event) && reactData.colorScheme.waitlisted) { return { color: reactData.colorScheme.waitlisted }; }\n else if (waitListExists(this_event) && reactData.colorScheme.waitlist) {\n return { color: reactData.colorScheme.waitlist };\n }\n }\n return {\n color: reactData.calendar_fill_text\n };\n };\n\n const setAvailabilityColor = (minutes) => {\n if (minutes <= 0) { return 'red'; }\n else if (minutes >= 540) { return 'green'; }\n let g = Math.min((minutes / 270), 1);\n let r = (minutes <= 270) ? 1 : ((540 - minutes) / 270);\n return make_rgba(r, g, 0, 0.5);\n };\n\n function setBackgroundColor(this_date) {\n let this_background = reactData.calendar_fill;\n if (this_date.date_words === 'Today') {\n this_background = 'white';\n }\n else if (this_date.dateObj.weekday === 'weekend') {\n this_background = (isDarkMode ? 'darkgoldenrod' : 'lightyellow');\n }\n if (reactData.idFilter) {\n if (isUnAvailable(this_date, reactData.idFilter)) {\n this_background = reactData.colorScheme.unavailable;\n }\n }\n return this_background;\n }\n\n function makeCalendarTime(i) {\n if (isObject(i)) {\n return `${i.from || ''}${(i.from && i.to && (i.from.trim() !== '') && (i.to.trim() !== '')) ? ' to ' : ''}${i.to || ''}`;\n }\n else { return i; }\n }\n\n function ordinal(n) {\n let ord = 'th';\n if (n % 10 === 1 && n % 100 !== 11) {\n ord = 'st';\n }\n else if (n % 10 === 2 && n % 100 !== 12) {\n ord = 'nd';\n }\n else if (n % 10 === 3 && n % 100 !== 13) {\n ord = 'rd';\n }\n return `${n}${ord}`;\n }\n\n return (\n \n {reactData.myCalendar &&\n \n \n \n \n \n \n \n {reactData.defaultValues.assignmentView\n ? `Calendar Management`\n : `${reactData.display_name}${reactData.display_name.slice(-1) === 's' ? \"'\" : \"'s\"} Calendar`\n }\n \n {reactData.defaultValues.subtitle &&\n \n {reactData.defaultValues.subtitle}\n \n }\n \n \n {(reactData.myCalendar.length === 0) &&\n \n \n This Calendar is empty!\n \n \n }\n \n {\n handleClick(event);\n updateReactData({\n popUpOpen: true\n }, true);\n }}\n alt=''\n src={state.session?.client_logo || process.env.REACT_APP_AVA_LOGO}\n />\n {\n updateReactData({\n popUpOpen: false\n }, true);\n }}\n keepMounted\n >\n \n {!reactData.defaultValues.assignmentView &&\n {\n updateReactData({\n selectPerson: true,\n popUpOpen: false\n }, true);\n }}\n >\n \n \n {`View someone else's calendar`}\n \n \n }\n {\n if (agendaView()) {\n // switching to calendar view, use rememberedDenseData\n reactData.defaultValues.agendaView = false;\n if (reactData.defaultValues.rememberedDenseData) {\n reactData.denseView = deepCopy(reactData.defaultValues.rememberedDenseData);\n }\n }\n else {\n // switching to agendaView, dense should be false\n reactData.defaultValues.agendaView = true;\n reactData.defaultValues.rememberedDenseData = deepCopy(reactData.denseView);\n reactData.denseView = { '*all': false };\n }\n updateReactData({\n defaultValues: reactData.defaultValues,\n denseView: reactData.denseView,\n popUpOpen: false\n }, true);\n }}\n >\n \n {agendaView() ? : }\n {agendaView() ? 'Calendar view' : 'Agenda view'}\n \n \n {!agendaView() &&\n {\n updateReactData({\n denseView: { '*all': !reactData.denseView['*all'] },\n popUpOpen: false\n }, true);\n }}\n >\n \n {(reactData.denseView && reactData.denseView['*all']) ? : }\n {reactData.denseView['*all'] ? 'Relaxed view' : 'Dense view'}\n \n \n }\n {\n reactData.defaultValues.slotsView = !reactData.defaultValues.slotsView;\n updateReactData({\n defaultValues: reactData.defaultValues,\n popUpOpen: false\n }, true);\n }}\n >\n \n {showSlots() ? : }\n {showSlots() ? 'Hide people' : 'Show people'}\n \n \n {\n updateReactData({\n setFilter: true,\n popUpOpen: false\n }, true);\n }}\n >\n \n {}\n \n {'Filter entries'}\n \n \n \n {\n updateReactData({\n setDates: true,\n popUpOpen: false\n }, true);\n }}\n >\n \n {}\n \n {'Modify dates'}\n \n \n \n {\n await printCalendar(\n {\n client_id: state.session.client_id,\n myCalendar: reactData.myCalendar,\n requestor: state.session.user_id,\n filterTextLower: reactData.filterTextLower,\n groupFilter: state.groups.belongsTo,\n onlyRegistered: reactData.defaultValues.onlyRegistered ? reactData.selectedPerson_id : null\n }\n );\n updateReactData({\n popUpOpen: false\n }, true);\n }}\n >\n \n {}\n \n {'Print'}\n \n \n \n {\n updateReactData({\n setPublishDates: true,\n popUpOpen: false\n }, true);\n }}\n >\n \n {}\n \n {'Publish'}\n \n \n \n {\n onClose();\n }}\n >\n \n \n {'Go to AVA Menu'}\n \n \n {\n let jumpTo = window.location.origin;\n window.location.replace(jumpTo);\n }}\n >\n \n \n {'Restart AVA'}\n \n \n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n {`User ${state.session.user_id}${reactData.selectedPerson_id !== state.session.user_id ? (' (' + reactData.selectedPerson_id + ')') : ''}`}\n {`Function: Calendar`}\n \n \n \n \n \n {reactData.defaultValues.assignmentView &&\n \n {reactData.defaultValues.template__List && !reactData.defaultValues.no_dragTemplate &&\n \n {reactData.defaultValues.template__List.map((this_template, tX) => (\n \n handleDragStart(e, `template: ${tX}%%${this_template.event_data.event_id}`)\n }\n >\n \n \n
    \n {(this_template.event_data.generic_description || this_template.event_data.description).split(' ').map((this_word, wX) => (\n \n {this_word}\n \n ))\n }\n \n ))}\n \n }\n {reactData.defaultValues.assignment__List.map((this_list, lX) => (\n \n {this_list.assignmentList.map((this_candidate, cX) => (\n \n handleDragStart(e, this_candidate.person_id)}\n title={\n \n \n {this_candidate.display_name}\n \n {reactData.conflictInfo[this_candidate.person_id]\n ?\n Object.keys(reactData.conflictInfo[this_candidate.person_id].summaries).map((conflict_date, cDateX) => (\n \n {(reactData.conflictInfo[this_candidate.person_id].summaries[conflict_date].minutes > 0)\n ?\n \n {`Hrs wk of ${ordinal(conflict_date % 100)}: ${(Math.round((reactData.conflictInfo[this_candidate.person_id].summaries[conflict_date].minutes / 60) * 10) / 10).toFixed(1)}`}\n \n :\n \n {`Nothing scheduled wk of ${ordinal(conflict_date % 100)}`}\n \n }\n \n ))\n :\n \n \n {'Nothing Scheduled'}\n \n \n }\n {reactData.conflictInfo[this_candidate.person_id] && reactData.clicked_on_date &&\n reactData.conflictInfo[this_candidate.person_id][reactData.clicked_on_date.numeric$] &&\n reactData.conflictInfo[this_candidate.person_id][reactData.clicked_on_date.numeric$].map((this_conflict, cN) => (\n !this_conflict.open &&\n \n \n {`${Math.floor((this_conflict.time - (this_conflict.time >= 1300 ? 1200 : 0)) / 100)}:${('0' + (this_conflict.time % 100).toString()).slice(-2)} ${this_conflict.event_title}`}\n \n \n ))\n }\n \n }\n placement='top-end'\n >\n \n \n {`${this_candidate.first_name.slice(0, 1)}${this_candidate.last_name.slice(0, 1)}`}\n \n \n \n {(reactData.defaultValues.assignmentDisplayBy\n && reactData.defaultValues.assignmentDisplayBy.toLowerCase().includes('last'))\n ?\n \n \n {this_candidate.last_name}\n \n \n {this_candidate.first_name}\n \n \n :\n \n \n {this_candidate.first_name}\n \n \n {this_candidate.last_name}\n \n \n }\n \n ))}\n \n ))}\n \n }\n\n \n {!reactData.loading &&\n \n \n \n {reactData.myCalendar && (reactData.myCalendar.length > 0) &&\n reactData.myCalendar.map((this_date, dateIndex) => ( // an array of dates\n (!this_date.dateObj.error &&\n \n {((!agendaView()) || eventsToShow(this_date)) &&\n \n { /* Date in calendar cell */}\n .45)) ? 2 : 0}\n mt={1}\n justifyContent={'center'}\n style={{\n borderColor: setTextColor(null, this_date, agendaView()).color,\n }}\n onDragOver={(e) =>\n handleDragOver(e, {\n type: 'calendar_cell',\n data: {\n this_date,\n dateIndex\n }\n })\n }\n onDrop={async (e) => {\n await handleDrop(e, 'calendar_cell');\n }}\n >\n .45)) ? 'row' : 'column'}\n justifyContent={agendaView() ? 'flex-start' : 'center'}\n alignItems={'center'}\n onClick={() => {\n let clicked_on_date = false;\n if (agendaView()) {\n if (!reactData.clicked_on_date || (reactData.clicked_on_date.numeric$ !== this_date.dateObj.numeric$)) {\n clicked_on_date = this_date.dateObj;\n }\n updateReactData({\n clicked_on_date\n }, true);\n }\n else {\n let denseView = {\n '*all': reactData.denseView['*all']\n };\n if (!reactData.denseView.hasOwnProperty(this_date.dateObj.numeric$) ||\n (reactData.denseView[this_date.dateObj.numeric$] === reactData.denseView['*all'])) {\n denseView[this_date.dateObj.numeric$] = !reactData.denseView['*all'];\n clicked_on_date = (denseView[this_date.dateObj.numeric$] ? false : this_date.dateObj);\n }\n updateReactData({\n clicked_on_date,\n denseView\n }, true);\n }\n }}\n >\n \n {isDense(this_date.dateObj.numeric$)\n ? this_date.dateObj.dayOfWeek_word.slice(0, 3)\n : this_date.dateObj.dayOfWeek_word\n }\n \n \n {''}\n \n {(this_date.dateObj.date.getDate() === 1) &&\n (!isDense(this_date.dateObj.numeric$)) &&\n \n {this_date.dateObj.date.toLocaleString([], { month: 'long' })}\n \n }\n \n {ordinal(this_date.dateObj.date.getDate())}\n \n \n \n\n { /* Calendar cell contents */}\n {(!isDense(this_date.dateObj.numeric$) || (reactData.factor7 > .45)) &&\n \n {((this_date.eventList.length === 0) || (!eventsToShow(this_date))) ?\n \n handleDragOver(e, {\n type: 'calendar_cell',\n data: {\n this_date,\n dateIndex\n }\n })\n }\n onDrop={async (e) => {\n await handleDrop(e, 'calendar_cell');\n }}\n >\n \n {((this_date.eventList.length === 0) ? `No Events Scheduled` : `No Events Match your Filter`)}\n \n \n :\n \n {this_date.eventList.map((this_event, eventIndex) => ( // an array of events on this date\n okToShow(this_event) &&\n \n handleDragOver(e, {\n type: 'event',\n data: { droppedOn_event: this_event, eventIndex, dateIndex }\n })\n }\n onDrop={async (e) => {\n await handleDrop(e, 'event');\n }}\n display='flex' flexDirection='column'\n py={isDense(this_date.dateObj.numeric$) ? reactData.factor7 : 1}\n px={1}\n mt={0}\n mb={isDense(this_date.dateObj.numeric$) ? reactData.factor7 : 1}\n variant='outlined'\n textAlign={agendaView() ? 'flex-start' : 'center'}\n key={`details${this_date.dateObj.numeric$}_${eventIndex}`}\n onClick={async () => {\n switch (this_event.type) {\n case 'holiday': {\n break;\n }\n case 'birthday': {\n break;\n }\n case 'personal': {\n break;\n }\n default: {\n let [eventInfo, occInfo] = await getCalendarEntries({\n person_id: reactData.selectedPerson_id,\n client: this_event.client,\n event_id: this_event.event_key\n });\n this_event.occData = Object.assign({},\n eventInfo.eventData.event_data,\n eventInfo.eventData,\n { location: eventInfo.eventData.event_data.location.description },\n { signup_type: eventInfo.eventData.sign_up.type },\n occInfo,\n { date: occInfo.occurrence_date },\n { time$: this_event.time$ },\n { time24: this_event.time24 }\n );\n this_event.date_index = dateIndex;\n this_event.event_index = eventIndex;\n updateReactData({\n event_being_edited: this_event\n }, true);\n }\n }\n }}\n >\n \n \n \n {titleCase(this_event.description)}\n \n {isWaitListed(this_event) &&\n \n {`You're on the Waitlist`}\n \n }\n {this_event.slot_owners.hasOwnProperty(reactData.selectedPerson_id)\n ?\n \n {!reactData.defaultValues.onlyRegistered\n && (this_date.dateObj.numeric >= reactData.todayYMD)\n &&\n \n {`You're on the list`}\n \n }\n \n {((this_event.type === 'time')\n ? (makeTime(this_event.slot_owners[reactData.selectedPerson_id]).time)\n : (makeCalendarTime(this_event.time)))\n }\n \n \n :\n \n {this_event.time\n &&\n \n {makeCalendarTime(this_event.time)}\n \n }\n \n }\n \n \n {showSlots() && this_event.slot_owners\n && (Object.keys(this_event.slot_owners).length > 0)\n && (Object.keys(this_event.slot_owners).sort((a, b) => {\n return ((this_event.slot_owners[a] > this_event.slot_owners[b]) ? 1 : -1);\n })).map(this_owner => (\n \n {`${(this_event.type === 'time') ? makeTime(this_event.slot_owners[this_owner]).short + ' ' : ''}${getPersonName(this_owner.split('%%')[0])}`}\n \n\n ))}\n \n ))}\n \n }\n \n }\n \n }\n {(((dateIndex + 1) % 7) === 0)\n && reactData.defaultValues.weekView\n && !agendaView()\n &&\n \n }\n \n )\n ))\n }\n \n \n \n }\n {!reactData.loading && reactData.setFilter &&\n {\n updateReactData({\n setFilter: false\n }, true);\n }}\n onSave={async (response, buttonPressed) => {\n let reactUpdObj = {\n setFilter: false\n };\n if ((response.length === 0) || (response[0].length === 0) || (buttonPressed === 2)) {\n reactUpdObj.filterTextLower = false;\n reactUpdObj.idFilter = false;\n reactUpdObj.eventIDFilter = false;\n }\n else {\n reactUpdObj.filterTextLower = response[0].toLowerCase();\n }\n updateReactData(reactUpdObj, true);\n }}\n />\n }\n {!reactData.loading && reactData.setDates &&\n {\n updateReactData({\n setDates: false\n }, true);\n }}\n onSave={async (response) => {\n updateReactData({\n setDates: false\n }, false);\n if (response.length > 1) {\n let newStart = makeDate(response[0]);\n if (newStart.error) { }\n else if (defaultValues.weekView) {\n let revisedStart = addDays(newStart.date, -(newStart.dayOfWeek));\n newStart = makeDate(revisedStart);\n }\n onClose({\n action: 'reset',\n newStartDate: newStart.date,\n newEndDate: makeDate(response[1]).date\n });\n }\n }}\n />\n }\n {!reactData.loading && reactData.getAppointmentType &&\n {\n this_selection.value = this_selection.event_data.event_id;\n this_selection.label = this_selection.event_data.description;\n return this_selection;\n }).concat([{ value: '%%no_template%%', label: 'No Appointment Type' }]), null, null]}\n onCancel={() => {\n updateReactData({\n getAppointmentType: false\n }, true);\n }}\n onSave={async (response) => {\n if ((response[0] === '%%no_template%%') || (!response[0])) {\n updateReactData({\n addPersonalEvent: true,\n getAppointmentType: false,\n isAppointment: true,\n appointmentStart: response[1],\n appointmentEnd: response[2]\n }, true);\n }\n else {\n updateReactData({\n getAppointmentType: false,\n addTemplateEvent: true,\n selectedTemplate: getTemplate(`template%%${response[0]}`),\n isAppointment: true,\n appointmentStart: response[1],\n appointmentEnd: response[2]\n }, true);\n }\n }}\n />\n }\n {!reactData.loading && reactData.setPublishDates &&\n {\n updateReactData({\n setPublishDates: false\n }, true);\n }}\n onSave={async (response) => {\n if (response.length > 1) {\n await executePublish(response);\n }\n updateReactData({\n myCalendar: reactData.myCalendar,\n setPublishDates: false\n }, true);\n }}\n />\n }\n\n {!reactData.loading && reactData.event_being_edited &&\n {\n let updateObj = {\n event_being_edited: false\n };\n if (updatedData.event_cancelled) {\n onClose({\n action: 'reset',\n });\n }\n else {\n let calRef = reactData.myCalendar[reactData.event_being_edited.date_index].eventList[reactData.event_being_edited.event_index];\n calRef.description = updatedData.description;\n calRef.slot_owners = updatedData.summaryInfo.slot_owners;\n if (updatedData.wait_list) {\n calRef.wait_list = updatedData.wait_list;\n }\n if (calRef.time24 !== updatedData.time24) {\n calRef.time = deepCopy(updatedData.time);\n calRef.time$ = updatedData.time$;\n calRef.time24 = updatedData.time24;\n localStorage.setItem(`calendarChanged`, true);\n }\n if (calRef.occurrence_date !== updatedData.date) {\n if (reactData.myCalendar.hasOwnProperty(updatedData.date)) {\n reactData.myCalendar[updatedData.date].eventList[reactData.event_being_edited.event_index] = deepCopy(calRef);\n updateObj.myCalendar = reactData.myCalendar;\n localStorage.setItem(`calendarChanged`, true);\n }\n }\n }\n updateReactData(updateObj, true);\n }}\n />\n }\n {!reactData.loading && reactData.addPersonalEvent &&\n {\n let reactUpdObj = {\n addPersonalEvent: false,\n isAppointment: false\n };\n if (newEvent) {\n let slotObj = {};\n newEvent.slots.forEach(this_slot => {\n slotObj[this_slot.slot_owner] = this_slot.slot_owner;\n });\n newEvent.occRecords.occArray.forEach(newOccDate => {\n let foundIt = reactData.myCalendar.findIndex(this_date => {\n return (this_date.dateObj.numeric === newOccDate);\n });\n if (foundIt > -1) {\n let newEntry = {\n \"event_id\": newEvent.event_id,\n \"owner\": [state.session.user_id],\n \"image\": null,\n \"description\": newEvent.eventData.event_data.description,\n \"groups\": newEvent.eventData.event_data.groups,\n \"location\": newEvent.eventData.event_data.location,\n \"time\": newEvent.eventData.event_data.time,\n \"type\": 'appointment',\n \"sort24\": (newEvent.eventData.event_data.time.from ? makeTime(newEvent.eventData.event_data.time.from).numeric24 : 0),\n \"slot_owners\": slotObj,\n \"occurrence_date\": newOccDate,\n \"event_key\": `${newEvent.event_key}#${newOccDate}`,\n \"client\": newEvent.client,\n \"record_type\": \"occurrence\"\n };\n let eventIndex = reactData.myCalendar[foundIt].eventList.push(newEntry) - 1;\n newEvent.slots.forEach(this_slot => {\n let dragged_id = this_slot.slot_owner;\n if (!reactData.conflictInfo.hasOwnProperty(dragged_id)) {\n reactData.conflictInfo[dragged_id] = {};\n }\n let this_date = makeDate(newOccDate);\n let this_Sunday = makeDate(addDays(this_date.date, -(this_date.dayOfWeek)));\n if (!reactData.conflictInfo[dragged_id].hasOwnProperty('summaries')) {\n reactData.conflictInfo[dragged_id].summaries = {\n [this_Sunday.numeric$]: {\n description: this_Sunday.dateOnly,\n minutes: 0\n }\n };\n }\n else if (!reactData.conflictInfo[dragged_id].summaries.hasOwnProperty(this_Sunday.numeric$)) {\n reactData.conflictInfo[dragged_id].summaries[this_Sunday.numeric$] = {\n description: this_Sunday.dateOnly,\n minutes: 0\n };\n }\n let start_time = makeTime(newEvent.eventData.event_data.time.from);\n let end_time = makeTime(newEvent.eventData.event_data.time.to);\n let minutes_booked = 0;\n if (end_time.minutesSinceMidnight < start_time.minutesSinceMidnight) {\n minutes_booked = end_time.minutesSinceMidnight + (1440 - start_time.minutesSinceMidnight);\n }\n else {\n minutes_booked = end_time.minutesSinceMidnight - start_time.minutesSinceMidnight;\n }\n if (minutes_booked < 1200) {\n reactData.conflictInfo[dragged_id].summaries[this_Sunday.numeric$].minutes += minutes_booked;\n }\n if (!reactData.conflictInfo[dragged_id].hasOwnProperty(newOccDate)) {\n reactData.conflictInfo[dragged_id][newOccDate] = [];\n }\n reactData.conflictInfo[dragged_id][newOccDate].push(\n {\n time: start_time.numeric24, open: false, event_id: reactData.myCalendar[foundIt].eventList[eventIndex].event_key,\n event_title: reactData.myCalendar[foundIt].eventList[eventIndex].description\n },\n { time: end_time.numeric24, open: true }\n );\n reactData.conflictInfo[dragged_id][newOccDate].sort((a, b) => {\n if (a.time === b.time) {\n return (!a.open ? 1 : -1);\n }\n else {\n return ((a.time < b.time) ? -1 : 1);\n }\n });\n });\n reactData.myCalendar[foundIt].eventList.sort((a, b) => {\n if (a.customizations && a.customizations.show_as_unavailable) {\n return 1;\n }\n else if (b.customizations && b.customizations.show_as_unavailable) {\n return -1;\n }\n else if (a.sort24 > b.sort24) {\n return 1;\n }\n else if (a.sort24 < b.sort24) {\n return -1;\n }\n else {\n return (a.description > b.description ? 1 : -1);\n }\n });\n }\n });\n reactUpdObj.myCalendar = reactData.myCalendar;\n localStorage.setItem(`calendarChanged`, true);\n }\n updateReactData(reactUpdObj, true);\n }}\n />\n }\n {!reactData.loading && reactData.addTemplateEvent &&\n {\n let reactUpdObj = {\n addTemplateEvent: false,\n isAppointment: false\n };\n if (newEvent) {\n for (let o = 0; o < newEvent.occRecords.occArray.length; o++) {\n let newOccDate = newEvent.occRecords.occArray[o];\n let foundIt = reactData.myCalendar.findIndex(this_date => {\n return (this_date.dateObj.numeric === newOccDate);\n });\n let slotObj = {};\n newEvent.slots.forEach(this_slot => {\n slotObj[this_slot.slot_owner] = this_slot.slot_owner;\n });\n let newEntry = Object.assign({}, newEvent, {\n \"event_id\": newEvent.event_id,\n \"owner\": [state.session.user_id],\n \"image\": null,\n \"description\": newEvent.eventData.event_data.description,\n \"groups\": newEvent.eventData.event_data.groups,\n \"location\": newEvent.eventData.event_data.location,\n \"time\": newEvent.eventData.event_data.time,\n \"type\": 'appointment',\n \"sort24\": (newEvent.eventData.event_data.time.from ? makeTime(newEvent.eventData.event_data.time.from).numeric24 : 0),\n \"slot_owners\": slotObj,\n \"occurrence_date\": newOccDate,\n \"event_key\": `${newEvent.event_key}#${newOccDate}`,\n \"client\": newEvent.client,\n \"record_type\": \"occurrence\"\n });\n let eventIndex = -1;\n if (foundIt > -1) {\n eventIndex = reactData.myCalendar[foundIt].eventList.push(newEntry) - 1;\n for (let s = 0; s < newEvent.slots.length; s++) {\n let this_slot = newEvent.slots[s];\n let dragged_id = this_slot.slot_owner;\n if (!reactData.conflictInfo.hasOwnProperty(dragged_id)) {\n reactData.conflictInfo[dragged_id] = {};\n }\n let this_date = makeDate(newOccDate);\n let this_Sunday = makeDate(addDays(this_date.date, -(this_date.dayOfWeek)));\n if (!reactData.conflictInfo[dragged_id].hasOwnProperty('summaries')) {\n reactData.conflictInfo[dragged_id].summaries = {\n [this_Sunday.numeric$]: {\n description: this_Sunday.dateOnly,\n minutes: 0\n }\n };\n }\n else if (!reactData.conflictInfo[dragged_id].summaries.hasOwnProperty(this_Sunday.numeric$)) {\n reactData.conflictInfo[dragged_id].summaries[this_Sunday.numeric$] = {\n description: this_Sunday.dateOnly,\n minutes: 0\n };\n }\n let start_time = makeTime(newEvent.eventData.event_data.time.from);\n let end_time = makeTime(newEvent.eventData.event_data.time.to);\n let minutes_booked = 0;\n if (end_time.minutesSinceMidnight < start_time.minutesSinceMidnight) {\n minutes_booked = end_time.minutesSinceMidnight + (1440 - start_time.minutesSinceMidnight);\n }\n else {\n minutes_booked = end_time.minutesSinceMidnight - start_time.minutesSinceMidnight;\n }\n if (minutes_booked < 1200) {\n reactData.conflictInfo[dragged_id].summaries[this_Sunday.numeric$].minutes += minutes_booked;\n }\n if (!reactData.conflictInfo[dragged_id].hasOwnProperty(newOccDate)) {\n reactData.conflictInfo[dragged_id][newOccDate] = [];\n }\n reactData.conflictInfo[dragged_id][newOccDate].push(\n {\n time: start_time.numeric24,\n open: false,\n event_id: reactData.myCalendar[foundIt].eventList[eventIndex].event_id,\n event_title: reactData.myCalendar[foundIt].eventList[eventIndex].description\n },\n { time: end_time.numeric24, open: true }\n );\n reactData.conflictInfo[dragged_id][newOccDate].sort((a, b) => {\n if (a.time === b.time) {\n return (!a.open ? 1 : -1);\n }\n else {\n return ((a.time < b.time) ? -1 : 1);\n }\n });\n };\n }\n if (reactData.selectedPersonRec) {\n await eventSignup(reactData.selectedPersonRec.person_id, {\n droppedOn_event: newEntry,\n eventIndex,\n dateIndex: foundIt\n });\n }\n if (foundIt > -1) {\n reactData.myCalendar[foundIt].eventList.sort((a, b) => {\n if (a.customizations && a.customizations.show_as_unavailable) {\n return 1;\n }\n else if (b.customizations && b.customizations.show_as_unavailable) {\n return -1;\n }\n else if (a.sort24 > b.sort24) {\n return 1;\n }\n else if (a.sort24 < b.sort24) {\n return -1;\n }\n else {\n return (a.description > b.description ? 1 : -1);\n }\n });\n }\n };\n reactUpdObj.myCalendar = reactData.myCalendar;\n localStorage.setItem(`calendarChanged`, true);\n if (reactData.selectedPersonRec) {\n dropTarget = {};\n reactUpdObj.selectedPersonRec = '';\n }\n }\n updateReactData(reactUpdObj, true);\n }}\n />\n }\n {reactData.selectPerson &&\n {\n updateReactData({\n selectPerson: false\n }, true);\n }}\n onSelect={async (selection) => {\n let [display_name, myChoice] = selection.split('%%');\n updateReactData({\n selectPerson: false,\n selectedPerson_id: myChoice,\n display_name\n }, true);\n }}\n >\n \n }\n \n }\n \n \n }\n onClick={() => {\n onClose({\n action: 'reset',\n newStartDate: addDays(reactData.defaultValues.start_date, -7)\n });\n }}\n >\n {(window.window.innerWidth < 800) ? '' : 'Back 1 week'}\n \n \n \n }\n onClick={() => {\n onClose();\n }}\n >\n {'Done'}\n \n }\n onClick={() => {\n updateReactData({\n setFilter: true,\n }, true);\n }}\n onDragOver={(e) =>\n handleDragOver(e, {\n type: 'filter_button'\n })\n }\n onDrop={async (e) => {\n await handleDrop(e, 'filter_button');\n }}\n >\n {'Filter'}\n \n {!reactData.defaultValues.assignmentView &&\n }\n onClick={async () => {\n let reactUpdObj = {\n addPersonalEvent: true\n };\n if (reactData.selectedPerson_id !== state.session.person_id) {\n reactUpdObj.selectedPersonRec = await getPerson(reactData.selectedPerson_id);\n reactUpdObj.isAppointment = true;\n }\n updateReactData(reactUpdObj, true);\n }}\n >\n {(reactData.selectedPerson_id !== state.session.person_id) ? 'Make an Appointment' : 'Add a Personal Event'}\n \n }\n \n \n }\n onClick={() => {\n onClose({\n action: 'reset',\n newEndDate: addDays(reactData.defaultValues.end_date, 7)\n });\n }}\n >\n {(window.window.innerWidth < 800) ? '' : 'Forward 1 week'}\n \n \n \n {reactData.alert &&\n {\n updateReactData({\n alert: false\n }, true);\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center'\n }}\n >\n \n {([reactData.alert.action].flat()).map((this_action, actionNdx) => (\n this_action.function()}\n >\n {this_action.text}\n \n ))}\n \n : null\n )}\n variant='filled'\n onClose={() => {\n updateReactData({\n alert: false\n }, true);\n }}\n >\n \n {reactData.alert.title && {reactData.alert.title}}\n {reactData.alert.message}\n \n \n \n }\n \n );\n};","import React from 'react';\n\nimport { useSnackbar } from 'notistack';\n\nimport { getCalendarEntries, v2buildCalendar } from '../../util/AVACalendars';\nimport { makeTime, addDays, makeDate } from '../../util/AVADateTime';\nimport { isEmpty, isObject, deepCopy, makeArray, array_in_array } from '../../util/AVAUtilities';\nimport { AVAclasses, AVADefaults, AVATextStyle } from '../../util/AVAStyles';\nimport { getGroupsBelongTo, getMemberList, getGroupMembers } from '../../util/AVAGroups';\n\n// import useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport Button from '@material-ui/core/Button';\nimport Slide from '@material-ui/core/Slide';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport CalendarForm from '../forms/CalendarForm';\nimport PersonFilter from '../forms/PersonFilter';\nimport CalendarEventEditForm from '../forms/CalendarEventEditForm';\n\nimport Typography from '@material-ui/core/Typography';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport LinearProgress from '@material-ui/core/LinearProgress';\n\nimport useSession from '../../hooks/useSession';\n\nconst useStyles = makeStyles(theme => ({\n formControl: {\n margin: 0,\n paddingTop: 0,\n },\n progressBar: {\n marginBottom: theme.spacing(3),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px'\n },\n formControlLbl: {\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n },\n freeInput: {\n marginLeft: '25px',\n marginTop: '5px',\n marginRight: 2,\n marginBottom: '10px',\n paddingLeft: 0,\n paddingRight: 0,\n width: '90%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n minHeight: theme.typography.fontSize * 2.8,\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n titleText: {\n fontSize: '1.3rem',\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n subDescriptionText: {\n marginLeft: theme.spacing(3),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n },\n\n picture: {\n width: theme.spacing(16),\n height: theme.spacing(16),\n [theme.breakpoints.down('xs')]: {\n width: theme.spacing(8),\n height: theme.spacing(8),\n },\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n listItemAVA: {\n fontSize: theme.typography.fontSize * 1.5,\n },\n client_background: {\n backgroundColor: isObject(AVADefaults({ client_style: 'get' })) ? AVADefaults({ client_style: 'get' }).calendar_background : null\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n }\n}));\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ patient, OGpatient, peopleList, defaultObject = {}, eventClient, calendarMode, onClose }) => {\n\n /*\n DEFAULT VALUES\n USED IN ShowCalendar\n show_group - only include events authorized for these groups\n eventList - an already contructed calendar, usually passed in from the background load done at AVA restart\n start_date - when building a calendar, start from this date\n end_date - when building a calendar, build through this date\n assignmentView - show list of people you can assign to events\n allowAssign - required when assignmentView is true; this becomes assignment__list and template__list\n \n CREATED BY ShowCalendar and sent to CalendarForm\n assignment__list - this is a list of people and groups that you may choose from to assign to events\n template__List - a list of event templates to use when creating new appointments\n \n PASSED THROUGH to CalendarForm without consideration\n slotsView - show all people that are signed up\n subtitle - if present, text to show under the person name\n agendaView - show in straigh-line \"agenda\" format\n onlyRegistered - only show events that I am signed-up for\n message_override - [list of IDs] or [*none*] (default if missing: added slots = message to the event owner)\n colorScheme - see CalendarForm for details of this object\n */\n\n const [showPersonSelect, setShowPersonSelect] = React.useState(false);\n const [showAll, setShowAll] = React.useState(true);\n\n const { enqueueSnackbar } = useSnackbar();\n const { state } = useSession();\n\n // some other function (assigments, new calendar entry, etc) may have changed the calendar\n // in this case, that function will have put \"true\" in local storage key calendarChanged\n // and require a rebuild of the calendar - this code checks for that, only using a passed in calendar\n // if the calendarChanged rebuild is not triggered...\n let load_myCal = [];\n if (defaultObject.hasOwnProperty('eventList')) {\n if (!defaultObject.eventList.loadError) {\n let needRefresh = localStorage.getItem(`calendarChanged`);\n if (!(needRefresh === 'true')) {\n load_myCal = defaultObject.eventList;\n }\n }\n }\n\n const [reactData, setReactData] = React.useState({\n start_date: 0,\n end_date: 0,\n defaultValues: defaultObject,\n selectedEvent: defaultObject.selectedEvent || '',\n myCalendar: load_myCal,\n loading: true\n });\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n const [statusMessage, setStatusMessage] = React.useState('Initializing');\n const [progress, setProgress] = React.useState(1);\n const [pWidth, setPWidth] = React.useState(60);\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const [changes, setChanges] = React.useState(false);\n if (changes) { }\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n const onStatusUpdate = (statusMessage, progressWidth, progressPct) => {\n setStatusMessage(statusMessage);\n setProgress(progressPct);\n setPWidth(progressWidth);\n // console.log(statusMessage, progressWidth, progressPct);\n setForceRedisplay(!forceRedisplay);\n };\n\n const setCalendar = async () => {\n // let rightNow = new Date();\n // let this_date = rightNow.getDate();\n let theCalendar = [];\n let oRecs;\n let checkClient = eventClient || (patient.adopted_client || patient.client_id);\n if (reactData.selectedEvent) {\n setShowAll(false);\n oRecs = await getCalendarEntries({\n client_id: checkClient,\n person_id: patient.patient_id,\n event_id: reactData.selectedEvent,\n type: ['occurrence'],\n allow_create: true\n });\n }\n else {\n setShowAll(true);\n oRecs = await getCalendarEntries({\n client_id: checkClient,\n startDate: reactData.start_date,\n endDate: reactData.end_date,\n type: ['occurrence']\n }, onStatusUpdate);\n }\n for (let o = 0; o < oRecs.length; o++) {\n onStatusUpdate('Checking sign-ups', oRecs.length, ((o / oRecs.length) * 100));\n let occRec = oRecs[o];\n let [eventRec] = await getCalendarEntries({\n client_id: checkClient,\n event_id: occRec.event_key,\n type: ['event']\n });\n let description, location, owner, signup_type, time$;\n let time24 = 0;\n if (eventRec.eventData) {\n description = eventRec.eventData.event_data.description;\n owner = eventRec.eventData.event_data.owner;\n signup_type = eventRec.eventData.event_data.type;\n if (eventRec.eventData.event_data.time) {\n time24 = makeTime(eventRec.eventData.event_data.time.from).numeric24;\n if (eventRec.eventData.event_data.time.to) {\n time$ = 'From ' + eventRec.eventData.event_data.time.from + ' to ' + eventRec.eventData.event_data.time.to;\n }\n else { time$ = eventRec.eventData.event_data.time.from; }\n }\n if (eventRec.eventData.event_data.location) {\n location = ((typeof eventRec.eventData.event_data.location === 'object')\n ? eventRec.eventData.event_data.location.description\n : eventRec.eventData.event_data.location);\n }\n else { location = ''; }\n }\n else if (eventRec.calData) {\n description = eventRec.calData.description;\n location = eventRec.calData.location;\n owner = eventRec.calData.owner;\n signup_type = eventRec.calData.signup_type;\n }\n if (occRec.occData && occRec.occData.event_data && occRec.occData.event_data.description) {\n description = occRec.occData.event_data.description;\n }\n let oDate;\n if (occRec.occData && occRec.occData.date) { oDate = occRec.occData.date; }\n else { oDate = occRec.occurrence_date; }\n let [slotRec] = await getCalendarEntries({\n client_id: checkClient,\n event_id: occRec.event_key,\n person_id: patient.patient_id || patient.person_id,\n type: ['slot']\n });\n let tCal = {\n client: occRec.client,\n event_key: occRec.event_key,\n id: occRec.event_id || occRec.id,\n // list_key: 'occurrence_master',\n schedule_key: `${oDate}`,\n occData: {\n date: Number(oDate),\n signup_type,\n description,\n location,\n time$,\n time24,\n owner\n }\n };\n if (slotRec) {\n tCal.slots = [{\n owner: patient.patient_id,\n id: slotRec.slotData.slot || slotRec.slotData.id,\n reminder_minutes: 0,\n name: slotRec.slotData.name\n }];\n }\n theCalendar.push(tCal);\n }\n // final sort\n theCalendar.sort((a, b) => {\n if (a.occData.date > b.occData.date) { return 1; }\n else if (a.occData.date < b.occData.date) { return -1; }\n else if (a.occData.time24 > b.occData.time24) { return 1; }\n else { return -1; }\n });\n return theCalendar;\n };\n\n const choosePerson = () => {\n setShowPersonSelect(true);\n };\n\n const handleAbort = () => {\n if (OGpatient.patient_id !== patient.patient_id) {\n patient.patient_display_name = OGpatient.patient_display_name;\n patient.patient_id = OGpatient.patient_id;\n patient.kiosk_mode = true;\n }\n setChanges(false);\n onClose();\n };\n\n const organizeCalendar = (this_calendar) => {\n let calendarList = [];\n Object.keys(this_calendar).forEach((this_date) => {\n if (!(this_date === 'peopleList')) {\n if (!this_calendar[this_date].events || (Object.keys(this_calendar[this_date].events).length === 0)) {\n calendarList.push({\n dateObj: makeDate(this_date),\n date_words: this_calendar[this_date].date_words,\n eventList: []\n });\n }\n else {\n let sorted_eventIDs = Object.keys(this_calendar[this_date].events).sort((s1, s2) => {\n if (this_calendar[this_date].events[s1].customizations && this_calendar[this_date].events[s1].customizations.show_as_unavailable) {\n return 1;\n }\n else if (this_calendar[this_date].events[s2].customizations && this_calendar[this_date].events[s2].customizations.show_as_unavailable) {\n return -1;\n }\n else if (this_calendar[this_date].events[s1].sort24 > this_calendar[this_date].events[s2].sort24) {\n return 1;\n }\n else if (this_calendar[this_date].events[s1].sort24 < this_calendar[this_date].events[s2].sort24) {\n return -1;\n }\n else {\n return (this_calendar[this_date].events[s1].description > this_calendar[this_date].events[s2].description ? 1 : -1);\n }\n });\n calendarList.push({\n dateObj: makeDate(this_date),\n date_words: this_calendar[this_date].date_words,\n eventList: sorted_eventIDs.map(this_eventID => {\n return Object.assign({},\n { event_id: this_eventID },\n this_calendar[this_date].events[this_eventID]\n );\n })\n });\n }\n }\n });\n return calendarList;\n };\n\n async function initialize() {\n // single event you're looking for? \n if (reactData.selectedEvent) {\n let calendarEntry = await setCalendar();\n if (!calendarEntry || (calendarEntry.length === 0)) {\n enqueueSnackbar(`AVA couldn't load that event`, { variant: 'error' });\n }\n else {\n updateReactData({\n myCalendar: calendarEntry\n }, true);\n }\n return;\n }\n if (reactData.myCalendar\n && !reactData.myCalendar.loadError\n && reactData.birthdayList\n && !reactData.defaultValues.forceReload\n ) {\n return;\n }\n let oList = {};\n let filterGroup = [];\n if (reactData.defaultValues.hasOwnProperty('show_group')) {\n filterGroup = makeArray(reactData.defaultValues.show_group);\n }\n else {\n filterGroup = await getGroupsBelongTo(patient.client_id, patient.patient_id, { sort: true });\n }\n if (isEmpty(reactData.myCalendar) || reactData.myCalendar.loadError || reactData.defaultValues.forceReload) {\n if (!reactData.loading) {\n updateReactData({\n loading: true\n }, true);\n }\n let startDate, endDate;\n if (reactData.defaultValues.start_date) {\n startDate = makeDate(reactData.defaultValues.start_date).date;\n }\n else {\n startDate = new Date();\n }\n if (reactData.defaultValues.end_date) {\n endDate = makeDate(reactData.defaultValues.end_date).date;\n }\n else {\n endDate = addDays(startDate, 35);\n }\n oList = await v2buildCalendar(\n {\n client_id: patient.client_id,\n this_person: patient.patient_id,\n start_date: startDate,\n end_date: endDate,\n filter: { group: filterGroup }\n }, onStatusUpdate\n );\n }\n else {\n oList = deepCopy(reactData.myCalendar);\n }\n if (!reactData.birthdayList) {\n if (state.accessList && state.accessList.birthdayList) {\n for (let keyDate in state.accessList.birthdayList) {\n if (oList.hasOwnProperty(keyDate)) {\n state.accessList.birthdayList[keyDate].forEach(p => {\n oList[keyDate].events[`#birthday_${p.person_id}#`] = {\n description: `Happy Birthday ${p.display_name}`,\n sort24: `0000z-${p.display_name}`,\n slot_owners: {},\n type: 'birthday'\n };\n });\n }\n }\n }\n else {\n let allPeople = await getMemberList('*all', patient.client_id, {});\n let this_year = new Date().getFullYear();\n let next_year = this_year + 1;\n allPeople.peopleList.forEach(p => {\n if (p.local_data?.['date of birth']) {\n let keyDate;\n let bDay = `${this_year}${p.local_data['date of birth'].slice(4)}`;\n if (oList.hasOwnProperty(bDay)) {\n keyDate = bDay;\n }\n else {\n bDay = `${next_year}${p.local_data['date of birth'].slice(4)}`;\n if (oList.hasOwnProperty(bDay)) {\n keyDate = bDay;\n }\n }\n if (keyDate) {\n oList[keyDate].events[`#birthday_${p.person_id}#`] = {\n description: `Happy Birthday ${p.name.first} ${p.name.last}`,\n sort24: `0000z-${p.name.first} ${p.name.last}`,\n slot_owners: {},\n type: 'birthday'\n };\n }\n }\n });\n }\n }\n let reactUpdObj = {\n myCalendar: organizeCalendar(oList),\n calendarPeople: oList.peopleInfo,\n conflictInfo: oList.conflicts,\n birthdayList: true,\n loading: false\n };\n if (reactData.defaultValues.assignmentView && reactData.defaultValues.allowAssign && !reactData.defaultValues.assignment__List) {\n let assignmentRows = [];\n if (typeof (reactData.defaultValues.allowAssign) === 'string') { // string - what is listed is a group ID\n assignmentRows = [{\n title: '',\n assignmentList: await getGroupMembers({\n groupList: [...makeArray(reactData.defaultValues.allowAssign)],\n short: true\n })\n }];\n }\n else { // array (of objects) - what is listed is a group ID\n for (let a = 0; a < reactData.defaultValues.allowAssign.length; a++) {\n let this_row = reactData.defaultValues.allowAssign[a];\n if (isObject(this_row)) {\n assignmentRows.push({\n title: (this_row.hasOwnProperty('title') ? this_row.title : Object.keys(this_row)[0]),\n assignmentList: await getGroupMembers({\n groupList: [...makeArray(this_row.groups || this_row.group)],\n short: true\n })\n });\n }\n else {\n assignmentRows.push({\n title: `Group ${a}`,\n assignmentList: await getGroupMembers({\n groupList: [...makeArray(this_row)],\n short: true\n })\n });\n }\n }\n }\n reactData.defaultValues.assignment__List = [];\n assignmentRows.forEach(this_row => {\n let assignmentList = this_row.assignmentList;\n let sortedList = [];\n if (assignmentList && (assignmentList.length > 0)) {\n if (reactData.defaultValues.assignmentSortBy && reactData.defaultValues.assignmentSortBy.toLowerCase().includes('first')) {\n sortedList = assignmentList.sort((a, b) => {\n if (a.first_name < b.first_name) { return -1; }\n else if (a.first_name > b.first_name) { return 1; }\n else if (a.last_name < b.last_name) { return -1; }\n else { return 1; }\n });\n }\n else {\n sortedList = assignmentList.sort((a, b) => {\n if (a.last_name < b.last_name) { return -1; }\n else if (a.last_name > b.last_name) { return 1; }\n else if (a.first_name < b.first_name) { return -1; }\n else { return 1; }\n });\n }\n }\n reactData.defaultValues.assignment__List.push({\n title: this_row.title,\n assignmentList: sortedList\n });\n });\n reactUpdObj.defaultValues = reactData.defaultValues;\n }\n if (reactData.defaultValues.assignmentView && reactData.defaultValues.templateList && !reactData.defaultValues.template__List) {\n // templateList could include specific template_id(s) and/or group(s) from whom templates are selected\n let workingTemplateList = [];\n // get a list of all available templates in the Calendar table\n let allTemplates = await getCalendarEntries({\n client_id: state.session.client_id,\n \"type\": 'template'\n });\n for (let t = 0; t < allTemplates.length; t++) {\n let this_template = allTemplates[t].templateData;\n if (reactData.defaultValues.templateList.includes(allTemplates[t].event_id)\n ||\n ((reactData.defaultValues.templateList.includes('*all')\n || array_in_array(reactData.defaultValues.templateList, filterGroup))\n && (this_template.availableTo_groups.includes('*all')\n || array_in_array(this_template.availableTo_groups, filterGroup))\n )\n ) {\n workingTemplateList.push(this_template);\n }\n }\n reactData.defaultValues.template__List = workingTemplateList.sort((a, b) => {\n return (a.generic_description < b.generic_description) ? -1 : 1;\n });\n reactUpdObj.defaultValues = reactData.defaultValues;\n }\n localStorage.setItem(`calendarChanged`, false);\n let client_style = AVADefaults({ client_style: 'get' });\n if (isObject(client_style)) {\n reactUpdObj.calendar_background = client_style.calendar_background;\n reactUpdObj.calendar_day = client_style.calendar_day;\n }\n updateReactData(reactUpdObj, true);\n }\n\n React.useEffect(() => {\n initialize();\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n // **************************\n return (\n \n {showAll && reactData && (forceRedisplay || true) &&\n \n {patient.kiosk_mode &&\n \n \n \n {'Resident?'}\n \n \n \n }\n {/* Loading spinner */}\n {reactData.loading &&\n \n \n \n \n \n {`Building your Calendar`}\n {`version ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n \n {statusMessage}\n \n \n \n \n \n \n \n }\n {!reactData.loading &&\n {\n setShowAll(!reactData.selectedEvent);\n if (!response) {\n onClose();\n }\n else if (response.action === 'reset') {\n let newDefaultValues = Object.assign({},\n reactData.defaultValues,\n {\n forceReload: true,\n start_date: response.newStartDate || reactData.defaultValues.start_date,\n end_date: response.newEndDate || reactData.defaultValues.end_date,\n selectDate: response.newStartDate || response.newEndDate || null\n }\n );\n updateReactData({ defaultValues: newDefaultValues }, true);\n await initialize();\n }\n else {\n onClose();\n }\n }}\n defaultValues={reactData.defaultValues}\n />\n }\n \n {reactData.myCalendar && reactData.myCalendar.length > 0 &&\n { }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'blue', color: 'white' }}\n size='small'\n >\n {'More Dates'}\n \n }\n {patient.kiosk_mode &&\n \n {'Sign-up?'}\n \n }\n \n {'Exit'}\n \n \n {showPersonSelect &&\n {\n setShowPersonSelect(false);\n patient.kiosk_mode = false;\n await setCalendar();\n }}\n onSelect={async (selectedPerson) => {\n [patient.patient_display_name, patient.patient_id,] = selectedPerson.split(':');\n setShowPersonSelect(false);\n patient.kiosk_mode = false;\n await setCalendar();\n }}\n >\n \n }\n \n }\n {!showAll && (reactData.myCalendar.length > 0) &&\n { handleAbort(); }}\n pMode={calendarMode}\n />\n }\n {!showAll && (reactData.myCalendar.length === 0) &&\n \n Getting your Event Info\n \n }\n \n );\n};\n","import React from 'react';\nimport { useSnackbar } from 'notistack';\nimport { lambda } from '../../util/AVAUtilities';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContentText from '@material-ui/core/DialogContentText';\n\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport TextField from '@material-ui/core/TextField';\nimport Button from '@material-ui/core/Button';\nimport RadioGroup from '@material-ui/core/RadioGroup';\nimport Radio from '@material-ui/core/Radio';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\n\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport SaveIcon from '@material-ui/icons/Save';\n\nimport Slide from '@material-ui/core/Slide';\n\nimport Paper from '@material-ui/core/Paper';\nimport Box from '@material-ui/core/Box';\n\nconst useStyles = makeStyles(theme => ({\n containerBox: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(1),\n fontSize: '1.3rem',\n },\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n paddingRight: 0,\n minWidth: '100%',\n },\n page: {\n // height: 950,\n maxWidth: 1000\n },\n listBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n paddingRight: 0,\n maxWidth: '100%',\n maxHeight: 500,\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.reject[theme.palette.type],\n },\n rowButtonGreen: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.confirm[theme.palette.type],\n },\n formControl: {\n marginTop: 10,\n marginBottom: 10,\n paddingTop: 0,\n },\n formControlLbl: {\n marginTop: 10,\n paddingTop: 10,\n paddingBottom: 5,\n height: theme.spacing(1),\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingTop: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 10,\n marginBottom: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 0,\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n uploadButton: {\n backgroundColor: theme.palette.confirm[theme.palette.type],\n marginTop: 10,\n marginBottom: 10,\n },\n table: {\n width: '95%',\n minWidth: 650,\n },\n}));\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ pClient, showUpload, handleClose }) => {\n\n const classes = useStyles();\n\n const [changeDetected, setChangeDetected] = React.useState(false);\n\n const [event_date, setEventDate] = React.useState();\n const [last_date, setLastDate] = React.useState();\n\n const [eventAsADate, setEventAsADate] = React.useState();\n const [sundayAsADate, setSundayAsADate] = React.useState();\n const [lastAsADate, setLastAsADate] = React.useState();\n\n const [prefMethod, setMethod] = React.useState('specific_date');\n const [randomize, setRandomize] = React.useState('no_randomize');\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n \n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:ObservationMaintenance',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: ''\n };\n\n const { enqueueSnackbar } = useSnackbar();\n\n const handleSave = async () => {\n // get Observations based on the Copy From date\n let numberDays = ((prefMethod && (prefMethod !== 'specific_date')) ? 7 : 1);\n let obsRecs = await getObservationRecs(eventAsADate, numberDays);\n // assign a date to map each copy from to\n let targetDateArray = [0];\n if (numberDays > 1) {\n switch (randomize) {\n case 'random_all': {\n targetDateArray = myRandomInts(7, 7);\n break;\n }\n case 'random_notSunday': { \n targetDateArray = myRandomInts(7, 7);\n let sundayValue, sundayTarget;\n for (let d = 0; d < numberDays; d++) {\n let sourceDate = addDays(lastAsADate, d);\n if (sourceDate.getDay() === 0) {\n sundayValue = targetDateArray[d];\n if (sundayValue === 0) { sundayTarget = d; }\n else { targetDateArray[d] = 0; }\n }\n else {\n let resultDate = addDays(lastAsADate, targetDateArray[d]);\n if (resultDate.getDay() === 0) { sundayTarget = d; }\n }\n };\n targetDateArray[sundayTarget] = sundayValue;\n break;\n }\n case 'no_randomize': {\n let fromDoW = eventAsADate.getDay();\n let toDoW = lastAsADate.getDay();\n let incr = (toDoW > fromDoW ? 7 : 0) - (toDoW - fromDoW);\n for (let d = 0; d < numberDays; d++) {\n targetDateArray[d] = incr;\n if (incr === 6) { incr = 0; }\n else { incr++; }\n };\n break;\n }\n default: {\n for (let d = 0; d < numberDays; d++) {\n targetDateArray[d] = d;\n };\n break;\n }\n }\n }\n let date_keys = {};\n for (let d = 0; d < numberDays; d++) { \n let targetDateYMD = makeYMD(lastAsADate, targetDateArray[d]); \n date_keys[makeYMD(eventAsADate, d)] = targetDateYMD;\n }\n // build update array\n let newObservationList = [];\n obsRecs.forEach(oRec => {\n let [, oType,] = oRec.composite_key.split(/[~_]/);\n if (oType === 'header') { \n let d1 = new Date(date_keys[oRec.date_key]).toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' });\n oRec.observation_code = `~~${d1}`;\n }\n if (oType !== 'message') {\n newObservationList.push({\n date: date_keys[oRec.date_key],\n item: oRec.observation_code,\n type: oType,\n oKey: oRec.observation_key || null\n });\n }\n });\n // write the to date records\n params.Payload = JSON.stringify({\n action: \"bulk_add\",\n clientId: pClient,\n request: {\n \"item_list\": newObservationList\n }\n });\n await lambda\n .invoke(params)\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA encountered an error while updating that item. Error is ${err.message}`, {\n variant: 'error'\n });\n });\n handleClose();\n };\n\n function myRandomInts(quantity, max) {\n const arr = [];\n while (arr.length < quantity) {\n var candidateInt = Math.floor(Math.random() * max);\n if (arr.indexOf(candidateInt) === -1) arr.push(candidateInt);\n }\n return (arr);\n };\n\n const addDays = (date, days) => {\n let rDate = new Date(date);\n return new Date(rDate.setDate(rDate.getDate() + days));\n }\n\n function makeYMD(pDate, d) { \n let workDate = pDate;\n workDate = addDays(pDate, d);\n return (workDate.getFullYear() + '.' + ((workDate.getMonth() + 101).toString()).substring(1) + '.' + ((workDate.getDate() + 100).toString()).substring(1));\n }\n\n const getObservationRecs = async (pDate, pNumberDays) => {\n let invokeFailed = false;\n if (!(pDate instanceof Date) || isNaN(pDate)) {\n pDate = new Date(pDate);\n }\n\n params.Payload = JSON.stringify({\n action: \"get_multiple_dates\",\n clientId: pClient,\n request: {\n \"select_date\": makeYMD(pDate, 0),\n \"number_of_days\": pNumberDays\n }\n });\n const fResp = await lambda\n .invoke(params)\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA encountered an error while retrieving that menu. Error is ${err.message}`, {\n variant: 'error'\n });\n invokeFailed = true;\n });\n if (!invokeFailed) {\n let oRecs = JSON.parse(fResp.Payload);\n if (oRecs.status === 200) {\n return oRecs.body;\n }\n };\n return [];\n };\n\n const handleChangeDate = event => {\n setEventDate(event.target.value);\n setEventAsADate(null);\n };\n\n const handleDateExit = event => {\n if (event.key === 'Enter' || event.type === 'blur') {\n let goodDate = makeDate(event_date);\n setEventAsADate(goodDate);\n setEventDate(goodDate.toDateString());\n let sunday = addDays(goodDate, -goodDate.getDay());\n setSundayAsADate(sunday);\n setChangeDetected(goodDate && lastAsADate);\n }\n };\n\n const handleChangeLastDate = event => {\n setLastAsADate(null);\n setLastDate(event.target.value);\n };\n\n const handleLastDateExit = event => {\n if (event.key === 'Enter' || event.type === 'blur') {\n let goodDate = makeDate(last_date);\n if (!goodDate || isNaN(goodDate.getTime())) { // invalid date input\n if (event_date) {\n goodDate = addDays(new Date(event_date), 28);\n }\n else {\n setLastDate('');\n setLastAsADate(null);\n }\n }\n setLastDate(goodDate.toDateString());\n setLastAsADate(goodDate);\n setChangeDetected(eventAsADate && goodDate);\n }\n };\n\n const handleChangeMethod = event => {\n setMethod(event.target.value);\n };\n\n const handleRandomize = event => {\n setRandomize(event.target.value);\n };\n\n if (!event_date) {\n setEventDate(' ');\n }\n \n if (!last_date) {\n setLastDate(' ');\n }\n\n function makeDate(pDate) {\n if (!pDate) { return null; }\n let goodDate = new Date(pDate);\n if (isNaN(goodDate)) {\n let jump = 0;\n let tDate = pDate.substr(0, 3).toLowerCase();\n let dOfw = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'].indexOf(tDate);\n goodDate = new Date(Date.now());\n if (dOfw > -1) {\n goodDate = addDays(goodDate, (((7 - (goodDate.getDay() - dOfw)) % 7) + jump));\n }\n else if (tDate === 'tom') {\n goodDate = addDays(goodDate, 1);\n }\n else if (tDate !== 'tod') {\n goodDate = new Date(pDate);\n }\n }\n let current = new Date(Date.now());\n let seconds_in_a_day = 24 * 60 * 60 * 1000;\n if ((goodDate < current) && ((current.getTime() - goodDate.getTime()) > (400 * seconds_in_a_day))) {\n let yyyy = current.getFullYear();\n goodDate.setFullYear(yyyy);\n };\n return goodDate;\n }\n\n return (\n \n \n \n {'Copy from a previous date'}\n \n \n \n \n
    \n
    \n \n
    \n
    \n \n
    \n {(typeof (eventAsADate) === 'object') && eventAsADate &&\n \n \n \n }\n label={\n \n Copy this date only\n }\n />\n }\n label={\n \n {`Copy 7 days, beginning ${eventAsADate.toLocaleDateString(undefined, { weekday: 'short', month: 'short', day: 'numeric' })}`}\n }\n />\n }\n label={\n \n {`Copy the week, beginning ${sundayAsADate.toLocaleDateString(undefined, { weekday: 'short', month: 'short', day: 'numeric' })}`}\n }\n />\n \n \n \n }\n {prefMethod && (prefMethod !== 'specific_date') &&\n \n \n \n }\n label={\n \n {'Copy Sun->Sun, Mon->Mon, etc.'}\n }\n />\n }\n label={\n \n {'Randomize'}\n }\n />\n }\n label={\n \n {'Randomize except Sunday'}\n }\n />\n \n \n \n }\n \n
    \n \n \n \n \n \n \n }\n >\n {'Cancel'}\n \n {changeDetected &&\n }\n >\n Save\n \n }\n \n \n \n \n \n
    \n
    \n
    \n );\n};","import React from 'react';\nimport { dbClient, lambda } from '../../util/AVAUtilities';\n\nimport { useSnackbar } from 'notistack';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\n\nimport TextField from '@material-ui/core/TextField';\nimport MenuItem from '@material-ui/core/MenuItem';\n\nimport Box from '@material-ui/core/Box';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport Button from '@material-ui/core/Button';\n\nconst useStyles = makeStyles(theme => ({\n containerBox: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 10,\n marginBottom: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 0,\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n}));\n\nexport default ({ observation, showDialog, handleClose, handleCancel }) => {\n\n const classes = useStyles();\n\n const [observationType, setObservationType] = React.useState(observation.composite_key.split('~').slice(1, -1).join('_').trim() || '');\n const [observationCode, setObservationCode] = React.useState(observation.observation_code);\n const [observationKey, setObservationKey] = React.useState(observation.observation_key);\n const [changeDetected, setChangeDetected] = React.useState(false);\n const [entryTypes, setEntryTypes] = React.useState([]);\n const observationClient = observation.composite_key.split('~')[0];\n const observationDate = observation.composite_key.split(/[~_]/g).pop();\n let oD = observationDate.split('.');\n const observationLongDate = oD[0] + '.' + ((Number(oD[1]) + 100).toString()).substring(1) + '.' + ((Number(oD[2]) + 100).toString()).substring(1);\n\n let editMode = (observationType || observationCode);\n\n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:ObservationMaintenance',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: ''\n };\n\n const { enqueueSnackbar } = useSnackbar();\n\n const onChangeType = event => {\n setObservationType(event.target.value);\n setChangeDetected(true);\n };\n\n const onChangeCode = event => {\n setObservationCode(event.target.value);\n setChangeDetected(true);\n };\n\n const onChangeKey = event => {\n setObservationKey(event.target.value);\n setChangeDetected(true);\n };\n\n const handleSave = async () => {\n params.Payload = JSON.stringify({\n action: \"update\",\n clientId: observationClient,\n request: {\n \"existing_key\": {\n \"composite_key\": observation.composite_key,\n \"observation_code\": observation.observation_code\n },\n \"new_code\": `${observationType === 'header' ? '~~' : ''}${observationCode}`,\n \"new_key\": `${observationClient}~${observationType}_${observationDate}`,\n \"new_oKey\": observationKey,\n \"new_date\": observationLongDate,\n \"new_sort\": `${observationDate}${observationType !== 'header' ? observationType : ''}`\n }\n });\n await lambda\n .invoke(params)\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA encountered an error while updating that item. Error is ${err.message}`, {\n variant: 'error'\n });\n });\n handleClose(\n {\n \"observation_code\": `${observationType === 'header' ? '~~' : ''}${observationCode}`,\n \"composite_key\": `${observationClient}~${observationType}_${observationDate}`,\n \"observation_key\": `${observationKey}`,\n }\n );\n };\n\n function sentenceCase(pString) {\n return pString.slice(0, 1).toUpperCase() + pString.slice(1);\n }\n\n React.useEffect(() => {\n let getEntryTypes = (\n async () => {\n if (!entryTypes || (entryTypes.length === 0)) {\n let eTypeList = await dbClient\n .get({\n Key: { client_id: observationClient, custom_key: 'menu_types' },\n TableName: \"Customizations\"\n })\n .promise()\n .catch(error => {\n console.log({ 'Bad get on Customizations - caught error is': error });\n });\n if (eTypeList.Item) {\n setEntryTypes(eTypeList.Item.customization_value);\n }\n }\n }\n );\n getEntryTypes();\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {entryTypes && (entryTypes.length > 0) &&\n \n \n {editMode ? 'Change this Item' : 'Add a new Item'}\n \n \n \n \n {entryTypes.map((eType) => (\n \n {sentenceCase(eType).replace(/_/g, \" \")}\n \n ))\n }\n
    \n \n \n \n \n \n \n {changeDetected &&\n \n }\n \n \n }\n \n );\n};","import React from 'react';\n\nimport Box from '@material-ui/core/Box';\n\nimport Typography from '@material-ui/core/Typography';\n\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\n\nimport IconButton from '@material-ui/core/IconButton';\nimport EditIcon from '@material-ui/icons/Edit';\nimport DeleteIcon from '@material-ui/icons/Delete';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport EditObservation from '../forms/EditObservation';\n\nconst useStyles = makeStyles(theme => ({\n containerBox: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n },\n table: {\n maxWidth: '95%',\n },\n listRow: {\n maxWidth: '100%',\n alignItems: 'center'\n },\n detailRow: {\n maxWidth: '20%',\n minWidth: '20%',\n paddingRight: 3\n },\n detailRowSpaceAbove: {\n maxWidth: '20%',\n minWidth: '20%',\n paddingRight: 3,\n marginTop: 2\n }\n}));\n\nexport default ({ pClient, workingList, showList }) => {\n\n const classes = useStyles();\n const [bulkItemList, setBulkItemList] = React.useState(workingList);\n const [forceRedisplay, setForceRedisplay] = React.useState(1);\n const [editMode, setEditMode] = React.useState(false);\n const [selectedObservation, setSelectedObservation] = React.useState({});\n const [updateIndex, setUpdateIndex] = React.useState();\n\n function sentenceCase(pString) {\n return (!pString ? '' : pString.slice(0, 1).toUpperCase() + pString.slice(1).toLowerCase());\n }\n\n const handleEditObservation = async (pItem, pIndex) => {\n setEditMode(true);\n let pObs = {\n composite_key: pClient + '~' + pItem.type + '_' + pItem.date.getFullYear() + '.' + (pItem.date.getMonth() + 1) + '.' + pItem.date.getDate(),\n observation_code: pItem.item,\n observation_key: pItem.oKey\n };\n setSelectedObservation(pObs);\n setUpdateIndex(pIndex);\n };\n\n const onReset = (updatedRow) => {\n let workingArray = bulkItemList;\n workingArray[updateIndex].type = updatedRow.composite_key.split(/[~_]/g).slice(1, -1).join('_').trim();\n workingArray[updateIndex].item = updatedRow.observation_code;\n workingArray[updateIndex].oKey = updatedRow.observation_key;\n console.log(updatedRow);\n setBulkItemList(workingArray);\n setForceRedisplay(forceRedisplay + 1);\n };\n\n const handleDeleteItem = async (pItem, pIndex) => {\n let workingArray = bulkItemList;\n let removedItem = workingArray.splice(pIndex, 1);\n console.log(removedItem);\n setBulkItemList(workingArray);\n setForceRedisplay(forceRedisplay + 1);\n };\n\n\n React.useEffect(() => {\n console.log('change made to list');\n }, [bulkItemList]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n return (\n forceRedisplay > 0 &&\n \n \n {bulkItemList.map((this_item, index) => (\n \n {(this_item.type === 'header') ?\n \n \n \n {this_item.item.substring(2)}\n \n \n \n :\n \n \n \n \n {this_item?.type ? sentenceCase(this_item.type.split('_').pop()) : 'none'}\n \n \n \n {this_item.item.startsWith('~~') ?\n {this_item.item.slice(2)}\n :\n {this_item.item}\n }\n \n {\n handleEditObservation(this_item, index);\n }}\n edge=\"end\"\n >\n {}\n \n { handleDeleteItem(this_item, index); }}\n edge=\"end\"\n >\n {}\n \n \n \n }\n \n ))}\n {editMode &&\n {\n setEditMode(false);\n onReset(updatedRow);\n }}\n handleCancel={() => {\n setEditMode(false);\n }}\n />\n }\n \n \n );\n};","import React from 'react';\nimport { useSnackbar } from 'notistack';\nimport { s3, lambda, sentenceCase } from '../../util/AVAUtilities';\nimport { makeDate } from '../../util/AVADateTime';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\n\nimport CloudUploadIcon from '@material-ui/icons/CloudUpload';\nimport ShowBulkList from '../forms/ShowBulkList';\n\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport SaveIcon from '@material-ui/icons/Save';\n\nimport Slide from '@material-ui/core/Slide';\n\nimport Paper from '@material-ui/core/Paper';\nimport Box from '@material-ui/core/Box';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport Button from '@material-ui/core/Button';\nimport { AVAclasses } from '../../util/AVAStyles';\n\nvar XLSX = require(\"xlsx\");\n\nconst useStyles = makeStyles(theme => ({\n containerBox: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(1),\n fontSize: '1.3rem',\n },\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n },\n page: {\n // height: 950,\n maxWidth: 1000\n },\n listBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n paddingRight: 0,\n maxWidth: '100%',\n maxHeight: 500,\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.reject[theme.palette.type],\n },\n rowButtonGreen: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.confirm[theme.palette.type],\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 10,\n marginBottom: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 0,\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n uploadButton: {\n backgroundColor: theme.palette.confirm[theme.palette.type],\n marginTop: 10,\n marginBottom: 10,\n },\n table: {\n width: '95%',\n minWidth: 650,\n },\n}));\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ pClient, showUpload, handleClose }) => {\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const [changeDetected, setChangeDetected] = React.useState(false);\n const [bulkItemList, setBulkItemList] = React.useState([]);\n\n const entryTypes = [\n 'header',\n 'message',\n 'entree',\n 'soft_entree',\n 'AL_lunch_entree',\n 'AL_dinner_entree',\n 'soup',\n 'salad',\n 'side',\n 'bread',\n 'dessert'\n ];\n\n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:ObservationMaintenance',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: ''\n };\n\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n\n const hiddenFileInput = React.useRef(null);\n\n const handleFileUpload = event => {\n hiddenFileInput.current.click();\n };\n\n const handleSave = async () => {\n params.Payload = JSON.stringify({\n action: \"bulk_add\",\n clientId: pClient,\n request: {\n \"item_list\": bulkItemList\n }\n });\n await lambda\n .invoke(params)\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA encountered an error while updating that item. Error is ${err.message}`, {\n variant: 'error'\n });\n });\n handleClose();\n };\n\n const handleSpreadsheet = (pXFile) => {\n var req = new XMLHttpRequest();\n req.open(\"GET\", pXFile, true);\n req.responseType = \"arraybuffer\";\n req.onload = function (e) {\n var data = new Uint8Array(req.response);\n var workbook = XLSX.read(data, { type: \"array\" });\n parseTemplateMenu(workbook);\n setChangeDetected(true);\n };\n req.send();\n };\n\n function parseTemplateMenu(pWorkbook) {\n let headers = [];\n let resultObj = {};\n pWorkbook.SheetNames.forEach((sheetName) => {\n let currentSheet = pWorkbook.Sheets[sheetName];\n for (const currentCell in currentSheet) {\n if (!currentSheet[currentCell].v) { continue; } // skip if no value in the cell\n if (typeof (currentSheet[currentCell].v) !== 'string') { continue; }\n if (!currentSheet[currentCell].v.startsWith('###')) { continue; } // skip if not flagged as a key cell\n let values = currentSheet[currentCell].v.replace('###', '').split('//');\n let split_value = values[2].split('_');\n let this_date = makeDate(values[0]);\n let hKey = `~~${this_date.absolute}${split_value[1] ? (' ' + sentenceCase(split_value[0])) : ''}`;\n if (!headers.includes(hKey)) {\n resultObj[`${this_date.ymd}.ava`] = {\n date: this_date.date,\n item: `~~${this_date.absolute}`,\n type: 'header'\n };\n if (split_value.length > 1) {\n resultObj[`${this_date.ymd}.${split_value[0]}`] = {\n date: this_date.date,\n item: hKey,\n type: `${split_value[0]}_header`\n };\n headers.push(hKey);\n }\n }\n let sort_key = entryTypes.indexOf(split_value[split_value.length - 1]);\n if (sort_key === -1) { sort_key = 99; }\n let sKey = `${this_date.ymd}.${split_value[1] ? split_value[0] : 'ava'}.${100 + sort_key}`;\n let useKey;\n let suffix = '';\n for (let d = 0; d < 10; d++) {\n if (!resultObj.hasOwnProperty(`${sKey}${suffix}`)) {\n useKey = `${sKey}${suffix}`\n break;\n }\n suffix = `.${d}`;\n }\n resultObj[useKey] = {\n date: this_date.date,\n item: values[1],\n type: values[2]\n };\n if (values[3]) {\n resultObj[useKey].observation_key = values[3]\n }\n }\n });\n let results = Object.keys(resultObj).map(o => {\n return {\n date: resultObj[o].date,\n item: resultObj[o].item,\n type: resultObj[o].type,\n sort_order: o\n };\n });\n let lower_date = makeDate('1/1/23').date;\n let upper_date = new Date('12/31/33');\n let filtered_results = results.filter(r => {\n return ((r.date > lower_date) && (r.date < upper_date));\n })\n filtered_results.sort((a, b) => { return (a.sort_order > b.sort_order ? 1 : -1); });\n setBulkItemList(filtered_results);\n }\n\n return (\n \n \n \n {'Load new Menus from a File'}\n \n \n {\n bulkItemList.length === 0 ?\n \n \n }\n onClick={handleFileUpload}\n >\n {'Choose File'}\n \n \n {\n let fObj = target.target.files[0];\n const pFile = {\n Bucket: 'theseus-medical-storage',\n Key: 'public_uploads/' + fObj.name,\n Body: fObj,\n ACL: 'public-read-write',\n ContentType: fObj.ContentType\n };\n enqueueSnackbar(`Uploading your file`, { variant: 'success', persist: false });\n let s3Resp = await s3\n .upload(pFile)\n .promise()\n .catch(err => {\n enqueueSnackbar(`Uh oh! AVA couldn't save your file. The reason is ${err.message}`, { variant: 'error', persist: true });\n });\n closeSnackbar();\n handleSpreadsheet(s3Resp.Location);\n }}\n />\n \n :\n 0}\n />\n }\n \n \n \n \n }\n >\n {'Cancel'}\n \n {changeDetected &&\n }\n >\n Save\n \n }\n \n \n \n \n \n );\n};","import React from 'react';\nimport { titleCase, updateDb, deleteDbRec, sentenceCase, parseNumeric, cl, dbClient } from '../../util/AVAUtilities';\nimport useSession from '../../hooks/useSession';\nimport { getObservationKeys, getObservationItems } from '../../util/AVAObservations';\nimport AVAConfirm from './AVAConfirm';\nimport { makeDate } from '../../util/AVADateTime';\n\nimport GridListTile from '@material-ui/core/GridListTile';\nimport TextField from '@material-ui/core/TextField';\n\nimport List from '@material-ui/core/List';\n\n// import EditObservation from '../forms/EditObservation';\nimport AVATextInput from './AVATextInput';\nimport LoadMenuSpreadsheet from '../forms/LoadMenuSpreadsheet';\n\nimport Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport IconButton from '@material-ui/core/IconButton';\nimport EditIcon from '@material-ui/icons/Edit';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport AddIcon from '@material-ui/icons/PlaylistAdd';\n\nconst useStyles = makeStyles(theme => ({\n listItem: {\n justifyContent: 'space-between',\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2)\n },\n typeOfLine: {\n fontSize: theme.typography.fontSize * 0.8,\n marginBottom: 0,\n },\n recipeCode: {\n fontSize: theme.typography.fontSize * 0.8,\n marginBottom: 0,\n marginLeft: theme.spacing(2)\n },\n observationLine: {\n marginTop: 0,\n fontSize: theme.typography.fontSize * 1.8,\n },\n}));\n\nexport default ({ observationList, pClient, keyDate, filter, onReset, handleAbort, handleLoad }) => {\n\n const classes = useStyles();\n\n let filterText = filter ? filter.toLowerCase() : null;\n\n let displayed_ObservationName = '';\n\n const { state } = useSession();\n\n const [reactData, setReactData] = React.useState({\n editMode: false,\n addMode: false,\n savedRequestUpdates: [],\n observationItemMode: false,\n oIValues: [],\n oIImage: '',\n oIKey: '',\n ogSelectedObservation: {},\n newObservationName: '',\n loadMode: false,\n deletePending: false,\n selectedObservation: {},\n recipeList: [],\n oiCharacteristics: state.session.observation_item_characteristics || \n [\n {\n \"description\": \"Calories\",\n \"uom\": \"\",\n \"code\": \"calories\"\n },\n {\n \"description\": \"Cholesterol\",\n \"uom\": \"mg\",\n \"code\": \"cholesterol\"\n },\n {\n \"description\": \"Sodium\",\n \"uom\": \"mg\",\n \"code\": \"sodium\"\n },\n {\n \"description\": \"Total Carbs\",\n \"uom\": \"g\",\n \"code\": \"total_carb\"\n },\n {\n \"description\": \"Total Fat\",\n \"uom\": \"g\",\n \"code\": \"total_fat\"\n }\n ]\n });\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) {\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n }\n };\n\n async function loadOIValues(OIKey) {\n let OIObj = await getObservationItems(OIKey);\n if (Object.keys(OIObj).length === 0) {\n return [];\n }\n let OIValues = reactData.oiCharacteristics.map(c => {\n let response = '';\n if (OIObj[c.code]) {\n if (OIObj[c.code].value) {\n response = OIObj[c.code].value.toString();\n if (OIObj[c.code].uom) {\n response += ` ${OIObj[c.code].uom}`;\n }\n }\n else if (OIObj[c.code].display_value) {\n response = ` ${OIObj[c.code].display_value}`;\n }\n }\n return response;\n });\n return {\n values: OIValues,\n oIName: (OIObj.hasOwnProperty('observation_name') ? OIObj['observation_name'].display_value : null),\n image: (OIObj.hasOwnProperty('image') ? OIObj['image'].display_value : null)\n };\n }\n\n async function handleAddOItem(oIName, newDataList) {\n let oKey = reactData.oIKey;\n if (!reactData.oIogName || (reactData.oIogName === `Item ${oKey}`)) {\n let oIRec = {\n observation_key: oKey,\n display_value: oIName,\n characteristic: 'observation_name',\n };\n cl({ 'Put to Observation_Items': oIRec });\n await dbClient\n .put({\n TableName: 'Observation_Items',\n Item: oIRec\n })\n .promise()\n .catch(error => {\n cl(`Bad put to Observation_Items - caught error is: ${error}`);\n });\n }\n for (let n = 0; n < newDataList.length; n++) {\n if (newDataList[n] && (newDataList[n].toString().length > 0)) {\n let oIRec = {\n observation_key: oKey,\n characteristic: reactData.oiCharacteristics[n].code,\n };\n let checkN = parseNumeric(newDataList[n]);\n if (!checkN.isNumeric) {\n oIRec.display_value = newDataList[n];\n }\n else {\n oIRec.value = checkN.value;\n if (checkN.hasText) {\n oIRec.uom = checkN.textValue;\n }\n else if (reactData.oiCharacteristics[n].uom) {\n oIRec.uom = reactData.oiCharacteristics[n].uom;\n }\n }\n cl({ 'Put to Observation_Items': oIRec });\n await dbClient\n .put({\n TableName: 'Observation_Items',\n Item: oIRec\n })\n .promise()\n .catch(error => {\n cl(`Bad put to Observation_Items - caught error is: ${error}`);\n });\n }\n }\n return oKey;\n }\n\n const handleEditObservation = async (pObs, index) => {\n if (reactData.recipeList.length === 0) {\n let recipeRecs = await getObservationKeys({ characteristic: 'observation_name' });\n let unsortedRecipeList = recipeRecs.map(r => {\n return {\n key: `${sentenceCase(r.display_value)} (${r.observation_key})`,\n value: r.observation_key\n };\n });\n updateReactData({\n recipeList: unsortedRecipeList.sort((a, b) => {\n return ((a.key < b.key) ? -1 : 1);\n }),\n });\n }\n let obsWords = pObs.observation_code.toLowerCase().trim().split(/\\s+/).filter(w => {\n return !((w === 'with') || (w === 'w/'));\n });\n let filteredRecipeList = reactData.recipeList.filter((r, x) => {\n return ((r.value === pObs.observation_key) || (obsWords.some(w => {\n return (r.key.toLowerCase().includes(w));\n })));\n });\n filteredRecipeList.push({\n key: '*** Tap here to add new ***',\n value: '*% select_new %*'\n });\n pObs.listIndex = index;\n updateReactData({\n editMode: true,\n ogSelectedObservation: pObs,\n selectedObservation: pObs,\n filteredRecipeList: filteredRecipeList\n }, true);\n };\n\n const handleAddObservation = async (pObs_name, index) => {\n if (reactData.recipeList.length === 0) {\n let recipeRecs = await getObservationKeys({ characteristic: 'observation_name' });\n let unsortedRecipeList = recipeRecs.map(r => {\n return {\n key: `${sentenceCase(r.display_value)} (${r.observation_key})`,\n value: r.observation_key\n };\n });\n updateReactData({\n recipeList: unsortedRecipeList.sort((a, b) => {\n return ((a.key < b.key) ? -1 : 1);\n }),\n });\n }\n let obsWords = pObs_name.toLowerCase().trim().split(/\\s+/).filter(w => {\n return !((w === 'with') || (w === 'w/'));\n });\n let filteredRecipeList = reactData.recipeList.filter((r, x) => {\n return (obsWords.some(w => {\n return (r.key.toLowerCase().includes(w));\n }));\n });\n filteredRecipeList.push({\n key: '*** Tap here to add new ***',\n value: '*% select_new %*'\n });\n let pObs = {\n listIndex: index,\n observation_code: pObs_name\n };\n let ogSelectedObservation = {};\n if (observationList.length === 0) {\n let this_dataKey = makeDate(keyDate);\n ogSelectedObservation = {\n rightSide: this_dataKey.obs,\n client_id: state.session.client_id,\n date_key: this_dataKey.ymd\n };\n }\n else {\n ogSelectedObservation = {\n rightSide: observationList[observationList.length - 1].composite_key.match(/_(?:.(?!_))+$/gm),\n client_id: observationList[0].client_id,\n date_key: observationList[0].date_key\n }\n }\n updateReactData({\n editMode: true,\n addMode: true,\n ogSelectedObservation: ogSelectedObservation,\n selectedObservation: pObs,\n filteredRecipeList: filteredRecipeList\n }, true);\n };\n\n const handleUpdateObservation = async (original_data, update_data) => {\n // pData in the form {[\"table\": , \"key\": {\"key1\": \"keydata1\", etc...}, \"data\": {\"field_name1\": \"new value\", \"field_name2\", \"new value\", ...}]}\n let newData = {};\n if (original_data.observation_code !== update_data[0]) {\n newData.observation_code = update_data[0];\n }\n let oldRightSide = \"\";\n if (original_data.rightSide) {\n oldRightSide = original_data.rightSide;\n }\n else if (original_data.composite_key) {\n oldRightSide = original_data.composite_key.match(/_(?:.(?!_))+$/gm);\n }\n let newCompositeKey = `${original_data.client_id}~${update_data[1]}${oldRightSide}`;\n if (original_data.composite_key !== newCompositeKey) {\n newData.composite_key = newCompositeKey;\n newData.observation_type = update_data[1];\n newData.sort_order = `${update_data[1]}${oldRightSide}`;\n }\n if (original_data.observation_key !== update_data[2]) {\n newData.observation_key = update_data[2];\n }\n if (original_data.description !== update_data[3]) {\n newData.description = update_data[3];\n }\n if (Object.keys(newData).length > 0) {\n if (original_data.composite_key) {\n updateDb([{\n table: 'Observations',\n key: {\n composite_key: original_data.composite_key || newData.composite_key,\n observation_code: original_data.observation_code || newData.observation_code\n },\n data: newData\n }]);\n Object.assign(observationList[original_data.listIndex], newData);\n }\n else {\n newData.client_id = original_data.client_id;\n newData.date_key = original_data.date_key;\n await dbClient\n .put({\n TableName: 'Observations',\n Item: newData\n })\n .promise()\n .catch(error => {\n console.log(`caught error putting to Observations; error is:`, error);\n });\n observationList.push(Object.assign({}, newData, {\n sort_key: newData.observation_type\n }));\n updateReactData({\n newObservationName: ''\n }, false);\n }\n }\n };\n\n const handleDeleteObservation = async (original_data) => {\n // pData in the form {[\"table\": , \"key\": {\"key1\": \"keydata1\", etc...}]\n deleteDbRec([{\n table: 'Observations',\n key: {\n composite_key: original_data.composite_key,\n observation_code: original_data.observation_code\n },\n }]);\n observationList.splice(original_data.listIndex, 1);\n };\n\n return (\n ((forceRedisplay || true) &&\n \n \n {!reactData.editMode && !reactData.loadMode && !reactData.deletePending &&\n \n {observationList.map((this_item, index) => (\n (filterText && !this_item.observation_code.toLowerCase().includes(filterText))\n ? null\n :\n \n \n \n \n \n \n \n \n {titleCase(this_item.composite_key.replace(this_item.client_id, '').split(/[~_]/g).slice(1, -1).join(' '))}\n {this_item.observation_code.replace(/~/g, '')}\n {this_item.observation_key && (this_item.observation_key !== '') && (this_item.observation_key !== '0') &&\n {`Item code ${this_item.observation_key}`}\n }\n \n { handleEditObservation(this_item, index); }}\n edge=\"end\"\n >\n {}\n \n {\n this_item.listIndex = index;\n updateReactData({\n confirmMessage: `Confirm removing ${this_item.observation_code.replace(/~/g, '')} from the ${keyDate} menu?`,\n selectedObservation: this_item,\n deletePending: true\n }, true);\n }}\n edge=\"end\"\n >\n \n \n \n \n \n \n \n \n \n ))}\n \n \n \n \n \n \n \n {\n displayed_ObservationName = event.target.value;\n updateReactData({\n newObservationName: displayed_ObservationName\n }, true);\n }}\n FormHelperTextProps={{ style: { fontSize: '0.75rem', lineHeight: '0.9rem' } }}\n helperText={`Add something new here`}\n autoComplete='off'\n />\n \n {\n handleAddObservation(reactData.newObservationName, observationList.length);\n }}\n edge=\"end\"\n >\n {}\n \n \n \n \n \n \n \n \n }\n {reactData.editMode &&\n {\n updateReactData({\n editMode: false\n }, true);\n }}\n onSave={async (requestUpdates) => {\n if (requestUpdates[2] === '*% select_new %*') {\n let now$ = new Date().getTime().toString();\n updateReactData({\n oIKey: `${now$.slice(3, 7)}-${now$.slice(7, 11)}`,\n oIValues: [],\n oIImage: null,\n oIogName: null,\n savedRequestUpdates: requestUpdates,\n observationItemMode: true,\n editMode: false\n }, true);\n }\n else if (requestUpdates[2].startsWith('*% edit_item %*')) {\n let OIKey = requestUpdates[2].slice(15).trim();\n let OIInfo = await loadOIValues(OIKey);\n updateReactData({\n oIKey: OIKey,\n oIValues: OIInfo.values,\n oIImage: OIInfo.image,\n oIogName: OIInfo.oIName,\n savedRequestUpdates: requestUpdates,\n observationItemMode: true,\n editMode: false\n }, true);\n }\n else {\n await handleUpdateObservation(reactData.ogSelectedObservation, requestUpdates);\n updateReactData({\n editMode: false\n }, true);\n }\n }}\n />\n }\n {reactData.observationItemMode &&\n { return `${c.description} ${c.uom ? '(' + c.uom + ')' : ''}`})}\n valueText={reactData.oIValues}\n buttonText={((reactData.oIValues.length === 0) ? 'Add' : 'Update')}\n options={{\n allowAttach: 'Add Image',\n attachmentList: (reactData.oIImage ? [{\n Key: 'Current Image',\n Location: reactData.oIImage,\n }] : false)\n }}\n onCancel={() => {\n updateReactData({\n selectedObservation: Object.assign(\n {},\n reactData.ogSelectedObservation,\n {\n observation_code: reactData.savedRequestUpdates[0],\n observation_type: reactData.savedRequestUpdates[1]\n }),\n observationItemMode: false,\n editMode: true\n }, true);\n }}\n onSave={async (newOItemData) => {\n let newOCode = await handleAddOItem(reactData.savedRequestUpdates[0], newOItemData);\n if (!reactData.oIogName) { // indicates this is a new entry\n reactData.filteredRecipeList.splice(-1, 0, {\n value: newOCode,\n key: `${reactData.savedRequestUpdates[0]} (${newOCode})`\n });\n reactData.recipeList.splice(-1, 0, {\n value: newOCode,\n key: `${reactData.savedRequestUpdates[0]} (${newOCode})`\n });\n }\n updateReactData({\n filteredRecipeList: reactData.filteredRecipeList,\n selectedObservation: Object.assign(\n {},\n reactData.ogSelectedObservation,\n {\n observation_code: reactData.savedRequestUpdates[0],\n observation_type: reactData.savedRequestUpdates[1],\n observation_key: newOCode\n }),\n observationItemMode: false,\n editMode: true\n }, true);\n }}\n />\n }\n {reactData.loadMode &&\n {\n updateReactData({\n loadMode: false\n }, true);\n onReset();\n }}\n />\n }\n {reactData.deletePending &&\n {\n updateReactData({\n deletePending: false\n }, true);\n }}\n onConfirm={() => {\n handleDeleteObservation(reactData.selectedObservation);\n updateReactData({\n deletePending: false\n }, true);\n }}\n >\n \n }\n \n \n ));\n};","import React from 'react';\nimport { getObservations } from '../../util/AVAObservations';\n\nimport TextField from '@material-ui/core/TextField';\n\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport Button from '@material-ui/core/Button';\nimport Slide from '@material-ui/core/Slide';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport LoadIcon from '@material-ui/icons/GetApp';\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport FileCopyIcon from '@material-ui/icons/FileCopy';\n\nimport CopyMenu from '../forms/CopyMenu';\n\nimport MenuForm from '../forms/MenuForm';\nimport LoadMenuSpreadsheet from '../forms/LoadMenuSpreadsheet';\n\nimport { AVAclasses } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n pageHead: {\n paddingTop: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n subDescriptionText: {\n marginLeft: theme.spacing(3),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n },\n freeInput: {\n marginLeft: 0,\n marginBottom: '10px',\n marginRight: '2px',\n paddingLeft: 0,\n paddingRight: 0,\n verticalAlign: 'middle',\n minHeight: theme.typography.fontSize * 2.8,\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.reject[theme.palette.type],\n },\n rowButtonGreen: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.confirm[theme.palette.type],\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n load: {\n backgroundColor: theme.palette.warning[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n}));\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ pClient, showMenu, onClose }) => {\n const [observationList, setObservationList] = React.useState();\n const [selectedDate, setSelectedDate] = React.useState(new Date().toDateString());\n const [loadMode, setLoadMode] = React.useState(false);\n const [copyMode, setCopyMode] = React.useState(false);\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const [changes, setChanges] = React.useState(false);\n if (changes) { }\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n const buildObservationList = async (pDate) => {\n let [obsList,] = await getObservations(pClient, '', { date: pDate, sort: true, return: 'records' });\n setObservationList(obsList);\n return obsList;\n };\n\n const handleLoad = async () => {\n setLoadMode(true);\n };\n\n const handleCopy = async () => {\n setCopyMode(true);\n };\n\n const handleDateExit = event => {\n if (event.key === 'Enter' || event.type === 'blur') {\n let goodDate = new Date(event.target.value);\n if (isNaN(goodDate)) {\n let tNext = event.target.value.trim().toLowerCase().startsWith('next');\n if (tNext) {\n let dayWord = event.target.value.split(' ')[1].trim();\n event.target.value = dayWord;\n }\n let tDate = event.target.value.substr(0, 3).toLowerCase();\n let dOfw = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'].indexOf(tDate);\n goodDate = new Date(Date.now());\n if (dOfw > -1) {\n if ((goodDate.getDay() > dOfw) && tNext) {\n tNext = false;\n }\n goodDate.setDate(goodDate.getDate() + ((7 - (goodDate.getDay() - dOfw)) % 7) + (tNext ? 7 : 0));\n }\n else if (tDate === 'tom') {\n goodDate.setDate(goodDate.getDate() + 1);\n }\n else if (tDate !== 'tod') {\n goodDate = new Date(event.target.value);\n }\n }\n let current = new Date(Date.now());\n current.setHours(0, 0, 0, 0);\n if (goodDate < current) {\n let yyyy = current.getFullYear();\n goodDate.setFullYear(yyyy);\n if (goodDate < current) { goodDate.setFullYear(yyyy + 1); }\n };\n setSelectedDate(goodDate.toDateString());\n buildObservationList(goodDate);\n }\n };\n\n const handleChangeDate = event => {\n setSelectedDate(event.target.value);\n };\n\n const handleAbort = () => {\n setChanges(false);\n onClose();\n };\n\n // **************************\n\n if (!observationList) {\n // setSelectedDate(new Date().toDateString());\n buildObservationList(new Date().toDateString());\n }\n\n return (\n (showMenu && \n \n \n \n \n {`Dining Menu Maintenance`}\n \n \n {(!observationList || (observationList.length === 0)) ? 'Loading the Menu' : `Menu for ${selectedDate}`}\n \n \n \n \n \n \n {observationList &&\n \n {\n buildObservationList(selectedDate);\n }}\n handleAbort={handleAbort}\n handleLoad={handleLoad}\n />\n \n }\n \n }\n >\n {'Done'}\n \n }\n >\n {'Load'}\n \n { handleCopy(); }}\n startIcon={}\n >\n {'Copy'}\n \n \n {loadMode &&\n {\n setLoadMode(false);\n buildObservationList(selectedDate);\n }}\n />\n }\n {copyMode &&\n {\n setCopyMode(false);\n }}\n />\n }\n \n )\n );\n};\n","import React from 'react';\nimport { lambda } from '../../util/AVAUtilities';\nimport { useSnackbar } from 'notistack';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\n\nimport TextField from '@material-ui/core/TextField';\n\nimport Box from '@material-ui/core/Box';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport Button from '@material-ui/core/Button';\n\nconst useStyles = makeStyles(theme => ({\n containerBox: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 10,\n marginBottom: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 0,\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n}));\n\nexport default ({ pClient, activity, showDialog, handleClose }) => {\n\n const classes = useStyles();\n\n const [activityName, setActivityName] = React.useState(activity.activity_name);\n const [changeDetected, setChangeDetected] = React.useState(false);\n const activityClient = pClient;\n\n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:EventActivityMaintenance',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: ''\n };\n\n const { enqueueSnackbar } = useSnackbar();\n\n const onChangeName = event => {\n setActivityName(event.target.value);\n setChangeDetected(true);\n };\n\n const handleSave = async () => {\n params.Payload = JSON.stringify({\n action: \"update\",\n clientId: activityClient,\n request: {\n \"activity_code\": activity.activity_code,\n \"new_name\": activityName,\n }\n });\n await lambda\n .invoke(params)\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA encountered an error while updating that item. Error is ${err.message}`, {\n variant: 'error'\n });\n });\n handleClose();\n };\n\n React.useEffect(() => {\n }, [activity]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n return (\n \n \n \n {'Change this Item'}\n \n \n \n \n \n \n \n \n {changeDetected &&\n \n }\n \n \n \n );\n};","import React from 'react';\nimport { lambda } from '../../util/AVAUtilities';\nimport { useSnackbar } from 'notistack';\n\nimport Grid from '@material-ui/core/Grid';\nimport GridList from '@material-ui/core/GridList';\nimport GridListTile from '@material-ui/core/GridListTile';\n\nimport EditActivity from '../forms/EditActivity';\n\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\n\nimport IconButton from '@material-ui/core/IconButton';\nimport EditIcon from '@material-ui/icons/Edit';\nimport DeleteIcon from '@material-ui/icons/Delete';\n\nimport AVAConfirm from './AVAConfirm';\n\nexport default ({ eventActivityList, pClient, onReset }) => {\n\n const [editMode, setEditMode] = React.useState(false);\n const [forceRedisplay, setForceRedisplay] = React.useState(true);\n const [deletePending, setDeletePending] = React.useState(null);\n const [selectedEventActivity, setSelectedEventActivity] = React.useState({});\n\n const [deleteItem, setDeleteItem] = React.useState({});\n const [confirmMessage, setConfirmMessage] = React.useState();\n const [deleteIndex, setDeleteIndex] = React.useState();\n\n const { enqueueSnackbar } = useSnackbar();\n\n const handleEditEventActivity = async (pObs) => {\n setEditMode(true);\n setSelectedEventActivity(pObs);\n };\n\n const handleDeleteEventActivity = async (pObs, pIndex) => {\n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:EventActivityMaintenance',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: ''\n };\n\n params.Payload = JSON.stringify({\n action: \"delete\",\n clientId: pObs.client_event_id.split(/[~_]/g)[0] || pClient,\n request: {\n \"activity_code\": pObs.activity_code,\n \"event_id\": pObs.client_event_id\n }\n });\n await lambda\n .invoke(params)\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA encountered an error while deleting that item. Error is ${err.message}`, {\n variant: 'error'\n });\n });\n eventActivityList.splice(pIndex, 1);\n setForceRedisplay(!forceRedisplay);\n };\n\n return (\n eventActivityList?.length > 0 && (true || forceRedisplay) &&\n \n \n \n {eventActivityList.map((this_item, index) => (\n \n \n {\n\n }}\n square>\n \n \n \n \n \n \n {this_item.activity_name}\n \n { handleEditEventActivity(this_item); }}\n edge=\"end\"\n >\n {}\n \n {\n setDeletePending(true);\n setDeleteIndex(index);\n setDeleteItem(this_item);\n setConfirmMessage(`Confirm removal of \"${this_item.activity_name}\"?`);\n }}\n edge=\"end\"\n >\n \n \n \n \n \n \n \n \n \n \n ))}\n {editMode &&\n {\n setEditMode(false);\n onReset();\n }}\n />\n }\n {deletePending &&\n {\n setDeletePending(false);\n }}\n onConfirm={() => {\n setDeletePending(false);\n handleDeleteEventActivity(deleteItem, deleteIndex);\n }}\n >\n \n }\n \n \n \n );\n};","import React from 'react';\n\nimport Paper from '@material-ui/core/Paper';\nimport TextField from '@material-ui/core/TextField';\n\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport Button from '@material-ui/core/Button';\nimport Slide from '@material-ui/core/Slide';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\n\nconst useStyles = makeStyles(theme => ({\n formControl: {\n margin: 0,\n paddingTop: 0,\n },\n formControlLbl: {\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n },\n freeInput: {\n marginLeft: '25px',\n marginTop: '5px',\n marginRight: 2,\n marginBottom: '10px',\n paddingLeft: 0,\n paddingRight: 0,\n width: '90%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n minHeight: theme.typography.fontSize * 2.8,\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n titleText: {\n fontSize: '1.3rem',\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n subDescriptionText: {\n marginLeft: theme.spacing(3),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n },\n\n picture: {\n width: theme.spacing(16),\n height: theme.spacing(16),\n [theme.breakpoints.down('xs')]: {\n width: theme.spacing(8),\n height: theme.spacing(8),\n },\n },\n photoButton: {\n alignSelf: 'center',\n size: 'sm',\n variant: 'outlined',\n verticalAlign: 'middle',\n },\n defaultButton: {\n alignSelf: 'end',\n variant: 'outlined',\n verticalAlign: 'end',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n topButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.primary[theme.palette.type],\n },\n resetButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n marginRight: 10,\n },\n infoButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.info[theme.palette.type],\n marginRight: 10,\n paddingRight: 10,\n marginLeft: 10,\n paddingLeft: 10,\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n listItemAVA: {\n fontSize: theme.typography.fontSize * 1.5,\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 5,\n },\n}));\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ activityList, activityObject, onCancel, onSelect }) => {\n const [activity_filter, setActivityFilter] = React.useState('');\n\n const classes = useStyles();\n\n const handleChangeActivityFilter = event => {\n setActivityFilter(event.target.value);\n };\n\n // **************************\n\n return (\n \n \n {'Select a menu from this list'}\n \n \n \n \n {activityList && activityList.length > 0 && activityList.map((listEntry, x) => (\n (\n listEntry.toLowerCase().includes(activity_filter.toLowerCase()) ?\n {\n onSelect(listEntry);\n }}\n button\n >\n \n {listEntry}\n \n \n : null\n )\n ))}\n \n \n \n {\n onCancel();\n }}>\n {'Done'}\n \n \n \n );\n};\n","import React from 'react';\nimport { useSnackbar } from 'notistack';\nimport { lambda } from '../../util/AVAUtilities';\n\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport Button from '@material-ui/core/Button';\nimport Slide from '@material-ui/core/Slide';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport EventActivityForm from '../forms/EventActivityForm';\nimport ActivityFilter from '../forms/ActivityFilter';\n\n// import useMediaQuery from '@material-ui/core/useMediaQuery';\n\nconst useStyles = makeStyles(theme => ({\n pageHead: {\n paddingTop: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n subDescriptionText: {\n marginLeft: theme.spacing(3),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n },\n freeInput: {\n marginLeft: 0,\n marginBottom: '10px',\n marginRight: '2px',\n paddingLeft: 0,\n paddingRight: 0,\n verticalAlign: 'middle',\n minHeight: theme.typography.fontSize * 2.8,\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n load: {\n backgroundColor: theme.palette.warning[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n}));\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ pSession, pEvent_id, pName, showList, onClose }) => {\n const [eventActivityList, setEventActivityList] = React.useState([]);\n const [showEventSelect, setShowEventSelect] = React.useState(false);\n const [entireActivityList, setEntireActivityList] = React.useState();\n const [menuName, setMenuName] = React.useState('');\n\n const [entireActivityObject, setEntireActivityObject] = React.useState();\n\n const classes = useStyles();\n\n const [changes, setChanges] = React.useState(false);\n if (changes) { }\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:EventActivityMaintenance',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: ''\n };\n\n const { enqueueSnackbar } = useSnackbar();\n\n const getEventActivitiesList = async (pEvent) => {\n let invokeFailed = false;\n params.Payload = JSON.stringify({\n action: \"get_activities\",\n clientId: pSession.client_id,\n request: {\n \"event_id\": pEvent,\n }\n });\n const fResp = await lambda\n .invoke(params)\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA encountered an error while retrieving activity list. Error is ${err.message}`, {\n variant: 'error'\n });\n invokeFailed = true;\n });\n if (!invokeFailed) {\n let getEventActivities = JSON.parse(fResp.Payload);\n if (getEventActivities.status === 200) {\n setEventActivityList(getEventActivities.body);\n return eventActivityList;\n }\n };\n return [];\n };\n\n const getEventListFromMenu = async (pMenu) => {\n let listForEdit = entireActivityObject[pMenu].map(aRec => {\n return {\n activity_code: aRec.aCode,\n activity_name: aRec.aName,\n client_event_id: aRec.aEvent\n };\n });\n setEventActivityList(listForEdit);\n return eventActivityList;\n };\n\n const buildDetailedMenuList = async () => {\n let invokeFailed = false;\n params.Payload = JSON.stringify({\n action: \"build_menu\",\n clientId: pSession.client_id,\n request: {\n \"person_id\": pSession.patient_id,\n }\n });\n const fResp = await lambda\n .invoke(params)\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA encountered an error while retrieving activity list. Error is ${err.message}`, {\n variant: 'error'\n });\n invokeFailed = true;\n });\n if (!invokeFailed) {\n let getActivityMenus = JSON.parse(fResp.Payload);\n if (getActivityMenus.status === 200) {\n setEntireActivityList(Object.keys(getActivityMenus.body).sort());\n setEntireActivityObject(getActivityMenus.body);\n setShowEventSelect(true);\n }\n };\n };\n\n const handleAbort = () => {\n setChanges(false);\n setShowEventSelect(true);\n // onClose();\n };\n\n // **************************\n\n React.useEffect(() => {\n let aList = [];\n let response = (\n async () => {\n aList = await getEventActivitiesList(pEvent_id);\n }\n );\n if (!eventActivityList || eventActivityList.length === 0) {\n if (pEvent_id) {\n response();\n console.log(aList);\n }\n else {\n buildDetailedMenuList();\n }\n }\n }, [pEvent_id]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n return (\n (showList &&\n \n \n \n \n {menuName || `Activity Maintenance`}\n \n \n {eventActivityList.length === 0 ? 'Getting Activities' : ``}\n \n \n \n \n {\n await getEventActivitiesList(pEvent_id);\n }}\n />\n \n \n \n \n {showEventSelect &&\n {\n setShowEventSelect(false);\n onClose();\n }}\n onSelect={(selectedActivity) => {\n setShowEventSelect(false);\n setMenuName(selectedActivity);\n getEventListFromMenu(selectedActivity);\n }}\n >\n \n }\n \n )\n );\n};\n","import React from 'react';\nimport { useSnackbar } from 'notistack';\nimport { getServiceRequests, updateServiceRequest, putServiceRequest } from '../../util/AVAServiceRequest';\nimport { makeDate } from '../../util/AVADateTime';\nimport { makeName, getPersonFromPartialID, getPersonFromLocation, getPersonByName } from '../../util/AVAPeople';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContentText from '@material-ui/core/DialogContentText';\n\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport Typography from '@material-ui/core/Typography';\n\nimport Paper from '@material-ui/core/Paper';\nimport Box from '@material-ui/core/Box';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n// import useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport Slide from '@material-ui/core/Slide';\nimport { parseSpreadsheet } from '../../util/AVAUtilities';\n\nimport AVAUploadFile from '../../util/AVAUploadFile';\n\nvar XLSX = require(\"xlsx\");\n\nconst useStyles = makeStyles(theme => ({\n listItem: {\n justifyContent: 'space-between',\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2)\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n fontWeight: 'bold'\n },\n progressBar: {\n marginBottom: theme.spacing(3),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px'\n },\n subTitle: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '0.8rem'\n },\n typeOfLine: {\n fontSize: theme.typography.fontSize * 0.8,\n marginBottom: 0,\n },\n observationLine: {\n marginTop: 0,\n fontSize: theme.typography.fontSize * 1.8,\n },\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n paddingRight: 0,\n minWidth: '100%',\n },\n page: {\n maxWidth: 1000\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n color: theme.palette.reject[theme.palette.type],\n },\n rowButtonGreen: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n color: theme.palette.confirm[theme.palette.type],\n },\n}));\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ pClient, showSheet, session, defaults, onClose }) => {\n\n const classes = useStyles();\n\n const [loading, setLoading] = React.useState(false);\n const [progress, setProgress] = React.useState(0);\n const [pWidth, setPWidth] = React.useState(60);\n\n const { enqueueSnackbar } = useSnackbar();\n\n let defaultUser = 'AVA';\n if (Array.isArray(defaults) & (defaults.length > 0)) { defaultUser = defaults[0]; }\n else if (typeof defaults === 'string') { defaultUser = defaults; }\n\n let sheetData = [];\n\n const jobTime = new Date().getTime();\n\n async function handleSpreadsheet(pFile) {\n var req = new XMLHttpRequest();\n req.open(\"GET\", pFile.fLoc, true);\n req.responseType = \"arraybuffer\";\n req.onload = async function (e) {\n var data = new Uint8Array(req.response);\n var workbook = XLSX.read(data, { type: \"array\" });\n sheetData = parseSpreadsheet(workbook);\n setLoading(true);\n await processXLSData();\n setLoading(false);\n enqueueSnackbar(`Finished with ${pFile.fName}!`, { variant: 'success', persist: true });\n };\n req.send();\n };\n\n async function processXLSData() {\n // sheetData contains info as sheetData[row][column] = value\n // headers are at headerRow (so we'll start at the next row after that)\n // key data is at sheetData[row][keyColumn]\n // columns we care about are in headerColumns\n let headers = {\n 'Work Order #': { notify: false, request_data: false, key_data: true },\n 'Open Date': { notify: false, request_data: false },\n 'Closed Date': { notify: false, request_data: false },\n 'Closed By': { notify: false, request_data: false },\n 'Summary': { notify: true, request_data: true, description_data: true },\n 'Details of your request': { notify: true, request_data: true, description_data: true },\n 'Description': { notify: true, request_data: true, description_data: true },\n 'Status': { notify: true, request_data: false },\n 'Assigned To': { notify: true, request_data: true },\n 'Area Name': { notify: false, request_data: true },\n 'Comments': { notify: true, request_data: true, description_data: true },\n 'Initiated By': { notify: false, request_data: false },\n 'Requested By': { notify: false, request_data: false }\n };\n let foundHeader = false;\n let statusHeader = 'Status';\n let dateHeader = 'Open Date';\n let closedDate = 'Closed Date';\n let closedBy = 'Closed By';\n let keyHeader = 'Work Order #';\n let notesHeader = 'Comments';\n let personHeader = 'Requested By';\n let adminHeader = 'Initiated By';\n let locationHeader = 'Area Name';\n let sdL = sheetData.length;\n setPWidth(100);\n for (let activeRow = 0; activeRow < sdL; activeRow++) {\n setProgress((activeRow / sdL) * 100);\n if (!sheetData[activeRow]) { continue; }\n if (!foundHeader) {\n // ignore this row until we've found headers, then start with next row\n let rowData = Object.values(sheetData[activeRow]);\n if ((rowData.length >= 4) && (rowData.some(c => { return Object.keys(headers).includes(c); }))) {\n foundHeader = true;\n // eslint-disable-next-line\n Object.keys(headers).forEach(h => {\n for (let sheetColumn in sheetData[activeRow]) {\n if (sheetData[activeRow][sheetColumn] === h) {\n headers[h].column = sheetColumn;\n }\n }\n });\n }\n continue;\n }\n // process detail rows\n let needsUpdate = false;\n let reqRec;\n if (sheetData[activeRow][headers[keyHeader].column]) { // if the row lists a foreign key...\n let reqRecs = await getServiceRequests({ // see if there is a request for that foreign key already\n client_id: pClient,\n foreign_key: sheetData[activeRow][headers[keyHeader].column]\n });\n // if multiple request exist for that key, take the last (most recent) one\n let rL = reqRecs.length;\n if (rL > 0) {\n reqRec = reqRecs[rL - 1];\n }\n }\n if (!reqRec) { // there is no foreign key (TELS number, eg)\n // is there a local key in any cell?\n findLocal: for (let c in sheetData[activeRow]) {\n let wordList = sheetData[activeRow][c].split(' ');\n for (let w = 0; w < wordList.length; w++) {\n let thisWord = wordList[w];\n if (/[0-9]-[0-9]/.test(thisWord)) {\n let reqRecs = await getServiceRequests({\n client_id: pClient,\n local_key: thisWord\n });\n let rL = reqRecs.length; // if more than 1 request found with this local key, use most recent one\n if (rL > 0) {\n reqRec = reqRecs[rL - 1];\n break findLocal;\n }\n }\n }\n }\n }\n let guessedAuthor, guessedOBO;\n if (!reqRec) { // No foreign key and no local key\n // Can we figure out who the person is associated with this request?\n if (sheetData[activeRow][headers[locationHeader].column]) {\n let possibles = await getPersonFromLocation(pClient, sheetData[activeRow][headers[locationHeader].column]);\n if (possibles.length > 0) {\n guessedAuthor = possibles[0].person_id;\n guessedOBO = await makeName(guessedAuthor);\n }\n }\n if (!guessedAuthor && (sheetData[activeRow][headers[personHeader].column])) {\n let possibles = await getPersonFromPartialID(pClient, sheetData[activeRow][headers[personHeader].column].toLowerCase());\n if (possibles.length > 0) {\n guessedAuthor = possibles[0].person_id;\n guessedOBO = await makeName(guessedAuthor);\n }\n }\n if (!guessedAuthor && (sheetData[activeRow][headers[adminHeader].column])) {\n let possibles = await getPersonByName(pClient, sheetData[activeRow][headers[adminHeader].column].toLowerCase());\n if (possibles.length > 0) {\n guessedAuthor = possibles[0].person_id;\n }\n }\n // if we have a guessedAuthor, is there an open Service Request for this person that matches\n // three or more of the words in this request (provided that the word is four letters long or longer)\n if (guessedAuthor) {\n let guessedRecs = await getServiceRequests({\n person: guessedAuthor,\n request_type: 'maint'\n });\n // step 1 - remove any closed or completed requests\n let openRecs = [];\n if (guessedRecs && (guessedRecs.length > 0)) {\n guessedRecs.forEach(g => {\n if (!(['closed', 'completed', 'cancelled'].includes(g.last_status.toLowerCase()))) {\n openRecs.push(g);\n }\n });\n }\n if (openRecs.length > 0) {\n // step 2 - get all of the four+ letter words that are in the spreadsheet's description columns\n let descriptive_words = [];\n for (let h in headers) {\n if (headers[h].description_data && sheetData[activeRow][headers[h].column]) {\n sheetData[activeRow][headers[h].column].split(/\\s/).forEach(w => {\n if ((w.length > 3) && !(descriptive_words.includes(w))) { descriptive_words.push(w); }\n });\n }\n }\n for (let g = 0; g < openRecs.length; g++) {\n let gRec = openRecs[g];\n let request_words = [];\n // step 3 - get all of the descriptive_words in the original request\n if (gRec.original_request.hasOwnProperty('textInput')) {\n if (typeof gRec.original_request.textInput === 'string') {\n gRec.original_request.textInput.split(/\\s/).forEach(w => {\n if ((w.length > 3) && !(request_words.includes(w))) { request_words.push(w); }\n });\n }\n else {\n Object.keys(gRec.original_request.textInput).forEach(k => {\n if (headers.hasOwnProperty(k) && headers[k].description_data) {\n gRec.original_request.textInput[k].split(/\\s/).forEach(w => {\n if ((w.length > 3) && !(request_words.includes(w))) { request_words.push(w); }\n });\n }\n });\n }\n }\n // step 4 - does this request include three or more of the descriptive_words?\n let count = 0;\n descriptive_words.forEach(d => {\n request_words.forEach(r => {\n if (d === r) { count++; }\n });\n });\n if (count > 2) {\n reqRec = gRec;\n needsUpdate = true;\n break;\n }\n }\n }\n }\n }\n let textInput = {};\n for (let h in headers) {\n if (headers[h].request_data) {\n textInput[h] = sheetData[activeRow][headers[h].column];\n }\n }\n let statusMessage, updateTime;\n if (sheetData[activeRow][headers[statusHeader].column] && (!reqRec || (sheetData[activeRow][headers[statusHeader].column] !== reqRec.last_status))) {\n needsUpdate = true;\n if (sheetData[activeRow][headers[closedDate].column]) {\n let closeTime = makeDate(sheetData[activeRow][headers[closedDate].column]);\n statusMessage = `Closed ${closeTime.absolute}`;\n updateTime = closeTime.timestamp;\n if (sheetData[activeRow][headers[closedBy].column]) {\n statusMessage += ` by ${sheetData[activeRow][headers[closedBy].column]}`;\n }\n }\n else {\n let statusFrom = '';\n if (reqRec && reqRec.last_status) {\n statusFrom = ` from ${reqRec.last_status}`;\n }\n statusMessage = `Status changed${statusFrom} to ${sheetData[activeRow][headers[statusHeader].column]}`;\n }\n }\n if (!reqRec) {\n let fKey = sheetData[activeRow][headers[keyHeader].column];\n await putServiceRequest({\n client: pClient,\n author: guessedAuthor || defaultUser,\n requestType: 'maint',\n requestDate: makeDate(sheetData[activeRow][headers[dateHeader].column]).timestamp,\n onBehalfOf: guessedOBO || 'Maintenance Team',\n foreign_key: fKey,\n update_time: updateTime, // if null, putServiceRequest will set to current time\n history: [statusMessage],\n requestStatus: sheetData[activeRow][headers[statusHeader].column],\n notes: sheetData[activeRow][headers[notesHeader].column],\n request: { textInput }\n });\n }\n else if (needsUpdate) {\n // found an existing request... update it\n reqRec.last_status = sheetData[activeRow][headers[statusHeader].column];\n reqRec.last_update = updateTime || jobTime;\n if (statusMessage) {\n if (!reqRec.history) { reqRec.history = []; }\n reqRec.history.unshift(statusMessage);\n }\n if (!reqRec.original_request || (typeof (reqRec.original_request) === 'string')) {\n let prevText = reqRec.original_request || 'none';\n reqRec.original_request = { textInput: { 'Original request': prevText } };\n }\n for (let i in textInput) {\n if (textInput[i] === reqRec.original_request.textInput[i]) { continue; }\n reqRec.original_request.textInput[i] = textInput[i];\n if (!reqRec.history) { reqRec.history = []; }\n reqRec.history.push(`${i} changed to ${textInput[i]}`);\n }\n await updateServiceRequest(reqRec);\n }\n }\n }\n\n return (\n \n {loading &&\n \n \n \n \n {`Loading Work Order data`}\n {`version ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n \n \n \n \n \n }\n {!loading &&\n \n \n {'Upload Work Order updates to AVA'}\n \n \n {\n if (fileList.length === 0) { onClose(); }\n else { await handleSpreadsheet(fileList[0]); }\n }}\n onCancel={onClose}\n options={{ title: 'Choose file(s) to process' }}\n />\n \n \n }\n \n );\n\n};","import React from 'react';\nimport { useSnackbar } from 'notistack';\nimport { parseSpreadsheet, makeArray, uuid, s3, stepFunctions, resolveVariables } from '../../util/AVAUtilities';\nimport { getPersonByWords, getPerson } from '../../util/AVAPeople';\nimport { determineClass } from '../../util/AVAGroups';\nimport { makeDate } from '../../util/AVADateTime';\nimport { getServiceRequests } from '../../util/AVAServiceRequest';\nimport { AVAclasses } from '../../util/AVAStyles';\n\nimport AVAUploadFile from '../../util/AVAUploadFile';\nimport MakeMessage from './MakeMessage';\nimport AVAConfirm from '../forms/AVAConfirm';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContentText from '@material-ui/core/DialogContentText';\n\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport Typography from '@material-ui/core/Typography';\n\nimport Box from '@material-ui/core/Box';\nimport Slide from '@material-ui/core/Slide';\n\nimport useSession from '../../hooks/useSession';\n\nvar XLSX = require(\"xlsx\");\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ options = { runType: 'welfare_check' }, onClose }) => {\n\n const { state } = useSession();\n const AVAClass = AVAclasses();\n\n if (!options.runType) {\n options.runType = 'welfare_check';\n }\n\n const [reactData, setReactData] = React.useState({\n loading: false,\n initialized: false,\n pWidth: 100,\n progress: 0,\n stage: 'get_file',\n });\n const [forceRedisplay, setForceRedisplay] = React.useState(true);\n const [filesProcessed, setFilesProcessed] = React.useState([{}]);\n\n const { enqueueSnackbar } = useSnackbar();\n\n async function handleFiles(fileList) {\n let summaryList = [];\n let localFileName;\n if (fileList.length === 1) { localFileName = fileList[0].fName; }\n else { localFileName = `Multiple (${fileList.length - 1}) files uploaded ${makeDate(new Date()).absolute}`; }\n for (let f = 0; f < fileList.length; f++) {\n if (!fileList[f].fName) { fileList[f].fName = `File uploaded ${makeDate(new Date()).absolute}`; }\n switch (fileList[f].fType.toLowerCase()) {\n case 'csv':\n case 'xls':\n case 'xlsx': {\n let sheetData = await handleSpreadsheet(fileList[f]);\n let sheetObj = await processXLSData(sheetData);\n if (!sheetObj) {\n enqueueSnackbar(`${fileList[f].fName} has type ${fileList[f].fType}, but is not a valid spreadsheet`, { variant: 'error', persist: true });\n }\n else if (sheetObj.count === 0) {\n enqueueSnackbar(sheetObj.message, { variant: 'error', persist: true });\n }\n else {\n summaryList.push(...sheetObj.peopleList);\n }\n break;\n }\n default: {\n enqueueSnackbar(`AVA is unable to translate the file type ${fileList[f].fType} for ${fileList[f].fName}!`, { variant: 'error', persist: true });\n }\n }\n }\n let testList = [];\n let substituteNames = false;\n if (state.session[options.runType] && state.session[options.runType].testList) {\n testList = makeArray(state.session[options.runType].testList);\n substituteNames = true;\n }\n let recipientList = [];\n let recipientNameList = [];\n let nowTime = makeDate(new Date()).numeric$;\n let thread_id = `${options.runType}.${state.session.client_id}.${nowTime}.${uuid(6)}`;\n let callList = [];\n let noCallList = [];\n let colWidth = {\n AVA_ID: 10,\n Name: 25,\n Action: 10,\n Status: 10\n };\n let fakeNumber = 0;\n for (let l = 0; l < summaryList.length; l++) {\n let p = summaryList[l];\n let avaID = p.pID;\n if (p.pStatus === 'no match') {\n p.result = 'No AVA account found';\n }\n else if (p.pStatus.startsWith('multiple inactive')) {\n p.result = `${p.pStatus.split(':')[1]} accounts found. All are inactive.`;\n }\n else if (determineClass(p.pRec.groups, state.session.group_assignments) === 'inactive') {\n p.result = 'This is an inactive account';\n }\n else if (p.pStatus === 'multiple') {\n p.result = 'Multiple AVA accounts found';\n }\n else if (excludeThisPerson(p.pRec)) {\n p.result = 'Person is on the exclusion list';\n }\n else if (recipientList.includes(p.pID)) {\n p.result = 'Duplicate';\n }\n else {\n if (substituteNames) {\n let tID = testList.shift();\n if (tID) {\n p.result = 'Message Scheduled';\n recipientList.push(tID);\n avaID = tID;\n }\n else {\n p.result = 'Message would have been sent, but no substitute for testing identified';\n recipientList.push(`fakeID_${fakeNumber++}`);\n }\n }\n else {\n recipientList.push(p.pID);\n p.result = 'Message Scheduled';\n }\n recipientNameList.push(p.pName);\n p.thread = thread_id;\n let reqArray = await getServiceRequests({\n client_id: state.session.client_id,\n person_id: p.pID,\n foreign_key: 'resident',\n request_type: \"checkout\"\n });\n if ((reqArray.length > 0) && (reqArray[0].last_status === 'out')) {\n p.result += ` (Checked out since ${makeDate(reqArray[0].last_update).relative})`;\n }\n }\n if (p.result.startsWith('Message Scheduled')) {\n let rowData = {\n AVA_ID: avaID,\n Name: p.pName,\n Action: p.result,\n Status: 'Submitted'\n };\n callList.push(rowData);\n Object.keys(rowData).forEach(k => { \n let w = rowData[k].length;\n if (w > colWidth[k]) { colWidth[k] = w; }\n })\n }\n else {\n let rowData = {\n AVA_ID: avaID,\n Name: p.pName,\n Action: p.result,\n Status: 'No message'\n }\n noCallList.push(rowData);\n Object.keys(rowData).forEach(k => {\n let w = rowData[k].length;\n if (w > colWidth[k]) { colWidth[k] = w; }\n })\n }\n };\n if (recipientList.length === 0) {\n enqueueSnackbar(`Nobody found to contact!`, { variant: 'error', persist: false });\n reactData.stage = 'get_file';\n }\n else {\n reactData.stage = 'confirm_list';\n }\n reactData.request = {\n client: state.session.client_id,\n author: state.session.person_id,\n messageText: ``,\n recipientList,\n recipientNameList,\n subject: `sentenceCase(${options.runType})`,\n thread_id,\n preffered_method: 'urgent',\n localFileName\n };\n if (state.session[options.runType] && state.session[options.runType].message) {\n if (state.session[options.runType].message.text) {\n reactData.request.messageText = await resolveVariables(state.session[options.runType].message.text, state.session);\n }\n if (state.session[options.runType].message.voiceMail) {\n reactData.request.voiceMailMessage = await resolveVariables(state.session[options.runType].message.voiceMail, state.session);\n }\n if (state.session[options.runType].message.subject) {\n reactData.request.subject = await resolveVariables(state.session[options.runType].message.subject, state.session);\n }\n if (state.session[options.runType].message.author) {\n reactData.request.author = state.session[options.runType].message.author;\n }\n }\n callList.sort((a, b) => {\n if (a.Name < b.Name) { return -1; }\n else { return 1; }\n });\n noCallList.sort((a, b) => {\n if (a.Name < b.Name) { return -1; }\n else { return 1; }\n });\n let emptyRow = {\n AVA_ID: '',\n Name: '',\n Action: '',\n Status: ''\n };\n let finalList = [];\n finalList.push(emptyRow);\n finalList.push(...callList);\n finalList.push(emptyRow);\n finalList.push(emptyRow);\n finalList.push(emptyRow);\n finalList.push(...noCallList);\n reactData.callList = finalList;\n let newWorksheet = XLSX.utils.json_to_sheet(finalList, {});\n newWorksheet[\"!cols\"] = Object.values(colWidth).map(v => { return {wch: v}})\n let newWorkbook = XLSX.utils.book_new();\n XLSX.utils.book_append_sheet(newWorkbook, newWorksheet, \"Call List\");\n let bufferInfo = XLSX.write(newWorkbook, { type: 'buffer', bookType: 'xlsx' });\n const pFile = {\n Bucket: 'theseus-medical-storage',\n Key: `public_uploads/${thread_id}.xlsx`,\n Body: bufferInfo,\n ACL: 'public-read-write',\n };\n enqueueSnackbar(`Uploading your results report`, { variant: 'success' });\n let s3Resp = await s3\n .upload(pFile)\n .promise()\n .catch(err => {\n enqueueSnackbar(`Uh oh! AVA couldn't save your file. The reason is ${err.message}`, { variant: 'error', persist: true });\n });\n reactData.request.s3Upload = s3Resp.Location;\n reactData.loading = false;\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n };\n\n async function handleSpreadsheet(pFile) {\n return new Promise(function (resolve, reject) {\n reactData.loading = true;\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n var req = new XMLHttpRequest();\n req.open(\"GET\", pFile.fLoc, true);\n req.responseType = \"arraybuffer\";\n req.onload = async function () {\n var data = new Uint8Array(req.response);\n var workbook = XLSX.read(data, { type: \"array\" });\n let sheetData = parseSpreadsheet(workbook);\n if (!sheetData) { reject(`Nothing returned`); }\n else { resolve(sheetData); }\n };\n req.send();\n });\n };\n\n function excludeThisPerson(pRec) {\n let notExcluded = false;\n let excluded = true;\n if (!state.session[options.runType] || !state.session[options.runType].filter) {\n return notExcluded;\n }\n let filters = makeArray(state.session[options.runType].filter);\n for (let f = 0; f < filters.length; f++) {\n let this_filter = filters[f];\n let a = this_filter.property.split('.');\n let result = a.reduce((val, c, x) => {\n if (!val) { return false; }\n return val[a[x]];\n }, pRec);\n if (this_filter.if_exists === 'exclude') { return (result ? excluded : notExcluded); }\n else { return (result ? notExcluded : excluded); }\n };\n }\n\n async function processXLSData(sheetData) {\n // We're going to look for a column that contains names\n // First, look for something that looks like a column header. A cell with the word \"name\" in it.\n // sheetData is an array of arrays \n // it contains info as sheetData[row] = columnObj \n // where each columnObj[columnNumber] = cellValue\n\n let key_column;\n let headerRow = -1;\n let keyWord = 'name';\n let hasHeaderRow = true;\n if (state.session[options.runType] && state.session[options.runType].spreadsheet) {\n if (state.session[options.runType].spreadsheet.key_column) {\n key_column = state.session[options.runType].spreadsheet.key_column;\n }\n if (state.session[options.runType].spreadsheet.key) {\n keyWord = state.session[options.runType].spreadsheet.key;\n }\n if (state.session[options.runType].spreadsheet.hasOwnProperty('headers')) {\n hasHeaderRow = state.session[options.runType].spreadsheet.headers;\n }\n }\n let sdL = sheetData.length;\n if (hasHeaderRow || !key_column) {\n for (let activeRow = 0; activeRow < sdL; activeRow++) {\n reactData.progress = ((activeRow / sdL) * 100);\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n if (!sheetData[activeRow]) { continue; }\n let rowData = Object.entries(sheetData[activeRow]);\n // eslint-disable-next-line\n if (rowData.some(([column, cellValue]) => {\n if (cellValue.toLowerCase() === keyWord) {\n if (key_column) {\n if (column === key_column) {\n headerRow = activeRow;\n return true;\n }\n }\n else {\n key_column = column;\n headerRow = activeRow;\n return true;\n }\n }\n return false;\n })) { break; }\n }\n if (!key_column) {\n return {\n count: 0,\n message: 'No key column was found'\n };\n }\n }\n let nameList = [];\n for (let activeRow = headerRow + 1; activeRow < sdL; activeRow++) {\n reactData.progress = ((activeRow / sdL) * 100);\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n if (!sheetData[activeRow] || !sheetData[activeRow].hasOwnProperty(key_column)) { continue; }\n nameList.push(sheetData[activeRow][key_column]);\n }\n if (nameList.length === 0) {\n return {\n count: 0,\n message: 'Name column was empty'\n };\n }\n let returnObj = {\n count: 0,\n found: 0\n };\n let returnList = [];\n for (let x = 0; x < nameList.length; x++) {\n reactData.progress = ((x / nameList.length) * 100);\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n let this_name = nameList[x];\n if (this_name.toLowerCase().includes(' and ') || this_name.includes(' & ')) {\n let wordList = makeArray(this_name, ' ');\n let foundAt = wordList.indexOf('and');\n if (foundAt === -1) { foundAt = wordList.indexOf('&'); }\n if (foundAt > -1) {\n this_name = wordList.toSpliced(foundAt, 2).join(' ');\n let rightName = wordList.toSpliced(foundAt - 1, 2).join(' ');\n nameList.push(rightName);\n }\n }\n let pList = await getPersonByWords(state.session.client_id, makeArray(this_name.replace(',', ' ').toLowerCase(), ' '));\n if (pList.length > 1) { // if more than one account was found, remove any inactive accounts before proceeding\n let pCount = pList.length;\n pList = pList.filter(p => {\n return (determineClass(p.groups, state.session.group_assignments) !== 'inactive');\n });\n if (pList.length === 0) {\n returnList.push({ pID: '', pName: this_name, pRec: {}, pStatus: `multiple inactive:${pCount}` });\n break;\n }\n }\n returnObj.found += pList.length;\n returnObj.count++;\n switch (pList.length) {\n case 0: { // name not found by words? see if this is a userID instead...\n let pRec = await getPerson(this_name.toLowerCase());\n if (pRec.person_id) {\n returnList.push({ pID: pRec.person_id, pName: (`${pRec.first} ${pRec.last}`).trim(), pRec: pRec, pStatus: 'match' });\n returnObj.found += 1;\n }\n else {\n returnList.push({ pID: '', pName: this_name, pRec: {}, pStatus: 'no match' });\n }\n break;\n }\n case 1: {\n returnList.push({ pID: pList[0].person_id, pName: this_name, pRec: pList[0], pStatus: 'match' });\n break;\n }\n default: {\n returnList.push({ pID: pList.map(p => { return p.person_id; }), pName: this_name, pRec: pList, pStatus: 'multiple' });\n }\n }\n };\n if (returnObj.found === 0) {\n returnObj.message = `None of the ${returnObj.count} names matched an account`;\n }\n else {\n returnObj.message = `${returnObj.found} accounts found`;\n }\n returnObj.peopleList = returnList;\n return returnObj;\n }\n\n return (\n \n {reactData.loading &&\n \n \n \n \n {`Loading Call List data`}\n {`version ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n \n \n \n \n \n }\n {!reactData.loading &&\n \n {(reactData.stage === 'get_file') &&\n \n \n {'Daily Welfare Call Sheet'}\n \n { onClose(); }}\n onLoad={async (fileList) => {\n await handleFiles(fileList);\n }}\n options={{ title: 'Choose file(s) to process', buttonText: ['Exit', 'Process this file', 'Process these files'] }}\n />\n \n }\n {(reactData.stage === 'confirm_list') &&\n {\n enqueueSnackbar(`Cancel request acknowledged. No calls were placed.`, { variant: 'error', persist: true });\n onClose();\n }}\n onConfirm={() => {\n reactData.stage = 'send_message';\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n }}\n allowCancel={true}\n />\n }\n {(reactData.stage === 'send_message') &&\n {\n reactData.stage = 'get_file';\n setReactData(reactData);\n filesProcessed.unshift();\n setFilesProcessed(filesProcessed);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n }}\n onComplete={async () => {\n const stateMachineArn = 'arn:aws:states:us-east-1:125549937716:stateMachine:MessageFollowUp';\n await stepFunctions.startExecution({\n stateMachineArn,\n input: JSON.stringify({\n requestor: state.session.user_id,\n client_id: state.session.client_id,\n thread_id: reactData.request.thread_id,\n fileLocation: reactData.request.s3Upload,\n localName: reactData.request.localFileName\n }),\n }).promise();\n onClose();\n }}\n allowCancel={true}\n thread_id={reactData.request.thread_id}\n seedText={[reactData.request.subject, reactData.request.messageText, (reactData.request.voiceMailMessage || reactData.request.messageText)]}\n />\n }\n \n }\n \n );\n};","import React from 'react';\nimport { lambda, cl, sentenceCase, switchActiveAccount, listFromArray, makeArray } from '../../util/AVAUtilities';\nimport AVATextInput from './AVATextInput';\nimport { useSnackbar } from 'notistack';\nimport { getImage, getPerson, formatPhone } from '../../util/AVAPeople';\nimport { makeDate } from '../../util/AVADateTime';\nimport { createNewGroup, getMemberList, addMember, getPublicGroupList, getPrivateGroupList, determineClass, getRole, removeMember, removeAdministrator, addAdministrator } from '../../util/AVAGroups';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport useSession from '../../hooks/useSession';\n\nimport List from '@material-ui/core/List';\n// import PatientDialog from '../dialogs/PatientDialog';\nimport PeopleMaintenance from '../dialogs/PeopleMaintenance';\n\nimport CloseIcon from '@material-ui/icons/HighlightOff';\nimport PhoneInTalkIcon from '@material-ui/icons/PhoneInTalk';\nimport Button from '@material-ui/core/Button';\n\nimport EditIcon from '@material-ui/icons/PersonOutlineOutlined';\nimport SwapHorizIcon from '@material-ui/icons/SwapHoriz';\nimport RemoveCircleOutlineIcon from '@material-ui/icons/RemoveCircleOutline';\nimport AddCircleOutlineIcon from '@material-ui/icons/AddCircleOutline';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\n\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport TextField from '@material-ui/core/TextField';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport PrintIcon from '@material-ui/icons/Print';\nimport StorageOutlined from '@material-ui/icons/StorageOutlined';\nimport SendIcon from '@material-ui/icons/Send';\n\nimport GroupAddIcon from '@material-ui/icons/GroupAdd';\n\nimport PersonFilter from '../forms/PersonFilter';\nimport AVAConfirm from './AVAConfirm';\nimport MakeMessage from './MakeMessage';\n\nimport { AVAclasses, AVATextStyle, AVATextVariableStyle, AVADefaults } from '../../util/AVAStyles';\nimport RequestDashboard from '../dialogs/RequestDashboard';\n\nconst useStyles = makeStyles(theme => ({\n page: {\n height: 950,\n maxWidth: 1000\n },\n progressBar: {\n marginTop: theme.spacing(4),\n marginBottom: theme.spacing(3),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px'\n },\n freeInput: {\n marginLeft: '25px',\n marginRight: 2,\n marginBottom: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: theme.spacing(1),\n width: '60%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n buttonArea: {\n maxWidth: 1000,\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n giveSpace: {\n marginTop: theme.spacing(2),\n },\n giveMoreSpace: {\n marginTop: theme.spacing(4),\n },\n giveSpaceBoth: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(1),\n },\n adHead: {\n fontSize: '1.1rem',\n fontWeight: 'bold'\n },\n adName: {\n fontSize: '1.1rem',\n },\n AVAButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n listItem: {\n justifyContent: 'space-between',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(1),\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n makeIconStyle: {\n marginRight: theme.spacing(1),\n },\n locationLine: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n preferenceLine: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n techInfoLine: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(2),\n },\n techInfoLine2: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(4),\n },\n firstName: {\n\n },\n lastName: {\n fontWeight: 'bold',\n marginRight: theme.spacing(1),\n },\n containerBox: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n },\n superSizeLast: {\n marginTop: theme.spacing(0),\n fontWeight: 'bold',\n fontSize: theme.typography.fontSize * 2.8\n },\n superSizeFirst: {\n marginTop: theme.spacing(-2.5),\n fontSize: theme.typography.fontSize * 2.8\n },\n upSizeLast: {\n marginTop: theme.spacing(0),\n fontSize: theme.typography.fontSize * 2.0\n },\n upSizeLocation: {\n marginTop: theme.spacing(2),\n fontSize: theme.typography.fontSize * 2.0,\n flexGrow: 1,\n textAlign: 'center',\n lineHeight: `${theme.spacing(3)}px`,\n },\n upSizePreferenceBox: {\n marginTop: theme.spacing(2),\n lineHeight: `${theme.spacing(3)}px`,\n },\n superSizePreferenceLine1: {\n fontSize: theme.typography.fontSize * 2.0,\n },\n superSizePreferenceLine2: {\n marginTop: theme.spacing(0.5),\n lineHeight: `${theme.spacing(3)}px`,\n fontSize: theme.typography.fontSize * 2.0,\n fontWeight: 'bold'\n },\n superSizePreferenceLine3: {\n marginTop: 0,\n lineHeight: `${theme.spacing(3)}px`,\n fontSize: theme.typography.fontSize * 1.5,\n fontWeight: 'bold',\n marginBottom: theme.spacing(0.5),\n },\n superSizeArea: {\n minHeight: '100%'\n }\n}));\n\nexport default ({ options, onReset }) => {\n\n let { groupMemberList, peopleList, pPatient, pPatientName, pClient, pGroup, pGroupRec, pGroupName, pStyle, pRole } = options;\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const { state } = useSession();\n\n const [person_filter_lower, setPersonFilterLower] = React.useState(' ');\n const [singleFilterDigit, setSingleFilterDigit] = React.useState(false);\n const [showAddPrompt, setShowAddPrompt] = React.useState(false);\n const [showEditPerson, setShowEditPerson] = React.useState(null);\n const [editPersonRec, setEditPersonRec] = React.useState(null);\n // const [groupData, setGroupData] = React.useState({});\n\n const [workingMemberList, setGroupMemberList] = React.useState(Array.isArray(groupMemberList) ? groupMemberList : groupMemberList[pClient].list);\n\n const [deletePending, setDeletePending] = React.useState(false);\n const [confirmMessage, setConfirmMessage] = React.useState('');\n const [confirmPerson, setConfirmPerson] = React.useState('');\n const [confirmIndex, setConfirmIndex] = React.useState('');\n const [promptForMessage, setPromptForMessage] = React.useState('');\n const [showSuperSize, setshowSuperSize] = React.useState(false);\n const [showAccountHistory, setShowAccountHistory] = React.useState(false);\n const [promptForName, setPromptForName] = React.useState(false);\n const [superSizeData, setSuperSizeData] = React.useState(false);\n const [updatesMade, ] = React.useState(false);\n const [singlePersonMode, setsinglePersonMode] = React.useState(false);\n const [recipient, setRecipient] = React.useState();\n const [messageType, setMessageType] = React.useState();\n\n const isMobile = useMediaQuery(theme => theme.breakpoints.down('sm')); // checks if current device is a smart phone\n\n const [reactData, setReactData] = React.useState({\n imageSize: options.safeMode ? 50 : (isMobile ? 100 : 150),\n choiceList: []\n });\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n\n if (peopleList && !showSuperSize) {\n let singlePerson;\n if (Array.isArray(peopleList) && (peopleList.length === 1)) {\n if (typeof (peopleList[0]) === 'string') {\n singlePerson = peopleList[0];\n }\n else if (peopleList[0].hasOwnProperty('person_id')) {\n singlePerson = peopleList[0].person_id;\n }\n }\n else if (typeof (peopleList) === 'string') {\n singlePerson = peopleList;\n }\n if (singlePerson && !singlePerson.startsWith('~')) {\n let this_item = workingMemberList.find((pObj) => {\n return (pObj.person_id === singlePerson);\n });\n if (this_item) {\n this_item.role = 'member'; // await getRole(pGroup, singlePerson);\n this_item.public_groups = []; // await getPublicGroupList(state.session.client_id, singlePerson);\n this_item.private_groups = [];\n if (!this_item.account_class) {\n this_item.account_class = determineClass(this_item.groups, state.session.group_assignments);\n }\n setSuperSizeData(this_item);\n setshowSuperSize(true);\n setsinglePersonMode(true);\n }\n }\n }\n\n const [overrideRole, setOverrideRole] = React.useState();\n\n const [rowLimit, setRowLimit] = React.useState(5);\n const scrollValue = 5;\n var rowsWritten;\n var writtenRows = [];\n let filterTimeOut;\n\n const multiGroups = (\n (Array.isArray(pGroup))\n ? ((pGroup.length > 1) || (pGroup[0] === '*all'))\n : (pGroup.includes('~') || (pGroup === '*all'))\n );\n\n const adminAccount =\n ['master', 'support', 'admin'].includes(state.profile.account_class)\n || (pRole === 'admin')\n || (pRole === 'responsible');\n\n const { enqueueSnackbar } = useSnackbar();\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n function prefLineText(prefLine) {\n let rValue;\n if (prefLine.private) {\n rValue = `${prefLine.type} unpublished`;\n }\n else if (prefLine.type === 'e-Mail') {\n rValue = prefLine.display.join('@');\n }\n else {\n rValue = `${prefLine.type} ${prefLine.display[0]}`;\n }\n return rValue;\n };\n\n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:GroupMemberMaintenance',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: ''\n };\n\n function messageAll() {\n if (state.accessList[state.session.client_id]?.groups?.[pGroup] < 2) {\n return false; // this specific group is excluded\n }\n else {\n // if this in the hierarchy...\n let found = false;\n let found_level = 99;\n for (let x = 0; x < state.groups.adminHierarchy.length; x++) {\n let this_group = state.groups.adminHierarchy[x];\n if (!found) {\n if (pGroup === this_group.id) {\n found = true;\n found_level = this_group.level;\n }\n else {\n continue;\n }\n }\n else {\n if (this_group.level <= found_level) {\n return true; // got to another group at or higher without failing, you are authorized\n }\n else if (state.accessList[state.session.client_id]?.groups?.[this_group.id] < 2) {\n return false; // this group is a child of your group and not authorized; so you are not authorized\n }\n }\n }\n }\n }\n\n function formatLocalData(ldKey, inData) {\n switch (state.session.local_data[ldKey]) {\n case 'phone': {\n return formatPhone(inData);\n }\n case 'boolean': {\n return (inData ? 'Yes' : 'No');\n }\n case 'date': {\n return makeDate(inData).dateOnly;\n }\n case 'fulldate': {\n return makeDate(inData).absolute;\n }\n default: { return inData; }\n }\n }\n\n const handleChangePersonFilter = vCheck => {\n clearTimeout(filterTimeOut);\n cl(`set timeout with ${vCheck} at ${new Date().getTime()}`);\n filterTimeOut = setTimeout(() => {\n cl(`timeout ended ${vCheck} at ${new Date().getTime()}`);\n if (vCheck.length === 0) {\n setPersonFilterLower('');\n setSingleFilterDigit(false);\n }\n else {\n setPersonFilterLower(vCheck.toLowerCase());\n setSingleFilterDigit(vCheck.length === 1);\n }\n setRowLimit(scrollValue);\n }, 500);\n };\n\n const handleAddPersonToGroup = async (pPerson, pGroup) => {\n for (let p = 0; p < pPerson.length; p++) {\n await addMember(pPerson[p], pClient, pGroup);\n }\n let memberInfo = await getMemberList(pGroup, pClient, { \"sort\": true, \"exclude\": false });\n setGroupMemberList(memberInfo.peopleList);\n };\n\n const handleRemoveGroupMember = async (pPerson, pIndex) => {\n /*\n params.FunctionName = 'arn:aws:lambda:us-east-1:125549937716:function:GroupMemberMaintenance';\n params.Payload = JSON.stringify({\n action: \"remove_person_from_group\",\n clientId: pClient,\n request: {\n \"person_id\": pPerson,\n \"group_id\": pGroup,\n \"current_group_members\": workingMemberList\n }\n });\n await lambda\n .invoke(params)\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA encountered an error while deleting that item. Error is ${err.message}`, {\n variant: 'error'\n });\n });\n */\n await removeMember(pPerson, pClient, pGroup);\n let tempMemberList = workingMemberList;\n tempMemberList.splice(pIndex, 1);\n setGroupMemberList(tempMemberList);\n setForceRedisplay(!forceRedisplay);\n return tempMemberList;\n };\n\n const handlePrintDirectory = async (pGroup) => {\n params.FunctionName = 'arn:aws:lambda:us-east-1:125549937716:function:printDirectory';\n params.Payload = JSON.stringify({\n \"body\": {\n \"client_id\": pClient,\n \"requestor\": pPatient,\n \"report_title\": pGroupName,\n \"paperSize\": (state?.session?.directory_format?.paperSize || [563, 750]),\n \"showImages\": true,\n \"group_id\": pClient + '~' + pGroup\n }\n });\n lambda\n .invoke(params)\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA encountered an error while requesting a Group Directory. Error is ${err.message}`, {\n variant: 'error'\n });\n });\n enqueueSnackbar(`Directory Print request for ${pGroupName} has been submitted.`, {\n variant: 'success'\n });\n };\n\n const handlePrintRoster = async (pGroup) => {\n params.FunctionName = 'arn:aws:lambda:us-east-1:125549937716:function:group_roster';\n params.Payload = JSON.stringify({\n \"body\": {\n \"client_id\": pClient,\n \"person_id\": state.session.user_id,\n \"values\": pGroupName + ':group=' + pClient + '~' + pGroup,\n \"showCognito\": \"true\",\n \"test\": true\n }\n });\n lambda\n .invoke(params)\n .promise()\n .catch(err => {\n enqueueSnackbar(`AVA encountered an error while requesting a Group Roster. Error is ${err.message}`, {\n variant: 'error'\n });\n });\n enqueueSnackbar(`Roster report request for ${pGroupName} has been submitted.`, {\n variant: 'success'\n });\n };\n\n const setChoices = async (inList) => {\n let response = [];\n if (state.accessList) {\n state.accessList[state.session.client_id].list.forEach((a, x) => {\n if (['proxy', 'full', 'view'].includes(a.access)) {\n // list is of the form ::\n response.push(`${a.name.last}${a.name.first ? ', ' + a.name.first : ''}:${a.id}:${a.display_name}_${a.location}`);\n }\n });\n }\n else {\n let memberInfo = await getMemberList(inList, pClient, { \"sort\": true, \"exclude\": false });\n /* getMemberList returns\n {\n peopleList: [],\n groupList: []\n }\n */\n let mInfo;\n let pLL = memberInfo.peopleList.length;\n for (let e = 0; e < pLL; e++) {\n let p = memberInfo.peopleList[e];\n let searchString = [...Object.values(p.name), p.search_data, p.location].join(' ');\n if (p.messaging) { searchString += Object.values(p.messaging).join(' '); }\n // list is of the form ::\n try {\n mInfo = `${p.name.last}, ${p.name.first}:${p.person_id}:${searchString}`;\n response.push(mInfo);\n }\n catch (error) {\n cl(`response push error at index ${e} with ${mInfo}`);\n }\n };\n }\n updateReactData({ choiceList: response });\n setShowAddPrompt(true);\n };\n\n const onScroll = event => {\n setRowLimit(rowLimit + scrollValue);\n setForceRedisplay(!forceRedisplay);\n };\n\n function okToShow(pPerson) {\n try {\n if (!adminAccount && (pPerson.directory_option === 'exclude')) {\n return false;\n }\n else if (singleFilterDigit) {\n return (pPerson.name.last.toLowerCase().startsWith(person_filter_lower.trim()) || pPerson.location.toLowerCase().startsWith(person_filter_lower.trim() + '-'));\n }\n else {\n let searchString = [...Object.values(pPerson.name), pPerson.search_data, pPerson.location, pPerson.member_of].join(' ');\n if (pPerson.messaging) { searchString += Object.values(pPerson.messaging).join; }\n return searchString.toLowerCase().includes(person_filter_lower.trim());\n }\n }\n catch (error) {\n return false;\n }\n }\n\n let nameXRef;\n function makeResponsibleLines(respIn) {\n let respArray = makeArray(respIn);\n if (respArray.length === 0) {\n return '';\n }\n if (!nameXRef) {\n nameXRef = {};\n if (state.accessList?.[state.session.client_id]) {\n state.accessList[state.session.client_id].list.forEach(a => {\n if (a.access !== 'none') {\n nameXRef[a.person_id] = (`${a.name.first} ${a.name.last}`).trim();\n }\n });\n }\n }\n let respFiltered = respArray.filter(r => {\n return (nameXRef.hasOwnProperty(r.trim()));\n });\n if (respFiltered.length === 0) {\n return '';\n }\n else {\n return ('Linked to: ' + listFromArray(respFiltered.map(r => { return nameXRef[r.trim()]; })));\n }\n }\n\n function makeContactLines(pMessaging, pPreference, pPerson) {\n let returnArray = [];\n for (const messageType in pMessaging) {\n switch (messageType) {\n case 'sms': {\n if (pMessaging.sms && (!pMessaging.sms_private || adminAccount)) {\n returnArray.push({\n action: [`sms:${pMessaging.sms}`, `tel:${pMessaging.sms}`],\n button: ['Send Text', 'Call Cell'],\n type: 'cell',\n display: [formatPhone(pMessaging.sms)],\n private: pMessaging.sms_private\n });\n }\n break;\n }\n case 'voice': {\n if (pMessaging.voice && (!pMessaging.voice_private || adminAccount)) {\n returnArray.push({\n action: [`tel:${pMessaging.voice}`],\n button: ['Call Home'],\n type: 'home',\n display: [formatPhone(pMessaging.voice)],\n private: pMessaging.voice_private\n });\n }\n break;\n }\n case 'office': {\n if (pMessaging.office && (!pMessaging.office_private || adminAccount)) {\n returnArray.push({\n action: [`tel:${pMessaging.office}`],\n button: ['Call Work'],\n type: 'work',\n display: [formatPhone(pMessaging.office)],\n private: pMessaging.office_private\n });\n }\n break;\n }\n case 'email': {\n if (pMessaging.email && (!pMessaging.email_private || adminAccount)) {\n returnArray.push({\n action: [`mailto:${pMessaging.email}`],\n button: ['e-Mail'],\n type: 'e-Mail',\n display: (((pMessaging.email.length < 20) || !isMobile) ? [pMessaging.email] : pMessaging.email.split('@')),\n private: pMessaging.email_private\n });\n }\n break;\n }\n default: { break; }\n }\n }\n return returnArray;\n }\n\n // ******************\n\n return (\n \n \n \n {!showSuperSize &&\n \n \n {multiGroups ? 'Directory Listing' : `Members of the ${pGroupName} Group`}\n \n (handleChangePersonFilter(event.target.value))}\n className={classes.freeInput}\n helperText={isMobile ? 'Filter' : 'Type a few letters to filter the list'}\n inputProps={{ style: { fontSize: `${user_fontSize}rem`, lineHeight: `${user_fontSize * 1.2}rem` } }}\n FormHelperTextProps={{ style: { fontSize: `${user_fontSize * 0.75}rem`, lineHeight: `${user_fontSize * 0.9}rem` } }}\n variant={'standard'}\n autoComplete='off'\n />\n \n }\n \n \n \n {writtenRows = []}\n {rowsWritten = 0}\n \n {workingMemberList.map((this_item, index) => (\n ((rowsWritten <= rowLimit) && (okToShow(this_item)) &&\n {\n this_item.role = await getRole(pGroup, this_item.person_id);\n this_item.public_groups = await getPublicGroupList(state.session.client_id, this_item.person_id);\n this_item.private_groups = await getPrivateGroupList(state.session.client_id, this_item.person_id);\n if (!this_item.account_class) {\n this_item.account_class = determineClass(this_item.groups, state.session.group_assignments);\n }\n setSuperSizeData(this_item);\n setshowSuperSize(true);\n }}\n key={this_item.person_id + 'frag' + index}\n >\n \n {rowsWritten = writtenRows.push(this_item.person_id)}\n \n \n \n {(pStyle !== 'short') &&\n \n \n \n \n \n }\n \n {\n this_item.role = await getRole(pGroup, this_item.person_id);\n this_item.public_groups = await getPublicGroupList(state.session.client_id, this_item.person_id);\n this_item.private_groups = await getPrivateGroupList(state.session.client_id, this_item.person_id);\n if (!this_item.account_class) {\n this_item.account_class = determineClass(this_item.groups, state.session.group_assignments);\n }\n setSuperSizeData(this_item);\n setshowSuperSize(true);\n }}\n display='flex' flexDirection='column'>\n {(pStyle !== 'short')\n ?\n \n {this_item.name.last || this_item.display_name}\n {this_item.name.first}\n \n :\n \n {this_item.name.first}\n {this_item.name.last || this_item.display_name}\n \n }\n {adminAccount && ((this_item.session && this_item.session.responsible_for) || (this_item.responsible_for)) &&\n \n \n {makeResponsibleLines((this_item.session && this_item.session.responsible_for) || (this_item.responsible_for))}\n \n \n }\n {(pStyle !== 'short') && multiGroups && this_item.hasOwnProperty('member_of') &&\n {sentenceCase(this_item.member_of)}\n }\n {!options.safeMode && this_item.location && this_item.location.split('~').map((locLine, locIndex) => (\n {locLine.trim()}\n ))}\n {(this_item.directory_option === 'exclude') &&\n {'** Excluded from Directory **'}\n }\n {!options.safeMode &&\n \n \n {(makeContactLines(this_item.messaging, this_item.preferred_method, this_item)\n .map((prefLine, prefIndex) => (\n \n \n {prefLineText(prefLine)}\n \n \n )))}\n \n \n }\n \n \n \n \n \n )\n ))}\n {(rowsWritten === 0) &&\n \n \n {(workingMemberList.length === 0)\n ? `There are no members in this Group yet`\n : `Your selection didn't find anything`\n }\n \n \n }\n \n \n {showAddPrompt &&\n {\n setShowAddPrompt(false);\n }}\n onSelect={async (selectedPerson) => {\n await handleAddPersonToGroup(selectedPerson, pGroup);\n setShowAddPrompt(false);\n }}\n multiSelect={true}\n >\n \n }\n {showEditPerson && editPersonRec &&\n {\n if (updatedPerson) {\n updatedPerson.account_class = determineClass(updatedPerson.groups, state.session.group_assignments);\n setSuperSizeData(Object.assign(superSizeData, updatedPerson));\n // setUpdatesMade(true);\n }\n setEditPersonRec(null);\n setShowEditPerson(null);\n }}\n />\n // {\n // if (updatedPerson) {\n // updatedPerson.account_class = determineClass(updatedPerson.groups, state.session.group_assignments);\n // setSuperSizeData(Object.assign(superSizeData, updatedPerson));\n // setUpdatesMade(true);\n // }\n // setEditPersonRec(null);\n // setShowEditPerson(null);\n // }}\n // />\n }\n {promptForMessage &&\n { setPromptForMessage(false); }}\n onComplete={() => { setPromptForMessage(false); }}\n setMethod={(messageType === 'AVA') ? 'AVA' : (messageType.includes('URGENT') ? 'voice' : null)}\n allowCancel={true}\n />\n }\n {deletePending &&\n {\n setDeletePending(false);\n }}\n onConfirm={() => {\n handleRemoveGroupMember(confirmPerson, confirmIndex);\n if (confirmPerson === pPatient) { setOverrideRole('non-member'); }\n setDeletePending(false);\n }}\n >\n \n }\n {!showSuperSize && // Command Area\n \n \n \n }\n onClick={() => {\n setOverrideRole(null);\n onReset({ updatesMade });\n }}\n >\n {'Close'}\n \n \n {adminAccount && (pStyle === 'select') &&\n \n {!multiGroups && (['open', 'public', 'private', 'closed'].includes(pGroupRec.group_type)) &&\n {\n await setChoices(peopleList);\n }}\n startIcon={}\n >\n {(isMobile ? 'Add' : 'Add Members')}\n \n }\n { handlePrintDirectory(pGroup); }}\n startIcon={}\n >\n {'Directory'}\n \n { handlePrintRoster(pGroup); }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'gray', color: 'white' }}\n size='small'\n startIcon={}\n >\n {'Roster'}\n \n {(workingMemberList.length > rowsWritten) && (rowsWritten > 0) &&\n {\n setPromptForName(true);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n startIcon={}\n >\n {'Create a new Group'}\n \n }\n \n }\n \n {(pGroupRec && (['open', 'public'].includes(pGroupRec.group_type))) &&\n (overrideRole === 'member' || (!overrideRole && (pRole === 'member'))) &&\n {\n setConfirmMessage(`Confirm removing ${pPatientName} from the ${pGroupName} ${pGroupName.includes('roup') ? '' : ' Group'}`);\n setConfirmPerson(pPatient);\n setConfirmIndex(workingMemberList.findIndex(m => { return m.person_id === pPatient; }));\n setDeletePending(true);\n setForceRedisplay(false);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'red', color: 'white' }}\n size='small'\n startIcon={}\n >\n Remove me\n \n }\n {(pGroupRec && (['open', 'public'].includes(pGroupRec.group_type))) &&\n (overrideRole === 'non-member' || (!overrideRole && (pRole === 'non-member'))) &&\n \n {!multiGroups &&\n {\n await handleAddPersonToGroup([pPatient], pGroup);\n setOverrideRole('member');\n }}\n startIcon={}\n >\n {'Add Myself'}\n \n }\n \n }\n {!adminAccount && false &&\n {\n setPromptForMessage(true);\n setMessageType('');\n let rKey = '';\n pGroupRec.admin_list.forEach((g, i) => {\n rKey += ((i > 0) ? ' ~ ' : '') + `${pGroupName}${pGroupName.includes('roup') ? '' : ' Group'} Administrator:${g}`;\n });\n setRecipient(rKey);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'brown', color: 'white' }}\n size='small'\n startIcon={}\n >\n {`Msg Admin`}\n \n }\n \n {(adminAccount || (state.accessList[state.session.client_id]?.groups?.[pGroup] > 1)) &&\n \n {(adminAccount || messageAll()) &&\n {\n setPromptForMessage(true);\n setMessageType('Group');\n setRecipient(pGroupName + ':GRP//' + pClient + '/' + pGroup);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'brown', color: 'white' }}\n size='small'\n startIcon={}\n >\n {`Group Msg`}\n \n }\n {adminAccount &&\n {\n setPromptForMessage(true);\n setMessageType('URGENT Group');\n setRecipient(pGroupName + ':GRP//' + pClient + '/' + pGroup);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'red', color: 'white' }}\n size='small'\n startIcon={}\n >\n {`Call All`}\n \n }\n \n }\n \n \n }\n \n {promptForName &&\n { setPromptForName(false); }}\n onSave={async (newGroupName) => {\n setPromptForName(false);\n let newGroupID = await createNewGroup({\n client_id: state.session.client_id,\n madeFromGroup: pGroupRec,\n group_name: newGroupName,\n adminList: pPatient,\n memberList: writtenRows\n });\n onReset({ updatesMade: true, newGroupID, newGroupName, newMemberList: writtenRows });\n }}\n />\n }\n {showSuperSize &&\n \n \n \n \n \n {superSizeData.name.last || superSizeData.display_name}\n {superSizeData.name.first}\n {(superSizeData.member_of) &&\n {superSizeData.member_of}\n }\n {superSizeData.location && superSizeData.location.split('~').map((locLine, locIndex) => (\n {locLine.trim()}\n ))}\n {(superSizeData.directory_option === 'exclude') &&\n {'** Excluded from Directory **'}\n }\n {(makeContactLines(superSizeData.messaging, superSizeData.preferred_method, superSizeData)\n .map((prefLine, prefIndex) => (\n \n \n \n {sentenceCase(prefLine.type)}\n \n \n {(!adminAccount && prefLine.private) ? 'unpublished' : prefLine.display[0]}\n \n \n {(prefLine.display.length > 1) && (adminAccount || !prefLine.private) &&\n \n \n @{prefLine.display[1]}\n \n \n }\n \n )))}\n {adminAccount &&\n \n \n \n \n \n {`User ID`}\n \n \n {superSizeData.person_id.trim()}\n \n \n \n \n \n \n {`Member of`}\n \n \n {`${sentenceCase(superSizeData.account_class)}${adminAccount ? ' account' : ''}`}\n \n {superSizeData.public_groups && (Object.keys(superSizeData.public_groups).length > 0) &&\n \n {Object.keys(superSizeData.public_groups).map((pG, g) => (\n \n {(superSizeData.public_groups[pG].role !== 'non-member') &&\n \n {sentenceCase(superSizeData.public_groups[pG].group_name)}\n \n }\n \n ))}\n \n }\n {superSizeData.private_groups && (Object.keys(superSizeData.private_groups).length > 0) &&\n \n {Object.keys(superSizeData.private_groups).map((pG, g) => (\n \n {(superSizeData.private_groups[pG].role !== 'non-member') &&\n \n {sentenceCase(superSizeData.private_groups[pG].group_name)}\n \n }\n \n ))}\n \n }\n {superSizeData.local_data && (Object.keys(superSizeData.local_data).length > 0) &&\n \n {Object.keys(superSizeData.local_data).map((local, l) => (\n \n \n {`${sentenceCase(local)}`}\n \n \n {formatLocalData(local, superSizeData.local_data[local])}\n \n \n ))\n }\n \n }\n \n \n }\n \n }\n onClick={() => {\n if (singlePersonMode) {\n onReset({ updatesMade: false });\n }\n else {\n setshowSuperSize(false);\n setForceRedisplay(!forceRedisplay);\n }\n }}\n >\n {'Back'}\n \n }\n onClick={() => {\n setPromptForMessage(true);\n setMessageType('');\n let rKey = `${superSizeData.name.first} ${superSizeData.name.last}:${superSizeData.person_id}`;\n setRecipient(rKey.trim());\n }}\n >\n {`AVA Msg`}\n \n \n \n {(makeContactLines(superSizeData.messaging, superSizeData.preferred_method, superSizeData)\n .map((prefLine, prefIndex) => (\n \n \n \n {prefLine.button[0]}\n \n \n {(prefLine.action.length > 1) &&\n \n \n {prefLine.button[1]}\n \n \n }\n \n )))}\n \n {adminAccount &&\n \n \n {\n await switchActiveAccount(\n state.session,\n state.session.client_id,\n {\n id: superSizeData.person_id,\n name: `${superSizeData.name.first} ${superSizeData.name.last || superSizeData.display_name}`\n }\n );\n }}\n startIcon={}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'blue', color: 'white' }}\n size='small'\n >\n {'Switch to'}\n \n {\n // setGroupData(await getAllGroups(superSizeData.person_id));\n setShowEditPerson(superSizeData.person_id);\n setEditPersonRec(await getPerson(superSizeData.person_id));\n }}\n startIcon={}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'brown', color: 'white' }}\n size='small'\n >\n {'Edit'}\n \n {\n setShowAccountHistory(true);\n }}\n startIcon={}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'gray', color: 'white' }}\n size='small'\n >\n {'Show Activity'}\n \n \n \n }\n {adminAccount\n && !multiGroups\n &&\n \n \n {((pGroupRec.group_type !== 'parent') && (pGroupRec.group_type !== 'admin')) &&\n {\n setConfirmMessage(`Confirm removing ${superSizeData.name.first} ${superSizeData.name.last || superSizeData.display_name} from the ${pGroupName} ${pGroupName.includes('roup') ? '' : ' Group'}`);\n setConfirmPerson(superSizeData.person_id);\n setConfirmIndex(workingMemberList.findIndex(m => { return m.person_id === superSizeData.person_id; }));\n setDeletePending(true);\n setForceRedisplay(false);\n }}\n startIcon={}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'red', color: 'white' }}\n size='small'\n >\n {`Remove ${superSizeData.name.first || superSizeData.display_name} from the group`}\n \n }\n \n {(superSizeData.role === 'member') ?\n \n {\n await addAdministrator(superSizeData.person_id, pGroup);\n setForceRedisplay(false);\n }}\n startIcon={}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n >\n {`Make ${superSizeData.name.first || superSizeData.display_name} an Administrator of the group`}\n \n \n :\n \n {\n await removeAdministrator(superSizeData.person_id, pGroup);\n setForceRedisplay(false);\n }}\n startIcon={}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'red', color: 'white', textWrap: 'wrap' }}\n size='small'\n >\n {`Remove ${superSizeData.name.first || superSizeData.display_name} as an Administrator of the group`}\n \n \n }\n \n }\n \n \n }\n {showAccountHistory &&\n {\n setShowAccountHistory(false);\n }}\n />\n }\n \n \n );\n};","import React from 'react';\nimport { useSnackbar } from 'notistack';\n\nimport { createNewGroup } from '../../util/AVAGroups';\nimport MakeMessage from './MakeMessage';\n\nimport Paper from '@material-ui/core/Paper';\nimport TextField from '@material-ui/core/TextField';\n\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Button from '@material-ui/core/Button';\n\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport GroupAddIcon from '@material-ui/icons/GroupAdd';\nimport CloseIcon from '@material-ui/icons/ExitToApp';\n\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\n\nimport AVATextInput from '../forms/AVATextInput';\n\nimport { AVAclasses, AVATextStyle, AVADefaults } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n page: {\n height: 800,\n },\n formControl: {\n marginTop: theme.spacing(4),\n marginBottom: theme.spacing(2),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n paddingTop: 3,\n },\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n formControlLbl: {\n margin: 0,\n paddingTop: 0,\n height: theme.spacing(2.5),\n },\n freeInput: {\n marginLeft: '25px',\n marginRight: 2,\n marginBottom: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: theme.spacing(1),\n width: '60%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n minHeight: theme.typography.fontSize * 2.8,\n },\n AVAButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n titleText: {\n fontSize: '1.3rem',\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n },\n subDescriptionText: {\n marginLeft: theme.spacing(3),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n },\n rowButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small'\n },\n picture: {\n width: theme.spacing(16),\n height: theme.spacing(16),\n [theme.breakpoints.down('xs')]: {\n width: theme.spacing(8),\n height: theme.spacing(8),\n },\n },\n photoButton: {\n alignSelf: 'center',\n size: 'sm',\n variant: 'outlined',\n verticalAlign: 'middle',\n },\n defaultButton: {\n alignSelf: 'end',\n variant: 'outlined',\n verticalAlign: 'end',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n topButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.primary[theme.palette.type],\n },\n greenButton: {\n variant: 'outlined',\n backgroundColor: 'green',\n },\n resetButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.confirm[theme.palette.type],\n marginRight: 10,\n },\n infoButton: {\n variant: 'outlined',\n backgroundColor: theme.palette.info[theme.palette.type],\n marginRight: 10,\n paddingRight: 10,\n marginLeft: 10,\n paddingLeft: 10,\n },\n radioText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n listItemAVA: {\n fontSize: theme.typography.fontSize * 1.5,\n },\n listItemAVALight: {\n fontSize: theme.typography.fontSize * 1.5,\n fontWeight: 'light'\n },\n listItemAVABold: {\n fontSize: theme.typography.fontSize * 1.5,\n fontWeight: 'bold'\n },\n rightEdgeSmall: {\n fontSize: theme.typography.fontSize * 0.8,\n justifyContent: 'right',\n textTransform: 'capitalize'\n },\n idText: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: 10,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 10,\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n radioButton: {\n marginTop: 0,\n marginRight: 0,\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 5,\n },\n}));\n\nexport default ({ pSession, groupsManagedObject, focusAt, onCancel, onSelect, onRefresh }) => {\n const [activity_filter, setActivityFilter] = React.useState('');\n const [lower_activity_filter, setLowerFilter] = React.useState('');\n const [promptForName, setPromptForName] = React.useState(false);\n const [requestNewGroup, setRequestNewGroup] = React.useState(false);\n\n function calcMinimumGroupLevel() {\n let response = 99;\n Object.keys(groupsManagedObject).forEach((listEntry) => {\n if (groupsManagedObject[listEntry].level && (groupsManagedObject[listEntry].level < response)) {\n response = groupsManagedObject[listEntry].level;\n }\n });\n return response;\n }\n const [minimumGroupLevel,] = React.useState(calcMinimumGroupLevel() - 1);\n\n /*\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const [reactData, setReactData] = React.useState({\n hideChildren: {},\n hiding: false,\n hidingLevel: 0\n });\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n */\n const autoFocus = (element) => element?.focus();\n\n var rowsDisplayed;\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const { enqueueSnackbar } = useSnackbar();\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n const handleChangeActivityFilter = event => {\n setActivityFilter(event.target.value);\n setLowerFilter(event.target.value.toLowerCase());\n };\n\n function OKtoShow(inObj) {\n if (!lower_activity_filter) { return true; }\n if (inObj.hasOwnProperty('group_name')) {\n if (inObj.group_name.toLowerCase().includes(lower_activity_filter)) {\n return true;\n }\n }\n return (inObj.group_id.toLowerCase().includes(lower_activity_filter));\n };\n\n // **************************\n\n return (\n \n {Object.keys(groupsManagedObject).length === 0\n ?\n \n \n {`No Groups to show for ${pSession.user_display_name}`}\n \n \n :\n \n \n \n {'Select a group from this list'}\n \n\n \n \n \n \n \n {rowsDisplayed = 0}\n \n {Object.keys(groupsManagedObject).map((listEntry, listIndex) => (\n (OKtoShow(groupsManagedObject[listEntry]) &&\n \n \n {rowsDisplayed++}\n \n {\n onSelect(listEntry, listIndex);\n }}\n onContextMenu={async (e) => {\n e.preventDefault();\n enqueueSnackbar(`Group ID = ${listEntry}`, { variant: 'info', persist: true });\n }}\n button\n >\n \n \n {groupsManagedObject[listEntry].group_name}\n \n \n \n \n )\n ))\n }\n {promptForName &&\n { setPromptForName(false); }}\n onSave={async (newGroupName) => {\n setPromptForName(false);\n const newGroupID = await createNewGroup({\n client_id: pSession.client_id,\n group_name: newGroupName,\n adminList: pSession.patient_id,\n memberList: []\n });\n onRefresh({\n newGroupID,\n newGroupName\n });\n }}\n />\n }\n {!promptForName && (rowsDisplayed === 0) &&\n \n \n {!lower_activity_filter ? 'This Group has no members' : 'No members match that filter'}\n \n \n }\n {requestNewGroup &&\n {\n setRequestNewGroup(false);\n }}\n onComplete={() => {\n setRequestNewGroup(false);\n }}\n setMethod={null}\n allowCancel={true}\n />\n }\n \n \n \n }\n \n }\n onClick={() => {\n onCancel();\n }}\n >\n {'Done'}\n \n {pSession?.adminAccount &&\n {\n setPromptForName(true);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n startIcon={}\n >\n {`New Group`}\n \n }\n {!pSession?.adminAccount && pSession.newGroupAdministrator &&\n {\n setRequestNewGroup(true);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n startIcon={}\n >\n {`Request New Group`}\n \n }\n \n \n );\n};\n","import React from 'react';\n\nimport useSession from '../../hooks/useSession';\n\nimport { createNewGroup, getGroupMembers, getMemberList } from '../../util/AVAGroups';\nimport { dbClient, sentenceCase, isObject, recordExists, deepCopy, listFromArray } from '../../util/AVAUtilities';\nimport QuickSearch from '../sections/QuickSearch';\nimport { getPerson, getImage } from '../../util/AVAPeople';\nimport AVATextInput from '../forms/AVATextInput';\nimport PeopleMaintenance from '../dialogs/PeopleMaintenance';\n\nimport { Snackbar, Paper, TextField, Box, Dialog, DialogActions, Button, Typography } from '@material-ui/core';\nimport { Alert, AlertTitle } from '@material-ui/lab/';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport GroupAddIcon from '@material-ui/icons/GroupAdd';\nimport CloseIcon from '@material-ui/icons/ExitToApp';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport PeopleIcon from '@material-ui/icons/People';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport SendIcon from '@material-ui/icons/Send';\n\nimport { SET_GROUPS } from '../../contexts/Session/actions';\n\nimport { AVAclasses, AVATextStyle, AVADefaults } from '../../util/AVAStyles';\nimport MessageForm from './MessageForm';\n\nconst useStyles = makeStyles(theme => ({\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n myImageArea: {\n minWidth: '50px',\n maxWidth: '50px',\n minHeight: '50px',\n maxHeight: '50px',\n marginTop: '16px',\n marginRight: theme.spacing(1),\n borderRadius: '25px'\n },\n peopleBox: {\n paddingTop: 0,\n paddingBottom: theme.spacing(2),\n overflowX: 'auto',\n scrollbarWidth: 'thin',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n display: 'flex',\n width: '100%',\n flexDirection: 'column'\n },\n peopleBoxWithSpace: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(2),\n overflowX: 'auto',\n scrollbarWidth: 'thin',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n display: 'flex',\n width: '100%',\n flexDirection: 'row'\n },\n paperPallette: {\n borderRadius: '30px 30px 30px 30px',\n width: '95%',\n height: '100%',\n overflow: 'hidden'\n },\n dragNamesFirst: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: '3px',\n marginBottom: '-10px'\n },\n dragNamesLast: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: '3px',\n fontWeight: 'bold',\n marginBottom: '-10px'\n },\n assignment_avatar: {\n marginTop: 0,\n marginBottom: 0,\n height: 40,\n width: 40,\n paddingTop: 0,\n fontSize: '1.2rem',\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n listItemAVA: {\n fontSize: theme.typography.fontSize * 1.5,\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n}));\n\nexport default ({ defaults, pSession, groupsManagedObject, focusAt, onCancel, onSelect, onRefresh }) => {\n\n const { dispatch, state } = useSession();\n\n const [activity_filter, setActivityFilter] = React.useState('');\n const [lower_activity_filter, setLowerFilter] = React.useState('');\n const [promptForName, setPromptForName] = React.useState(false);\n\n const [reactData, setReactData] = React.useState({\n alert: false,\n window_width: 1,\n administrative_account: (['admin', 'support', 'master'].includes(state.user.account_class)),\n\n // from defaults\n agendaView: defaults.agendaView,\n allowAssign: defaults.allowAssign,\n assignmentList: defaults.assignmentList,\n assignmentView: defaults.assignmentView,\n viewOnly: defaults.viewOnly,\n\n\n\n\n anchorEl: null,\n building: 'not started',\n defaults,\n denseView: false,\n display_name: state.patient?.name?.first || 'My',\n event_being_edited: false,\n filterTextLower: null,\n groupID: '',\n groupName: '',\n groupRec: {},\n groupRole: '',\n groupsManagedObject: [],\n groupMemberList: [],\n isDarkMode: useMediaQuery('(prefers-color-scheme: dark)'),\n loading: false,\n needRef: false,\n newGroups: {},\n popUpOpen: false,\n progressMessage: 'Building Group List',\n pWidth: 60,\n rowLimit: 50,\n selectDate: null,\n selectedPerson_id: null,\n selectedPersonRec: false,\n selectedPersonFirstName: '',\n selectedPersonLastName: '',\n showGroupSelect: false,\n showQuickSearch: false,\n selectedGroup_id: null,\n selectedGroupRec: false,\n selectedGroupMembers: false,\n updatesMade: false,\n viewPeopleMaintenance: false\n });\n const [refreshTrigger, setRefreshTrigger] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setRefreshTrigger(refreshTrigger => !refreshTrigger); }\n };\n\n\n function handleResize() {\n updateReactData({\n window_width: Math.min(((window.window.innerWidth - 220) / 1400), 1),\n }, true);\n }\n\n function calcMinimumGroupLevel() {\n let response = 99;\n Object.keys(groupsManagedObject).forEach((listEntry) => {\n if (groupsManagedObject[listEntry].level && (groupsManagedObject[listEntry].level < response)) {\n response = groupsManagedObject[listEntry].level;\n }\n });\n return response;\n }\n const [minimumGroupLevel,] = React.useState(calcMinimumGroupLevel() - 1);\n\n const handleDragStart = (ev, id) => {\n ev.dataTransfer.setData('id', JSON.stringify(id));\n };\n\n const handleDragOver = (ev) => {\n ev.preventDefault();\n };\n\n const handleDrop = async (ev, { droppedOn }) => {\n ev.preventDefault();\n let draggedFrom = JSON.parse(ev.dataTransfer.getData('id'));\n console.log(draggedFrom);\n console.log(droppedOn);\n if (draggedFrom.group_id === droppedOn.group_id) {\n return;\n }\n if (draggedFrom.hasOwnProperty('groupObj')) {\n if (droppedOn.levelZero) {\n let top = state.groups.adminHierarchy.find(h => { return h.level === 0; });\n droppedOn.group_id = top.id;\n }\n else if (droppedOn.groupObj.group_type !== 'admin') {\n // public and private groups cannot be dropped on\n updateReactData({\n alert: {\n severity: 'error',\n title: 'Error',\n message: `${droppedOn.groupObj.group_name} is a ${sentenceCase(droppedOn.groupObj.group_type)} group and cannot be a \"parent\"`\n }\n }, true);\n return;\n }\n // who are my parent and grandparents before the change?\n let targetGroup_formerFamilyTree = [];\n let this_group = myParent(draggedFrom.group_id);\n for (this_group; !!this_group; this_group = myParent(this_group)) {\n targetGroup_formerFamilyTree.push(this_group);\n }\n // dragged now belongs_to dropped\n let UpdateExpression = 'set #b = :b';\n let ExpressionAttributeValues = {\n ':b': droppedOn.group_id\n };\n let ExpressionAttributeNames = {\n '#b': 'belongs_to'\n };\n if (draggedFrom.groupObj.group_type !== 'admin') { // if this formerly was a public or private group, it will now be an admin type group\n UpdateExpression += ', #t = :t';\n ExpressionAttributeValues[':t'] = 'admin';\n ExpressionAttributeNames['#t'] = 'group_type';\n }\n await dbClient\n .update({\n Key: {\n client_id: pSession.client_id,\n group_id: draggedFrom.group_id\n },\n UpdateExpression,\n ExpressionAttributeValues,\n ExpressionAttributeNames,\n TableName: \"Groups\",\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating Group; error is: `, error);\n });\n\n groupsManagedObject[draggedFrom.group_id].level = (groupsManagedObject[droppedOn.group_id]?.level || 0) + 1;\n\n // who are my parent and grandparents after the change?\n let targetGroup_newFamilyTree = [droppedOn.group_id];\n this_group = myParent(droppedOn.group_id);\n for (this_group; !!this_group; this_group = myParent(this_group)) {\n targetGroup_newFamilyTree.push(this_group);\n }\n for (const former_parent of targetGroup_formerFamilyTree) {\n state.groups.parent_of[former_parent].splice(state.groups.parent_of[former_parent].indexOf(draggedFrom.group_id), 1);\n }\n for (const new_parent of targetGroup_newFamilyTree) {\n if (state.groups.parent_of.hasOwnProperty(new_parent)) {\n state.groups.parent_of[new_parent].push(draggedFrom.group_id);\n }\n else {\n state.groups.parent_of[new_parent] = [draggedFrom.group_id];\n }\n }\n\n let foundAt = state.groups.adminHierarchy.findIndex(g => { return g.id === draggedFrom.group_id; });\n if (foundAt > -1) {\n state.groups.adminHierarchy[foundAt].belongs_to = droppedOn.group_id;\n }\n else {\n state.groups.adminHierarchy.push({\n belongs_to: droppedOn.group_id,\n id: draggedFrom.group_id,\n level: groupsManagedObject[draggedFrom.group_id].level,\n name: draggedFrom.groupObj.group_name,\n selectable: true\n });\n }\n delete state.groups.publicGroups[draggedFrom.group_id];\n dispatch({ type: SET_GROUPS, payload: Object.assign({}, state.groups) });\n // does the group you are dragging have members?\n // if so, you have to update the groups for EVERY member\n /* if (reactData.selectedPersonRec) {\n let newGroupList = deepCopy(reactData.selectedPersonRec.groups);\n for (let this_group of targetGroup_formerFamilyTree) {\n if (newGroupList.includes(this_group)) {\n newGroupList.splice(newGroupList.indexOf(this_group), 1);\n }\n }\n for (let this_group of targetGroup_newFamilyTree) {\n if (!newGroupList.includes(this_group)) {\n newGroupList.push(this_group);\n }\n }\n updateReactData({\n selectedPersonRec: Object.assign({}, reactData.selectedPersonRec, { groups: newGroupList })\n }, true);\n }\n */\n }\n else if (draggedFrom.hasOwnProperty('personObj')) {\n if (draggedFrom.hasOwnProperty('personGroup') && (draggedFrom.intent === 'group')) {\n // this was a drag of a group name from the right column;\n // it should only be used drag to the trash can, removing this person from this group\n // handleDrop_removeGroup should have been triggered.\n // Dropping here is an error\n updateReactData({\n alert: {\n severity: 'error',\n title: `You can't drop that there!`,\n message: `You dragged ${groupsManagedObject[draggedFrom.personGroup].group_name} from the right side onto ${groupsManagedObject[droppedOn.group_id].group_name} on left side. We don't know what to do with that!`\n }\n }, true);\n return;\n }\n // get my peopleRec\n let peopleRec = await dbClient\n .get({\n TableName: 'People',\n Key: { person_id: draggedFrom.personObj.person_id }\n })\n .promise()\n .catch(error => {\n console.log(`caught error reading People; error is: `, error);\n });\n if (!recordExists(peopleRec)) {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'Error',\n message: `Something's not right... we couldn't find ${droppedOn.personObj.first_name} in the database. Contact Support for more assistance`\n }\n }, true);\n return;\n }\n // good peopleRec\n // we are adding the dropped on groups and all its parents to the groupList for this person. Get that list\n let addGroupList = [droppedOn.group_id];\n let this_group = myParent(droppedOn.group_id);\n for (this_group; !!this_group; this_group = myParent(this_group)) {\n addGroupList.push(this_group);\n }\n let newGroupList = deepCopy([peopleRec.Item.groups].flat());\n let addedGroups = [];\n for (let this_group of addGroupList) {\n if (!newGroupList.includes(this_group)) {\n newGroupList.push(this_group);\n addedGroups.push(groupsManagedObject[this_group].group_name);\n }\n }\n let reactUpdObj = {};\n if (addedGroups.length === 0) {\n reactUpdObj.alert = {\n severity: 'info',\n title: `Already a member`,\n message: `${draggedFrom.personObj.name.first} was already a member of ${groupsManagedObject[droppedOn.group_id].group_name}`\n };\n }\n else {\n reactUpdObj.alert = {\n severity: 'success',\n title: `Success!`,\n message: `${draggedFrom.personObj.name.first} was added to ${listFromArray(addedGroups)}`\n };\n }\n // make the update\n let newClientGroupsObj;\n if (peopleRec.Item.clients) {\n newClientGroupsObj = deepCopy(peopleRec.Item.clients);\n }\n else {\n newClientGroupsObj = {\n id: pSession.client_id,\n groups: newGroupList\n }\n }\n if (newClientGroupsObj.hasOwnProperty('id')) { // expected and standard\n if (newClientGroupsObj.id !== pSession.client_id) { // but we are in a client other than the typical one (this should be very rare)\n newClientGroupsObj[newClientGroupsObj.id] = Object.assign({}, newClientGroupsObj);\n newClientGroupsObj[pSession.client_id] = {\n id: pSession.client_id,\n groups: newGroupList\n };\n }\n newClientGroupsObj.groups = newGroupList;\n newClientGroupsObj.id = pSession.client_id;\n }\n else {\n newClientGroupsObj[pSession.client_id] = {\n id: pSession.client_id,\n groups: newGroupList\n };\n }\n let UpdateExpression = 'set #g = :g, #c = :c';\n let ExpressionAttributeValues = {\n ':g': newGroupList,\n ':c': newClientGroupsObj\n };\n let ExpressionAttributeNames = {\n '#g': 'groups',\n '#c': 'clients'\n };\n await dbClient\n .update({\n Key: {\n person_id: draggedFrom.personObj.person_id\n },\n UpdateExpression,\n ExpressionAttributeValues,\n ExpressionAttributeNames,\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating Group; error is: `, error);\n });\n if (reactData.selectedPersonRec) {\n reactUpdObj.selectedPersonRec = Object.assign({}, peopleRec.Item, { groups: newGroupList });\n }\n else if (reactData.selectedGroupRec) {\n if (newGroupList.includes(reactData.selectedGroup_id)) {\n if (!reactData.selectedGroupMembers.hasOwnProperty(draggedFrom.personObj.person_id)) {\n reactData.selectedGroupMembers[draggedFrom.personObj.AVAclassesperson_id] = peopleRec.Item;\n };\n reactUpdObj.selectedGroupMembers = reactData.selectedGroupMembers;\n }\n }\n updateReactData(reactUpdObj, true);\n };\n };\n\n\n const handleDrop_removeGroup = async (ev) => {\n ev.preventDefault();\n let draggedFrom = JSON.parse(ev.dataTransfer.getData('id'));\n console.log(draggedFrom);\n if (draggedFrom.hasOwnProperty('personGroup')) {\n // get my peopleRec\n let peopleRec = await dbClient\n .get({\n TableName: 'People',\n Key: { person_id: draggedFrom.personObj.person_id }\n })\n .promise()\n .catch(error => {\n console.log(`caught error reading People; error is: `, error);\n });\n if (!recordExists(peopleRec)) {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'Error',\n message: `Something's not right... we couldn't find ${draggedFrom.personObj.name?.first} in the database. Contact Support for more assistance`\n }\n }, true);\n return;\n }\n // good peopleRec\n // we are removing the draggedFrom.personGroup from the group list for draggedFrom.person_id; get the current group list\n let newGroupList = deepCopy([peopleRec.Item.groups].flat());\n let foundAt = newGroupList.indexOf(draggedFrom.personGroup);\n if (foundAt > -1) {\n newGroupList.splice(foundAt, 1);\n }\n // if I am removing a group that has children, remove the chlidren\n newGroupList = removeChildren(draggedFrom.personGroup, newGroupList);\n\n // if what is left contains a parent of this group and that parent now has no children remaining, remove it\n newGroupList = checkEmptyParent(draggedFrom.personGroup, newGroupList);\n\n\n // make the update\n let newClientGroupsObj = deepCopy(peopleRec.Item.clients);\n if (newClientGroupsObj.hasOwnProperty('id')) { // expected and standard\n if (newClientGroupsObj.id !== pSession.client_id) { // but we are in a client other than the typical one (this should be very rare)\n newClientGroupsObj[newClientGroupsObj.id] = Object.assign({}, newClientGroupsObj);\n newClientGroupsObj[pSession.client_id] = {\n id: pSession.client_id,\n groups: newGroupList\n };\n }\n newClientGroupsObj.groups = newGroupList;\n newClientGroupsObj.id = pSession.client_id;\n }\n else {\n newClientGroupsObj[pSession.client_id] = {\n id: pSession.client_id,\n groups: newGroupList\n };\n }\n let UpdateExpression = 'set #g = :g, #c = :c';\n let ExpressionAttributeValues = {\n ':g': newGroupList,\n ':c': newClientGroupsObj\n };\n let ExpressionAttributeNames = {\n '#g': 'groups',\n '#c': 'clients'\n };\n await dbClient\n .update({\n Key: {\n person_id: draggedFrom.personObj.person_id\n },\n UpdateExpression,\n ExpressionAttributeValues,\n ExpressionAttributeNames,\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating Group; error is: `, error);\n });\n let removedGroups = [peopleRec.Item.groups].flat().filter(g => { return !newGroupList.includes(g); });\n let alertMessage = false;\n if (removedGroups.length > 0) {\n alertMessage = {\n severity: 'success',\n title: `Success!`,\n message: `${draggedFrom.personObj.name.first} was removed from ${listFromArray(removedGroups.map(g => { return groupsManagedObject[g].group_name; }))}`\n };\n }\n updateReactData({\n alert: alertMessage,\n selectedPersonRec: Object.assign({}, peopleRec.Item, { groups: newGroupList })\n }, true);\n };\n };\n\n function removeChildren(this_group, newGroupList) {\n if (!state.groups.parent_of.hasOwnProperty(this_group)) {\n return newGroupList;\n }\n for (let this_child of state.groups.parent_of[this_group]) {\n let foundAt = newGroupList.indexOf(this_child);\n if (foundAt > -1) {\n newGroupList.splice(foundAt, 1);\n }\n newGroupList = removeChildren(this_child, newGroupList);\n }\n return newGroupList;\n }\n\n function checkEmptyParent(this_group, newGroupList) {\n let this_parent = myParent(this_group);\n if (!this_parent) {\n return newGroupList;\n }\n let foundAt = newGroupList.indexOf(this_parent);\n if ((foundAt > -1) && !state.groups.parent_of[this_parent].some(this_child => {\n return newGroupList.includes(this_child);\n })) {\n newGroupList.splice(foundAt, 1); // remove if no children remaining\n }\n newGroupList = checkEmptyParent(this_parent, newGroupList);\n return newGroupList;\n }\n\n const placeholderImage =\n 'https://theseus-medical-storage.s3.amazonaws.com/public/patients/tboone.jpg';\n\n const onImageError = (e) => {\n e.target.src = placeholderImage;\n };\n\n const handleDrop_removePerson = async (ev) => {\n ev.preventDefault();\n let draggedFrom = JSON.parse(ev.dataTransfer.getData('id'));\n console.log(draggedFrom);\n if (draggedFrom.hasOwnProperty('personGroup')) {\n // get my peopleRec\n let peopleRec = await dbClient\n .get({\n TableName: 'People',\n Key: { person_id: draggedFrom.personObj.person_id }\n })\n .promise()\n .catch(error => {\n console.log(`caught error reading People; error is: `, error);\n });\n if (!recordExists(peopleRec)) {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'Error',\n message: `Something's not right... we couldn't find ${draggedFrom.personObj.name?.first} in the database. Contact Support for more assistance`\n }\n }, true);\n return;\n }\n // good peopleRec\n // we are removing the draggedFrom.personGroup from the group list for draggedFrom.personObj.person_id; get the current group list\n let newGroupList = deepCopy([peopleRec.Item.groups].flat());\n let foundAt = newGroupList.indexOf(draggedFrom.personGroup);\n if (foundAt > -1) {\n newGroupList.splice(foundAt, 1);\n }\n // if I am removing a group that has children, remove the chlidren\n newGroupList = removeChildren(draggedFrom.personGroup, newGroupList);\n\n // if what is left contains a parent of this group and that parent now has no children remaining, remove it\n newGroupList = checkEmptyParent(draggedFrom.personGroup, newGroupList);\n\n // make the update\n let newClientGroupsObj = deepCopy(peopleRec.Item.clients);\n if (newClientGroupsObj.hasOwnProperty('id')) { // expected and standard\n if (newClientGroupsObj.id !== pSession.client_id) { // but we are in a client other than the typical one (this should be very rare)\n newClientGroupsObj[newClientGroupsObj.id] = Object.assign({}, newClientGroupsObj);\n newClientGroupsObj[pSession.client_id] = {\n id: pSession.client_id,\n groups: newGroupList\n };\n }\n newClientGroupsObj.groups = newGroupList;\n newClientGroupsObj.id = pSession.client_id;\n }\n else {\n newClientGroupsObj[pSession.client_id] = {\n id: pSession.client_id,\n groups: newGroupList\n };\n }\n let UpdateExpression = 'set #g = :g, #c = :c';\n let ExpressionAttributeValues = {\n ':g': newGroupList,\n ':c': newClientGroupsObj\n };\n let ExpressionAttributeNames = {\n '#g': 'groups',\n '#c': 'clients'\n };\n await dbClient\n .update({\n Key: {\n person_id: draggedFrom.personObj.person_id\n },\n UpdateExpression,\n ExpressionAttributeValues,\n ExpressionAttributeNames,\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating Group; error is: `, error);\n });\n delete reactData.selectedGroupMembers[draggedFrom.personObj.person_id];\n let removedGroups = [peopleRec.Item.groups].flat().filter(g => { return !newGroupList.includes(g); });\n let alertMessage = false;\n if (removedGroups.length > 0) {\n alertMessage = {\n severity: 'success',\n title: `Success!`,\n message: `${draggedFrom.personObj.name.first} was removed from ${listFromArray(removedGroups.map(g => { return groupsManagedObject[g].group_name; }))}`\n };\n }\n updateReactData({\n alert: alertMessage,\n selectedGroupMembers: reactData.selectedGroupMembers\n }, true);\n }\n else if (draggedFrom.hasOwnProperty('groupObj')) {\n if (Object.keys(reactData.selectedGroupMembers).length > 0) {\n updateReactData({\n alert: {\n severity: 'error',\n title: `${draggedFrom.groupObj.group_name} has members`,\n message: `${draggedFrom.groupObj.group_name} has ${Object.keys(reactData.selectedGroupMembers).length} member${(Object.keys(reactData.selectedGroupMembers).length > 1) ? 's' : ''}. You can't remove this group unless it is empty.`\n }\n }, true);\n }\n else {\n // we will delete thie group_id; before we do, look for any direct descendants and change their parent to my parent\n let targetGroup_parent = myParent(draggedFrom.groupObj.group_id);\n if (state.groups.parent_of.hasOwnProperty(draggedFrom.groupObj.group_id)) {\n for (const this_child of state.groups.parent_of[draggedFrom.groupObj.group_id]) {\n if (myParent(this_child) === draggedFrom.groupObj.group_id) { // if the child is a GRANDchild, don't change its parent\n // take the child and make it a child of the parent of the group we are deleting;\n await dbClient\n .update({\n Key: {\n client_id: pSession.client_id,\n group_id: this_child\n },\n UpdateExpression: 'set #b = :b',\n ExpressionAttributeValues: { ':b': targetGroup_parent },\n ExpressionAttributeNames: { '#b': 'belongs_to' },\n TableName: \"Groups\",\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating Group; error is: `, error);\n });\n let foundAt = state.groups.adminHierarchy.findIndex(g => { return g.id === this_child; });\n if (foundAt > -1) {\n state.groups.adminHierarchy[foundAt].belongs_to = targetGroup_parent;\n }\n }\n groupsManagedObject[this_child].level--;\n }\n }\n // no children remain; go ahead with the delete\n delete groupsManagedObject[draggedFrom.groupObj.group_id];\n await dbClient\n .delete({\n Key: {\n client_id: pSession.client_id,\n group_id: draggedFrom.groupObj.group_id\n },\n TableName: \"Groups\",\n })\n .promise()\n .catch(error => {\n console.log(`caught error deleting Group; error is: `, error);\n });\n let reactUpdObj = {\n alert: {\n severity: 'success',\n title: `${draggedFrom.groupObj.group_name} removed`,\n message: `${draggedFrom.groupObj.group_name} was successfully removed.`\n }\n };\n if (reactData.selectedGroup_id === draggedFrom.groupObj.group_id) {\n reactUpdObj.selectedGroupRec = false;\n reactUpdObj.selectedGroup_id = false;\n reactUpdObj.selectedGroupMembers = false;\n }\n updateReactData(reactUpdObj, true);\n }\n };\n };\n\n const myParent = (this_group) => {\n let groupInfo = state.groups.adminHierarchy.find(g => { return g.id === this_group; });\n if (groupInfo && groupInfo.belongs_to && (!groupInfo.belongs_to.toLowerCase().includes('_top_'))) {\n return groupInfo.belongs_to;\n }\n else {\n return false;\n }\n };\n\n // const autoFocus = (element) => element?.focus();\n\n var rowsDisplayed;\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n const handleChangeActivityFilter = event => {\n setActivityFilter(event.target.value);\n setLowerFilter(event.target.value.toLowerCase());\n };\n\n function OKtoShow(inObj) {\n if (!lower_activity_filter) { return true; }\n if (inObj.hasOwnProperty('group_name')) {\n if (inObj.group_name.toLowerCase().includes(lower_activity_filter)) {\n return true;\n }\n }\n return (inObj.group_id.toLowerCase().includes(lower_activity_filter));\n };\n\n async function selectMembers(this_group) {\n let response = {};\n let memberList = await getMemberList(this_group, state.session.client_id, { \"exclude\": false });\n for (const this_member of memberList.peopleList) {\n response[this_member.person_id] = this_member;\n }\n return response;\n }\n\n async function initialize() {\n let assignmentList = [];\n if (reactData.assignmentView && reactData.allowAssign && !reactData.assignmentList) {\n if (typeof (reactData.allowAssign) === 'string') { // string - what is listed is a group ID\n assignmentList.push(...await getGroupMembers({\n groupList: [reactData.allowAssign].flat(),\n short: true\n }));\n }\n else { // array (of objects) - what is listed is an array of group ID objects\n for (let this_row of reactData.allowAssign) {\n if (isObject(this_row)) {\n assignmentList.push(...await getGroupMembers({\n groupList: [(this_row.groups || this_row.group)].flat(),\n short: true\n }));\n }\n else {\n assignmentList.push(...await getGroupMembers({\n groupList: [this_row].flat(),\n short: true\n }));\n }\n }\n }\n if (assignmentList.length > 0) {\n assignmentList = assignmentList.sort((a, b) => {\n if (a.last_name < b.last_name) { return -1; }\n else if (a.last_name > b.last_name) { return 1; }\n else if (a.first_name < b.first_name) { return -1; }\n else { return 1; }\n });\n }\n };\n updateReactData({ assignmentList }, true);\n }\n\n React.useEffect(() => {\n initialize();\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, [pSession]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n // **************************\n\n return (\n \n {Object.keys(groupsManagedObject).length === 0\n ?\n \n \n {`No Groups to show for ${pSession.user_display_name}`}\n \n \n :\n \n \n \n \n {'Select a group from this list'}\n \n \n \n {\n updateReactData({ showQuickSearch: true }, true);\n }}\n />\n \n\n \n\n {/* LEFT SIDE */}\n \n handleDragOver(e)}\n onDrop={async (e) => {\n await handleDrop(e, {\n droppedOn: {\n levelZero: true\n }\n });\n onRefresh();\n }}\n style={AVATextStyle({\n size: 1.5,\n bold: true,\n overflow: 'visible',\n margin: { top: 1, bottom: 1 },\n })}>\n {`${state.session.client_name} Groups`}\n \n \n \n {Object.keys(groupsManagedObject).map((listEntry, listIndex) => (\n (OKtoShow(groupsManagedObject[listEntry]) &&\n \n handleDragStart(e, {\n group_id: listEntry,\n groupObj: groupsManagedObject[listEntry],\n listIndex\n })}\n onDragOver={(e) => handleDragOver(e)}\n onDrop={async (e) => {\n await handleDrop(e, {\n droppedOn: {\n group_id: listEntry,\n groupObj: groupsManagedObject[listEntry],\n listIndex\n }\n });\n onRefresh();\n }}\n onClick={async () => {\n updateReactData({\n selectedGroup_id: listEntry,\n selectedGroupRec: groupsManagedObject[listEntry],\n selectedGroupMembers: await selectMembers(listEntry),\n selectedPerson_id: false,\n selectedPersonRec: false,\n selectedPersonFirstName: false,\n selectedPersonLastName: false,\n }, true);\n }}\n onContextMenu={async (e) => {\n e.preventDefault();\n updateReactData({\n alert: {\n severity: 'info',\n title: groupsManagedObject[listEntry].group_name,\n message:
    \n Group ID: {listEntry}
    \n }\n }, true);\n }}\n >\n \n {groupsManagedObject[listEntry].group_name}\n \n
    \n
    \n )\n ))}\n \n \n handleDragOver(e)}\n onDrop={async (e) => {\n e.preventDefault();\n let draggedFrom = JSON.parse(e.dataTransfer.getData('id'));\n let sendMessage = [];\n if (draggedFrom.hasOwnProperty('personObj')) {\n sendMessage.push({\n person_id: draggedFrom.personObj.person_id,\n person_name: `${draggedFrom.personObj.name.first} ${draggedFrom.personObj.name.last}`\n });\n }\n else {\n sendMessage.push({\n group_id: draggedFrom.group_id,\n group_name: draggedFrom.groupObj.group_name\n });\n }\n updateReactData({\n sendMessage\n }, true);\n }}\n edge=\"start\"\n />\n \n\n {/* RIGHT SIDE */}\n {reactData.selectedPersonRec &&\n \n \n \n handleDragStart(e, {\n person_id: reactData.selectedPerson_id,\n personObj: reactData.selectedPersonRec,\n intent: 'person'\n })}\n style={AVATextStyle({\n size: 1.5,\n overflow: 'visible',\n bold: true,\n margin: { top: 1, bottom: 1, right: 0 },\n })}>\n {`${reactData.selectedPersonFirstName} ${reactData.selectedPersonLastName.trim()}'${reactData.selectedPersonLastName.trim().endsWith('s') ? '' : 's'} Groups`}\n \n \n {\n updateReactData({\n viewPeopleMaintenance: reactData.selectedPerson_id\n }, true);\n }}\n >\n handleDragStart(e, {\n person_id: reactData.selectedPerson_id,\n personObj: reactData.selectedPersonRec,\n intent: 'person'\n })}\n className={classes.myImageArea}\n alt={''}\n onError={onImageError}\n src={getImage(reactData.selectedPerson_id)}\n />\n \n \n \n \n \n {Object.keys(groupsManagedObject).map((this_group, gX) => (\n reactData.selectedPersonRec.groups.includes(this_group) &&\n {\n updateReactData({\n selectedGroup_id: this_group,\n selectedGroupRec: groupsManagedObject[this_group],\n selectedGroupMembers: await selectMembers(this_group),\n selectedPerson_id: false,\n selectedPersonRec: false,\n selectedPersonFirstName: false,\n selectedPersonLastName: false,\n }, true);\n }}\n draggable={pSession?.adminAccount}\n onDragStart={(e) => handleDragStart(e, {\n personGroup: this_group,\n personObj: reactData.selectedPersonRec,\n intent: 'group'\n })}\n >\n {groupsManagedObject[this_group].group_name}\n \n ))}\n \n \n {reactData.administrative_account &&\n handleDragOver(e)}\n onDrop={async (e) => {\n await handleDrop_removeGroup(e);\n onRefresh();\n }}\n edge=\"start\"\n />\n }\n \n }\n {reactData.selectedGroupRec &&\n \n \n {`${reactData.selectedGroupRec.group_name} Members`}\n \n \n \n {reactData.selectedGroupMembers && Object.keys(reactData.selectedGroupMembers).sort((a, b) => {\n if (reactData.selectedGroupMembers[a].name.last === reactData.selectedGroupMembers[b].name.last) {\n return (reactData.selectedGroupMembers[a].name.first > reactData.selectedGroupMembers[b].name.first) ? 1 : -1;\n }\n else {\n return (reactData.selectedGroupMembers[a].name.last > reactData.selectedGroupMembers[b].name.last) ? 1 : -1;\n }\n }).map((this_person, cX) => (\n {\n updateReactData({\n viewPeopleMaintenance: this_person\n }, true);\n }}\n draggable={pSession?.adminAccount}\n onDragStart={(e) => handleDragStart(e, {\n personGroup: reactData.selectedGroup_id,\n personObj: reactData.selectedGroupMembers[this_person],\n intent: 'person'\n })}\n >\n {`${reactData.selectedGroupMembers[this_person].name.first} ${reactData.selectedGroupMembers[this_person].name.last}`}\n \n ))}\n \n \n {reactData.administrative_account &&\n handleDragOver(e)}\n onDrop={async (e) => {\n await handleDrop_removePerson(e);\n onRefresh();\n }}\n edge=\"start\"\n />\n }\n \n }\n \n\n \n }\n {reactData.showQuickSearch &&\n {\n if (selections && (selections.length > 0)) {\n updateReactData({\n showQuickSearch: false,\n selectedGroup_id: false,\n selectedGroupRec: false,\n seletedGroupMembers: false,\n selectedPerson_id: selections[0].person_id,\n selectedPersonRec: await getPerson(selections[0].person_id, '*all', true),\n selectedPersonFirstName: selections[0].person_firstName,\n selectedPersonLastName: selections[0].person_lastName,\n }, true);\n }\n else {\n updateReactData({\n showQuickSearch: false,\n }, true);\n }\n }}\n />\n }\n {reactData.sendMessage &&\n {\n updateReactData({\n sendMessage: false\n }, true);\n }}\n options={{\n newMessage: true,\n recipients: reactData.sendMessage\n }}\n />\n }\n {reactData.viewPeopleMaintenance &&\n {\n updateReactData({\n viewPeopleMaintenance: false,\n selectedGroupMembers: await selectMembers(reactData.selectedGroup_id)\n }, true);\n }}\n />\n }\n {promptForName &&\n { setPromptForName(false); }}\n onSave={async (newGroupName) => {\n setPromptForName(false);\n const newGroupID = await createNewGroup({\n client_id: pSession.client_id,\n group_name: newGroupName,\n adminList: pSession.patient_id,\n memberList: []\n });\n onRefresh({\n newGroupID,\n newGroupName\n });\n }}\n />\n }\n {!promptForName && (rowsDisplayed === 0) &&\n \n \n {!lower_activity_filter ? 'This Group has no members' : 'No members match that filter'}\n \n \n }\n \n }\n onClick={() => {\n onCancel();\n }}\n >\n {'Done'}\n \n {pSession?.adminAccount &&\n {\n setPromptForName(true);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n startIcon={}\n >\n {`New Group`}\n \n }\n \n {reactData.alert &&\n {\n updateReactData({\n alert: false\n }, true);\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center'\n }}\n >\n \n {([reactData.alert.action].flat()).map((this_action, actionNdx) => (\n this_action.function()}\n >\n {this_action.text}\n \n ))}\n \n : null\n )}\n variant='filled'\n onClose={() => {\n updateReactData({\n alert: false\n }, true);\n }}\n >\n {reactData.alert.title && {reactData.alert.title}}\n {reactData.alert.message}\n \n \n }\n \n );\n};\n","import React from 'react';\nimport { useSnackbar } from 'notistack';\nimport { getAllGroups, getGroup, getRole } from '../../util/AVAGroups';\n\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport Slide from '@material-ui/core/Slide';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport Typography from '@material-ui/core/Typography';\n\nimport GroupForm from '../forms/GroupForm';\nimport GroupFilter from '../forms/GroupFilter';\nimport GroupControl from '../forms/GroupControl';\nimport { makeArray, deepCopy } from '../../util/AVAUtilities';\n\nimport useSession from '../../hooks/useSession';\n\nconst useStyles = makeStyles(theme => ({\n formControl: {\n marginTop: theme.spacing(4),\n marginBottom: theme.spacing(2),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n paddingTop: 3,\n },\n pageHead: {\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n subDescriptionText: {\n marginLeft: theme.spacing(3),\n marginTop: theme.spacing(3),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n },\n freeInput: {\n marginLeft: 0,\n paddingLeft: 0,\n paddingRight: 0,\n verticalAlign: 'middle',\n minHeight: theme.typography.fontSize * 2.8,\n },\n dialogBox: {\n minWidth: '100%',\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n load: {\n backgroundColor: theme.palette.warning[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n}));\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ options, defaults, onClose, onAbort }) => {\n\n let { pSession, pGroup_id, pGroup_name, peopleList, showList, safeMode } = options;\n\n const [reactData, setReactData] = React.useState({\n groupMemberList: [],\n groupsManagedObject: [],\n showGroupSelect: false,\n safeMode: safeMode || false,\n groupName: pGroup_name,\n groupID: '',\n groupRole: '',\n groupRec: {},\n progressMessage: 'Building Group List',\n building: 'not started',\n updatesMade: false,\n newGroups: {}\n });\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n const { state } = useSession();\n const classes = useStyles();\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n const { enqueueSnackbar } = useSnackbar();\n\n async function getGroupMemberList(pGroupArray) {\n updateReactData({\n progressMessage: 'Getting accounts',\n building: 'in process'\n }, true);\n let memberInfo;\n let groupList = {};\n let tClient, tGroup;\n let peopleList = [];\n pGroupArray.forEach(this_group => {\n if (this_group.includes('//')) {\n [tClient, tGroup] = this_group.split('//');\n }\n else {\n tClient = state.session.client_id;\n tGroup = this_group;\n }\n if (!groupList.hasOwnProperty(tClient)) {\n groupList[tClient] = [];\n }\n groupList[tClient].push(tGroup);\n });\n if ((state.hasOwnProperty('accessList') && state.accessList[state.session.client_id])) {\n Object.keys(groupList).forEach(this_client => {\n if (groupList[this_client].includes('*all') || (this_client !== state.session.client_id)) {\n let thisList = state.accessList?.[this_client]?.list || ((this_client === state.session.client_id) ? state.session.last_state.list : []);\n peopleList = peopleList.concat(thisList);\n }\n else {\n let newPeople = [];\n if (reactData.newGroups) {\n for (const this_group of groupList[this_client]) {\n if (reactData.newGroups.hasOwnProperty(this_group)) {\n newPeople.push(...reactData.newGroups[this_group]);\n }\n }\n }\n peopleList = peopleList\n .concat(state.accessList?.[this_client]?.list || ((this_client === state.session.client_id)\n ? state.session.last_state.list\n : [])).filter((p, pX) => {\n return makeArray(p.groups).some(g => {\n return groupList[this_client].includes(g) || newPeople.includes(p.person_id);\n });\n });\n }\n });\n memberInfo = { peopleList };\n }\n else {\n enqueueSnackbar(`AVA is still loading. Wait just a moment and try again, please.`, { variant: 'warning' });\n onAbort();\n return [];\n }\n let reactUpdater = {};\n if (memberInfo.peopleList.length === 0) {\n enqueueSnackbar(`Nobody found for you to view.`, { variant: 'error' });\n }\n reactUpdater.groupMemberList = deepCopy(memberInfo.peopleList);\n if (pGroupArray.length === 1) {\n if (pGroupArray[0] === '*all') {\n reactUpdater.groupID = '*all';\n reactUpdater.groupRole = 'responsible';\n }\n else if (pGroupArray[0] === '*viewAll') {\n reactUpdater.groupID = '*all';\n reactUpdater.groupRole = 'member';\n }\n else {\n reactUpdater.groupRec = await getGroup(pGroupArray[0], pSession.client_id);\n reactUpdater.groupID = reactUpdater.groupRec.group_id;\n if (reactData.groupsManagedObject[reactData.groupRec.name]) {\n reactUpdater.groupRole = reactData.groupsManagedObject[reactData.groupRec.name].role;\n }\n else {\n let resp = await getRole(reactUpdater.groupRec.group_id, pSession.patient_id);\n reactUpdater.groupRole = resp;\n }\n }\n }\n else {\n reactUpdater.groupRec = {};\n reactUpdater.groupID = [...pGroupArray];\n reactUpdater.groupRole = '';\n }\n reactUpdater.progressMessage = 'Complete!';\n reactUpdater.building = 'done';\n updateReactData(reactUpdater, true);\n return memberInfo.peopleList;\n };\n\n\n const prepareGroupObject = async (pGroupList) => {\n let selectAll = pGroupList.includes('*all');\n let selectOpen = pGroupList.includes('*all_open') || pGroupList.includes('*all_public');\n let selectPrivate = pGroupList.includes('*all_closed') || pGroupList.includes('*all_private');\n const selectMine = !pGroupList || (pGroupList.length === 0) || (pGroupList.includes('*user'));\n let allGroups = await getAllGroups(state.session.person_id, state.session.client_id);\n let gList = allGroups.adminHierarchy;\n let response = {};\n for (let x = 0; x < gList.length; x++) {\n let g = gList[x];\n if ((g.level > 0)\n && (selectAll\n || selectMine\n || pGroupList.includes(g.id)\n || pGroupList.includes(g.belongs_to)\n || pGroupList.includes('*responsible'))\n ) {\n const foundGroup = state.groups.belongsTo[g.id];\n let my_role;\n if (foundGroup) {\n my_role = foundGroup.role;\n }\n else {\n my_role = await getRole(g.id, state.session.person_id);\n }\n if (pGroupList.includes('*responsible') && (my_role !== 'responsible')) {\n continue;\n }\n if (!selectMine || (my_role !== 'non-member')) {\n response[g.id] = {\n group_name: g.name,\n group_type: 'admin',\n group_id: g.id,\n role: my_role,\n level: g.level\n };\n if (!pGroupList.includes(g.id)) {\n pGroupList.push(g.id);\n }\n }\n }\n };\n for (let gID in state.groups.publicGroups) {\n if (selectAll || pGroupList.includes(gID) || selectOpen) {\n response[gID] = {\n group_name: state.groups.publicGroups[gID].group_name,\n group_id: gID,\n group_type: 'public',\n role: state.groups.publicGroups[gID].role,\n level: 0\n };\n }\n };\n for (let gID in state.groups.privateGroups) {\n if (selectAll || pGroupList.includes(gID) || selectPrivate) {\n response[gID] = {\n group_name: state.groups.privateGroups[gID].group_name,\n group_id: gID,\n group_type: 'private',\n role: state.groups.privateGroups[gID].role,\n level: 0\n };\n }\n };\n return response;\n };\n\n const handleAbort = async (updatesMade) => {\n onClose(updatesMade);\n };\n\n async function prepare() {\n let reactUpdater = {};\n let groupList = makeArray(pGroup_id, /[~,;]/);\n if (groupList && groupList.length > 0) {\n reactUpdater.groupList = groupList;\n if (showList === 'select') {\n if (!state.groups || !state.groups.adminHierarchy || !state.groups.belongsTo) {\n enqueueSnackbar(`AVA is still loading. Wait just a moment and try again, please.`, { variant: 'warning' });\n onAbort();\n return;\n }\n else {\n reactUpdater.groupsManagedObject = await prepareGroupObject(groupList);\n reactUpdater.showGroupSelect = true;\n reactUpdater.building = 'done';\n }\n }\n else {\n if (!state.accessList || !state.accessList.hasOwnProperty(state.session.client_id)) {\n enqueueSnackbar(`AVA is still loading. Wait just a moment and try again, please.`, { variant: 'warning' });\n onAbort();\n return;\n }\n else {\n let mbrList = await getGroupMemberList(makeArray(pGroup_id, /[~,;]/));\n reactUpdater.showGroupSelect = (mbrList.length === 0);\n }\n }\n }\n else {\n // reactUpdater.groupsManagedObject = state.groups.belongsTo;\n reactUpdater.groupsManagedObject = await prepareGroupObject(groupList);\n reactUpdater.showGroupSelect = true;\n reactUpdater.building = 'done';\n }\n updateReactData(reactUpdater, true);\n }\n\n\n // **************************\n\n React.useEffect(() => {\n prepare();\n }, [pSession]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n return (\n (showList && (forceRedisplay || true) &&\n {\n handleAbort(reactData.updatesMade);\n }}\n TransitionComponent={Transition}\n className={classes.pageHead}\n fullScreen\n >\n \n \n {reactData.groupName || 'Group Maintenance'}\n \n \n \n {!reactData.showGroupSelect && (reactData.building === 'done') &&\n {\n if (pGroup_id && (showList !== 'select')) {\n handleAbort(updatesMade);\n }\n else {\n let reactUpdater = {\n showGroupSelect: true,\n groupMemberList: [],\n };\n if (updatesMade) {\n reactUpdater.updatesMade = true;\n if (newGroupID) {\n reactData.newGroups[newGroupID] = newMemberList;\n let foundIndex = state.groups.adminHierarchy.findIndex(soughtGroup => {\n return (soughtGroup.id === reactData.groupID);\n });\n let this_index = foundIndex + 1;\n state.groups.adminHierarchy.splice(this_index, 0, {\n belongs_to: reactData.groupID,\n id: newGroupID,\n level: state.groups.adminHierarchy[foundIndex].level + 1,\n name: newGroupName,\n selectable: false\n });\n let groupList = makeArray(pGroup_id, /[~,;]/);\n groupList.push(newGroupID);\n let gMObj = await prepareGroupObject(groupList);\n updateReactData({\n groupsManagedObject: gMObj,\n showGroupSelect: true,\n selectedIndex: foundIndex\n }, true);\n }\n setForceRedisplay(!forceRedisplay);\n }\n updateReactData(reactUpdater, true);\n }\n }}\n />\n }\n \n {reactData.showGroupSelect && !options.groupManagement && (reactData.building === 'done') &&\n {\n updateReactData({\n showGroupSelect: false\n }, true);\n onClose(reactData.updatesMade);\n }}\n onSelect={async (selectedGroup, selectedIndex) => {\n updateReactData({\n selectedIndex: selectedIndex,\n showGroupSelect: false,\n groupName: reactData.groupsManagedObject[selectedGroup].group_name,\n groupID: reactData.groupsManagedObject[selectedGroup].group_id,\n groupRole: reactData.groupsManagedObject[selectedGroup].role\n }, false);\n await getGroupMemberList([reactData.groupsManagedObject[selectedGroup].group_id]);\n setForceRedisplay(!forceRedisplay);\n }}\n onRefresh={async (responseObj) => {\n let { newGroupID, newGroupName } = responseObj || { newGroupID: false, newGroupName: false };\n let reactUpdObj = { showGroupSelect: true };\n let groupList = makeArray(pGroup_id, /[~,;]/);\n if (newGroupID) {\n let newGroupObj = {\n group_name: newGroupName,\n group_id: newGroupID,\n role: 'responsible'\n };\n reactData.groupsManagedObject[newGroupID] = newGroupObj;\n state.groups.publicGroups[newGroupID] = newGroupObj;\n reactUpdObj.groupsManagedObject = reactData.groupsManagedObject;\n reactUpdObj.selectedIndex = Object.keys(reactData.groupsManagedObject).length - 1;\n groupList.push(newGroupID);\n }\n reactUpdObj.groupsManagedObject = await prepareGroupObject(groupList);\n updateReactData(reactUpdObj, true);\n }}\n >\n \n }\n {reactData.showGroupSelect && options.groupManagement && (reactData.building === 'done') &&\n {\n updateReactData({\n showGroupSelect: false\n }, true);\n onClose(reactData.updatesMade);\n }}\n onSelect={async (selectedGroup, selectedIndex) => {\n updateReactData({\n selectedIndex: selectedIndex,\n showGroupSelect: false,\n groupName: reactData.groupsManagedObject[selectedGroup].group_name,\n groupID: reactData.groupsManagedObject[selectedGroup].group_id,\n groupRole: reactData.groupsManagedObject[selectedGroup].role\n }, false);\n await getGroupMemberList([reactData.groupsManagedObject[selectedGroup].group_id]);\n setForceRedisplay(!forceRedisplay);\n }}\n onRefresh={async (responseObj) => {\n let { newGroupID, newGroupName } = responseObj || { newGroupID: false, newGroupName: false };\n let reactUpdObj = { showGroupSelect: true };\n let groupList = makeArray(pGroup_id, /[~,;]/);\n if (newGroupID) {\n let newGroupObj = {\n group_name: newGroupName,\n group_id: newGroupID,\n role: 'responsible'\n };\n reactData.groupsManagedObject[newGroupID] = newGroupObj;\n state.groups.publicGroups[newGroupID] = newGroupObj;\n reactUpdObj.groupsManagedObject = reactData.groupsManagedObject;\n reactUpdObj.selectedIndex = Object.keys(reactData.groupsManagedObject).length - 1;\n groupList.push(newGroupID);\n }\n reactUpdObj.groupsManagedObject = await prepareGroupObject(groupList);\n updateReactData(reactUpdObj, true);\n }}\n >\n \n }\n\n \n )\n );\n};\n","import React from 'react';\nimport { updateDb, makeArray } from '../../util/AVAUtilities';\nimport { makeName } from '../../util/AVAPeople';\nimport useSession from '../../hooks/useSession';\nimport AVAConfirm from '../forms/AVAConfirm';\n\nimport Dialog from '@material-ui/core/Dialog';\n\n\nexport default ({ defaults, onClose }) => {\n\n // Constants and React state variables\n const { state } = useSession();\n let defaultValues = {};\n makeArray(defaults).forEach(d => {\n defaultValues = Object.assign(defaultValues, d);\n })\n const [mode, setMode] = React.useState(defaultValues.options.mode);\n \n if (mode === 'newSubscription') {\n return (\n \n {\n window.open(defaultValues.options.link || 'https://buy.stripe.com/3cs5lzbSS9RXecwcMN', 'AVA Subscription');\n setMode('checkSubscription'); \n }}\n />\n \n );\n }\n else if (mode === 'checkSubscription') {\n return (\n \n {\n setMode('end');\n onClose();\n }}\n onConfirm={async () => {\n let respID = makeArray(state.session.responsible_for)[0];\n let respName = await makeName(respID);\n await updateDb(\n [\n {\n \"table\": \"People\",\n \"key\": { \"person_id\": state.session.patient_id },\n \"data\": {\n \"clients\": [\n {\n \"groups\": [\n \"friends&family\",\n \"ALL\",\n \"_TOP_\"\n ],\n \"id\": state.session.client_id\n }\n ],\n \"groups\": [\n \"friends&family\",\n \"ALL\",\n \"_TOP_\"\n ]\n }\n },\n {\n \"table\": \"SessionsV2\",\n \"key\": { \"session_id\": state.session.patient_id },\n \"data\": {\n \"assigned_to\": \"friends&family\",\n \"subscription_status\": \"pending\",\n \"patient_id\": respID,\n \"patient_display_name\": respName,\n\n }\n }\n ]\n );\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }}\n />\n \n );\n }\n else if (mode === 'cancelSubscription') {\n return (\n \n {\n setMode('end');\n onClose();\n }}\n onConfirm={async () => {\n await updateDb(\n [\n {\n \"table\": \"People\",\n \"key\": { \"person_id\": state.session.person_id },\n \"data\": {\n \"clients\": [\n {\n \"groups\": [\n \"friends&family_pending\"\n ],\n \"id\": \"AVA_Demo\"\n }\n ],\n \"groups\": [\n \"friends&family_pending\"\n ]\n }\n },\n {\n \"table\": \"SessionsV2\",\n \"key\": { \"session_id\": state.session.person_id },\n \"data\": {\n \"assigned_to\": \"friends&family_pending\",\n \"subscription_status\": \"cancelled\"\n }\n }\n ]\n );\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }}\n />\n \n );\n }\n};\n","import React from 'react';\nimport TextField from '@material-ui/core/TextField';\n\nexport default ({ open, label, value, message, onChange, onError }) => {\n React.useEffect(() => {\n if (!open) {\n onError(false);\n }\n }, [open, onError]);\n\n React.useEffect(() => {\n if (!value || value === '') {\n onError(true);\n } else {\n onError(false);\n }\n }, [value, onError]);\n\n return (\n \n );\n};\n","import React from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport TextField from '@material-ui/core/TextField';\n\nexport default ({ open, labelOne, labelTwo, value, message, onChange, onError }) => {\n const [errorOne, setErrorOne] = React.useState(false);\n const [errorTwo, setErrorTwo] = React.useState(false);\n\n React.useEffect(() => {\n if (!open) {\n setErrorOne(false);\n setErrorTwo(false);\n onError(false);\n }\n }, [open, onError]);\n\n React.useEffect(() => {\n if (!value || value[0] === '' || value[1] === '') {\n onError(true);\n switch (value[0]) {\n case '': {\n setErrorOne(true);\n break;\n }\n default: {\n setErrorOne(false);\n }\n }\n switch (value[1]) {\n case '': {\n setErrorTwo(true);\n break;\n }\n default: {\n setErrorTwo(false);\n }\n }\n } else {\n onError(errorTwo);\n setErrorOne(false);\n onError(errorOne);\n setErrorTwo(false);\n }\n }, [value, errorOne, errorTwo, onError]);\n\n return (\n \n \n \n \n \n \n \n \n );\n};\n","import React from 'react';\nimport TextField from '@material-ui/core/TextField';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nconst useStyles = makeStyles(theme => ({\n freeInput: {\n marginLeft: 0,\n marginTop: '50px',\n marginBottom: '10px',\n paddingLeft: 0,\n paddingRight: 0,\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n minHeight: theme.typography.fontSize * 2.8,\n }\n}));\n\n\nexport default ({ open, label, value, message, onChange, onKeyPress, onError }) => {\n //const keyWords = ['.org', 'org/', 'com/', '.com', 'http', '.mp', '.doc', '.pdf'];\n\n const classes = useStyles();\n\n React.useEffect(() => {\n if (!open) {\n onError(false);\n }\n }, [open, onError]);\n\n React.useEffect(() => {\n if (!value || value === '') {\n onError(true);\n } else {\n onError(false);\n }\n }, [value, onError]);\n\n return (\n \n );\n\n};\n","import React from 'react';\nimport { Box, Typography, TextField, Button, Avatar, Switch } from '@material-ui/core/';\n\nimport { AVATextStyle } from '../../util/AVAStyles';\nimport { AVAclasses } from '../../util/AVAStyles';\nimport AVAUploadFile from '../../util/AVAUploadFile';\n\nimport CloudUploadIcon from '@material-ui/icons/CloudUpload';\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle';\n\nexport default ({ currentValues, reactData, updateReactData, updateField }) => {\n\n const AVAClass = AVAclasses();\n let localColor = currentValues.customizationRecs?.client_style?.customization_value?.backgroundColor;\n\n return (\n \n \n {\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'client_name.customization_value',\n newData: event.target.value\n }]\n });\n }}\n defaultValue={currentValues.customizationRecs.client_name?.customization_value || ''}\n helperText='Client Name'\n />\n \n \n \n {'Background Image'}\n \n \n \n \n {\n updateReactData({\n getBackgroundImage: true\n }, true);\n }}\n >\n \n \n {'Upload a new Image'}\n \n \n \n \n \n \n \n {'Background Color'}\n \n \n {'Tap the color box to pick a new color; tap the check to select'}\n \n \n {\n localColor = event.target.value;\n }}\n />\n {\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'client_style.customization_value.backgroundColor',\n newData: localColor\n }]\n });\n }}\n size='small'\n />\n \n \n \n \n {'Logo'}\n \n \n {\n updateReactData({\n getLogo: true\n }, true);\n }}\n >\n \n \n {'Upload a new Logo'}\n \n \n \n \n \n\n\n\n\n\n\n\n \n {'UI style'}\n \n \n \n {'Menu'}\n \n {\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'client_style.customization_value.ui_tiles',\n newData: !currentValues.customizationRecs.client_style.customization_value.ui_tiles\n }]\n });\n }}\n name=\"UIStyle\"\n color=\"primary\"\n />\n \n {'Tiles'}\n \n \n\n\n\n\n\n \n {'People Maintenance version'}\n \n \n \n {'Legacy'}\n \n {\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'useOldVersion',\n newData: {\n client_id: currentValues.customizationRecs.client_name.client_id,\n custom_key: 'useOldVersion',\n customization_value: !currentValues.customizationRecs.useOldVersion?.customization_value\n }\n }]\n });\n }}\n name=\"UIStyle\"\n color=\"primary\"\n />\n \n {'New'}\n \n \n\n\n\n\n\n \n {'Messaging Version'}\n \n \n \n {'Legacy Allowed'}\n \n {\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'client_style.customization_value.allow_old_messaging',\n newData: !currentValues.customizationRecs.client_style.customization_value.allow_old_messaging\n }]\n });\n }}\n name=\"MessagingStyle\"\n color=\"primary\"\n />\n \n {'New Required'}\n \n \n \n\n\n\n \n {'Mandatory Passwords'}\n \n \n \n {'Passwords Optional'}\n \n {\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'client_style.customization_value.mandatory_passwords',\n newData: !currentValues.customizationRecs.client_style.customization_value.mandatory_passwords\n }]\n });\n }}\n name=\"MessagingStyle\"\n color=\"primary\"\n />\n \n {'Password Mandatory'}\n \n \n\n\n\n\n\n \n \n {`Client ID: ${currentValues.customizationRecs.client_name.client_id}`}\n \n \n {\n reactData.getBackgroundImage &&\n {\n updateReactData({\n getBackgroundImage: false\n }, true);\n }}\n onLoad={async (response) => {\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'client_style.customization_value.checkin_image',\n newData: response[0].fLoc\n }],\n reactUpd: {\n getBackgroundImage: false\n }\n });\n }}\n />\n }\n {\n reactData.getLogo &&\n {\n updateReactData({\n getLogo: false\n }, true);\n }}\n onLoad={async (response) => {\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'logo.icon',\n newData: response[0].fLoc\n },\n {\n tableName: 'customizationRecs',\n fieldName: 'logo.customization_value',\n newData: response[0].fLoc\n }],\n reactUpd: {\n getLogo: false\n }\n });\n }}\n />\n }\n \n );\n};\n","import React from 'react';\nimport { titleCase, sentenceCase, dbClient, cl, recordExists, isObject, listFromArray } from '../../util/AVAUtilities';\nimport QuickSearch from '../sections/QuickSearch';\n\nimport { Typography } from '@material-ui/core';\nimport TextField from '@material-ui/core/TextField';\n\nimport Box from '@material-ui/core/Box';\nimport EditIcon from '@material-ui/icons/Edit';\nimport LinkIcon from '@material-ui/icons/Link';\nimport SaveIcon from '@material-ui/icons/Save';\nimport CancelIcon from '@material-ui/icons/Cancel';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport AVAConfirm from '../forms/AVAConfirm';\n\nimport { AVATextStyle } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n fontWeight: 'bold'\n },\n subDescriptionText: {\n marginLeft: theme.spacing(3),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n },\n freeInput: {\n width: '100%',\n marginLeft: 0,\n marginBottom: '10px',\n marginRight: '32px',\n paddingLeft: 0,\n paddingRight: 0,\n verticalAlign: 'middle',\n minHeight: theme.typography.fontSize * 2.8,\n },\n editInput: {\n width: '100%',\n color: 'black',\n marginLeft: 0,\n marginRight: '8px',\n paddingLeft: 0,\n paddingRight: 0,\n minHeight: theme.typography.fontSize * 2.8,\n },\n rowButton: {\n marginRight: theme.spacing(1),\n fontSize: '1rem',\n marginBottom: theme.spacing(1),\n },\n rowButtonGreen: {\n marginRight: theme.spacing(1),\n fontSize: '1rem',\n marginBottom: theme.spacing(1),\n color: 'green'\n },\n inputDisplay: {\n '&.Mui-disabled': {\n color: 'black'\n },\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.reject[theme.palette.type],\n },\n dialogBox: {\n paddingTop: 0,\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n overflowX: 'auto',\n // overflowY: 'hidden'\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n load: {\n backgroundColor: theme.palette.warning[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n}));\n\nexport default ({ pGroup = 'ALL', reactData, updateReactData, currentValues }) => {\n\n var rowsWritten;\n\n const isMounted = React.useRef(false);\n const classes = useStyles();\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n\n\n async function onCheckEnter(event, section_name, ndx = 'new') {\n if (event.key === 'Enter') {\n await saveNewTitle(section_name, ndx);\n }\n };\n\n const handleDragStart = (ev, id) => {\n ev.dataTransfer.setData('id', JSON.stringify(id));\n };\n\n const handleDragOver = (ev) => {\n ev.preventDefault();\n };\n\n const handleDrop = async (ev, { droppedOn }) => {\n ev.preventDefault();\n let dragged_id = JSON.parse(ev.dataTransfer.getData('id'));\n let draggedFromIndex = (reactData.bBoardList[dragged_id.group][dragged_id.section_name].generic_activities_list[dragged_id.aNdx]).group_list_index;\n let droppedOnIndex = (reactData.bBoardList[droppedOn.group][droppedOn.section_name].generic_activities_list[droppedOn.aNdx]).group_list_index;\n // add draggedfrom from before droppedon\n // - this will change the position of everything after droppedon\n // - to remove the dragged from: \n // if it's position was LESS THAN droppedon, remove it in place\n // if it's position was GREATER THAN droppedon, add one and then remove it\n let entryToAdd = reactData.bBoardList[dragged_id.group].groupRec.common_activities[draggedFromIndex];\n reactData.bBoardList[dragged_id.group].groupRec.common_activities.splice(droppedOnIndex, 0, entryToAdd);\n if (draggedFromIndex > droppedOnIndex) {\n draggedFromIndex++;\n }\n reactData.bBoardList[dragged_id.group].groupRec.common_activities.splice(draggedFromIndex, 1);\n await dbClient\n .update({\n Key: {\n client_id: currentValues.customizationRecs.client_name.client_id,\n group_id: reactData.group_id\n },\n UpdateExpression: 'set #c = :c',\n ExpressionAttributeValues: {\n ':c': reactData.bBoardList[reactData.group_id].groupRec.common_activities\n },\n ExpressionAttributeNames: {\n '#c': 'common_activities'\n },\n TableName: \"Groups\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Group; error is: `, error);\n });\n let response = await setBBoard();\n updateReactData({\n bBoardList: response,\n changesMade: true\n }, true);\n };\n\n\n const handleChangeTextInput = (inputValue, section_name, ndx = 'new') => {\n if (!reactData.textInput.hasOwnProperty(section_name)) {\n reactData.textInput[section_name] = [];\n }\n if (inputValue.length === 1) {\n inputValue = inputValue.toUpperCase();\n }\n reactData.textInput[section_name][ndx] = inputValue;\n updateReactData({\n isError: false,\n textInput: reactData.textInput\n }, true);\n };\n\n async function saveNewTitle(section_name, ndx = 'new') {\n if (ndx !== 'new') {\n let rowObj = reactData.bBoardList[reactData.group_id][section_name].generic_activities_list[ndx];\n reactData.bBoardList[reactData.group_id][section_name].generic_activities_list[ndx].title = reactData.textInput[section_name][ndx];\n let updateObj = {\n activity_code: 'form.make_message',\n default: {\n recipientID: [reactData.bBoardList[reactData.group_id][section_name].generic_activities_list[ndx].recipient_id].flat(),\n recipientName: [reactData.bBoardList[reactData.group_id][section_name].generic_activities_list[ndx].recipient_name].flat(),\n },\n title: reactData.textInput[section_name][ndx],\n };\n reactData.bBoardList[reactData.group_id].groupRec.common_activities[rowObj.group_list_index] = updateObj;\n await dbClient\n .update({\n Key: {\n client_id: currentValues.customizationRecs.client_name.client_id,\n group_id: reactData.group_id\n },\n UpdateExpression: 'set #c = :c',\n ExpressionAttributeValues: {\n ':c': reactData.bBoardList[reactData.group_id].groupRec.common_activities\n },\n ExpressionAttributeNames: {\n '#c': 'common_activities'\n },\n TableName: \"Groups\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Group; error is: `, error);\n });\n reactData.editMode[section_name][ndx] = false;\n updateReactData({\n bBoardList: reactData.bBoardList,\n editMode: reactData.editMode,\n changesMade: true\n }, true);\n }\n }\n\n async function setBBoard() {\n let response = await getMessageInfo(currentValues.customizationRecs.client_name.client_id, reactData.group_id);\n if (!response || (!response.hasOwnProperty(reactData.group_id))) {\n response[reactData.group_id] = {\n groupRec: {\n group_id: reactData.group_id,\n common_activities: []\n }\n };\n }\n if (Object.keys(response[reactData.group_id]).length === 1) { // the only thing there is the groupRec; no activities at all\n if (!response[reactData.group_id].groupRec.hasOwnProperty('common_activities')) {\n reactData.needsHeader = true;\n response[reactData.group_id].groupRec.common_activities = [];\n }\n if ((response[reactData.group_id].groupRec.common_activities.length === 0)\n || !response[reactData.group_id].groupRec.common_activities.some(l => {\n return ((typeof (l) === 'string') && l.startsWith('~~Messages'));\n })) {\n reactData.needsHeader = true;\n response[reactData.group_id]['Messages'] = {\n section_sort: '',\n generic_activities_list: [{\n group_list_index: 0,\n recipient_id: `ava-${currentValues.customizationRecs.client_name.client_id}`,\n recipient_name: 'AVA Support',\n title: `Send a message to AVA Support`\n }]\n };\n } \n }\n if ((response[reactData.group_id].groupRec.common_activities.length === 0)\n || !response[reactData.group_id].groupRec.common_activities.some(l => {\n return ((typeof(l) === 'string') && l.startsWith('~~AVA Support'));\n })) {\n reactData.needsHeader = true;\n response[reactData.group_id]['AVA Support'] = {\n section_sort: '',\n generic_activities_list: [{\n group_list_index: 0,\n recipient_id: `ava-${currentValues.customizationRecs.client_name.client_id}`,\n recipient_name: 'AVA Support',\n title: `Send a message to AVA Support`\n }]\n };\n }\n return response;\n }\n\n\n async function getMessageInfo(pClient, pGroup_id) {\n let response = {\n // group_id : {\n // groupRec,\n // section_name: {\n // section_sort,\n // messageList: [{\n // group_list_index, \n // recipient_id,\n // recipient_name\n // }, {}, ...]\n // }\n // }\n };\n let qQ = {\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': pClient },\n TableName: \"Groups\"\n };\n if (pGroup_id) {\n qQ.KeyConditionExpression += ' and group_id = :g';\n qQ.ExpressionAttributeValues[':g'] = pGroup_id;\n }\n let groupRecs = await dbClient\n .query(qQ)\n .promise()\n .catch(error => {\n cl(`***ERR reading Groups*** caught error is: ${error}`, qQ);\n });\n if (!recordExists(groupRecs)) {\n return {};\n }\n groupRecs.Items.forEach(groupRec => {\n let section_name = 'None';\n let section_sort = '';\n response[groupRec.group_id] = {\n groupRec\n };\n if (groupRec.common_activities && (groupRec.common_activities.length > 0)) {\n groupRec.common_activities.forEach((activity_line, aList_index) => {\n if ((typeof (activity_line) === 'string') && (activity_line.startsWith('~~'))) {\n let sectionKeys = activity_line.slice(2).split('~~');\n if (sectionKeys[1]) {\n section_name = sectionKeys[1].split('~')[0];\n section_sort = sectionKeys[0];\n }\n else {\n section_name = sectionKeys[0].split('~')[0];\n section_sort = '';\n }\n }\n else {\n let activity_name, recipient_id, recipient_name, title;\n if (isObject(activity_line)) {\n if (activity_line.hasOwnProperty('default') && activity_line.default.hasOwnProperty('recipientID')) {\n activity_name = activity_line.activity_code;\n recipient_id = activity_line.default.recipientID;\n recipient_name = activity_line.default.recipientName;\n title = activity_line.title;\n }\n }\n else {\n let parsed;\n [activity_name, ...parsed] = activity_line.split('~');\n if (activity_name === 'form.make_message') {\n parsed.forEach(spec => {\n let [split_type, split_spec] = spec.split('=');\n if (split_type.includes('default')) {\n let receipientObj = split_spec.trim().replace(/[\\]{}]/gm, '').split(',');\n for (let this_part of receipientObj) {\n let [key, value] = this_part.split(':');\n if (key === 'recipientID') {\n recipient_id = value;\n }\n else if (key === 'recipientName') {\n recipient_name = value;\n }\n }\n }\n else if (split_type.includes('title')) {\n title = split_spec.trim().replace(/[\\]{}]/gm, '');\n }\n });\n }\n }\n if (activity_name === 'form.make_message') {\n let aObj = {\n group_list_index: aList_index,\n recipient_id,\n recipient_name,\n title\n };\n if (!response.hasOwnProperty(groupRec.group_id)) {\n response[groupRec.group_id] = {\n groupRec,\n [section_name]: {\n section_sort,\n generic_activities_list: [aObj]\n }\n };\n }\n else if (!response[groupRec.group_id].hasOwnProperty(section_name)) {\n response[groupRec.group_id][section_name] = {\n section_sort,\n generic_activities_list: [aObj]\n };\n }\n else {\n response[groupRec.group_id][section_name].generic_activities_list.push(aObj);\n }\n };\n }\n });\n }\n });\n return response;\n };\n\n\n\n // **************************\n\n React.useEffect(() => {\n async function initialize() {\n let response = await setBBoard();\n updateReactData({\n bBoardList: response,\n MessagingInitialized: true\n }, true);\n }\n isMounted.current = true;\n if (!reactData.MessagingInitialized) {\n initialize();\n }\n return () => { isMounted.current = false; };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n reactData.MessagingInitialized &&\n \n \n { /* Data rows */}\n \n \n {rowsWritten = 0}\n \n {Object.keys(reactData.bBoardList[reactData.group_id]).map((section_name, groupNdx) => (\n (section_name !== 'groupRec') &&\n \n { /* Group Title - name */}\n 0) ? 8 : 0}\n justifyContent='flex-start'\n alignItems='center'\n >\n \n {section_name.toLowerCase().startsWith('submenu') ? titleCase(section_name.slice(8)) : titleCase(section_name)}\n \n \n {rowsWritten++}\n \n\n \n \n \n { /* Add row for this Section */}\n \n {\n handleChangeTextInput(event.target.value, section_name);\n }}\n onKeyPress={async (event) => {\n await onCheckEnter(event, section_name);\n }}\n autoComplete='off'\n value={(reactData.textInput.hasOwnProperty(section_name) && reactData.textInput[section_name]['new'])\n ? reactData.textInput[section_name]['new']\n : ''\n }\n />\n \n {\n let reactUpdObj = {\n selectedSection: section_name\n };\n if (!reactData.textInput.hasOwnProperty(section_name)\n || !reactData.textInput[section_name].hasOwnProperty('new')\n || reactData.textInput[section_name].new.length < 1) {\n reactUpdObj.isError = true;\n }\n else {\n reactUpdObj.isError = false;\n reactUpdObj.showQuickSearch = section_name;\n }\n updateReactData(reactUpdObj, true);\n }}\n edge=\"start\"\n />\n \n \n { /* Existing items in this Section */}\n {reactData.bBoardList[reactData.group_id][section_name].generic_activities_list.map((aData, aNdx) => (\n handleDragStart(e, { group: reactData.group_id, section_name, aData, aNdx })}\n onDragOver={(e) => handleDragOver(e)}\n onDrop={async (e) => {\n await handleDrop(e, { droppedOn: { group: reactData.group_id, section_name, aData, aNdx } });\n }}\n key={`row_box_grandparent-${aNdx}`}\n >\n \n\n {(reactData.editMode.hasOwnProperty(section_name) && reactData.editMode[section_name][aNdx])\n ?\n \n {\n reactData.editMode[section_name][aNdx] = false;\n updateReactData({\n editMode: reactData.editMode\n }, true);\n }}\n edge=\"start\"\n />\n {\n await saveNewTitle(section_name, aNdx);\n }}\n edge=\"start\"\n />\n {\n handleChangeTextInput(event.target.value, section_name, aNdx);\n }}\n onKeyPress={async (event) => {\n await onCheckEnter(event, section_name, aNdx);\n }}\n autoComplete='off'\n />\n \n :\n \n {\n if (!reactData.editMode.hasOwnProperty(section_name)) {\n reactData.editMode[section_name] = [];\n reactData.textInput[section_name] = [];\n }\n reactData.editMode[section_name][aNdx] = true;\n reactData.textInput[section_name][aNdx] = aData.title;\n updateReactData({\n editMode: reactData.editMode\n }, true);\n }}\n edge=\"start\"\n />\n {\n updateReactData({\n confirmMessage: `Are you sure you want to remove ${aData.title}?`,\n selectedObservation: aNdx,\n selectedSection: section_name,\n deletePending: true,\n spliceAt: aData.group_list_index\n }, true);\n }}\n edge=\"start\"\n />\n \n \n {aData.title}\n \n \n {listFromArray([aData.recipient_name].flat())}\n \n \n \n }\n \n \n ))\n }\n \n \n \n ))}\n \n {reactData.deletePending &&\n {\n updateReactData({\n deletePending: false\n }, true);\n }}\n onConfirm={async () => {\n reactData.bBoardList[reactData.group_id][reactData.selectedSection].generic_activities_list.splice(reactData.selectedObservation, 1);\n reactData.bBoardList[reactData.group_id].groupRec.common_activities.splice(reactData.spliceAt, 1);\n await dbClient\n .update({\n Key: {\n client_id: currentValues.customizationRecs.client_name.client_id,\n group_id: reactData.group_id\n },\n UpdateExpression: 'set #c = :c',\n ExpressionAttributeValues: {\n ':c': reactData.bBoardList[reactData.group_id].groupRec.common_activities\n },\n ExpressionAttributeNames: {\n '#c': 'common_activities'\n },\n TableName: \"Groups\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Group; error is: `, error);\n });\n let bbResponse = await setBBoard();\n updateReactData({\n bBoardList: bbResponse,\n deletePending: false,\n changesMade: true,\n spliceAt: -1\n }, true);\n }}\n >\n \n }\n {reactData.showQuickSearch &&\n {\n if (selections.length > 0) {\n let recipientList = [];\n let recipientNameList = [];\n for (const this_selection of selections) {\n recipientList.push(this_selection.person_id);\n recipientNameList.push(this_selection.person_name);\n }\n let first_entry = reactData.bBoardList[reactData.group_id][reactData.selectedSection].generic_activities_list[0].group_list_index;\n // let updatedLine = [`form.make_message~[default={recipientID:${person_id},recipientName:${person_name}]~[title=Send a message to ${sentenceCase(reactData.textInput[reactData.showQuickSearch].new)}]`];\n let updatedLine = [{\n activity_code: 'form.make_message',\n default: {\n recipientID: recipientList,\n recipientName: recipientNameList,\n },\n title: sentenceCase(reactData.textInput[reactData.showQuickSearch].new),\n }];\n if (reactData.needsHeader) {\n updatedLine.unshift(`~~${reactData.selectedSection}`);\n }\n reactData.bBoardList[reactData.group_id].groupRec.common_activities.splice(first_entry, 0, ...updatedLine);\n await dbClient\n .update({\n Key: {\n client_id: currentValues.customizationRecs.client_name.client_id,\n group_id: reactData.group_id\n },\n UpdateExpression: 'set #c = :c',\n ExpressionAttributeValues: {\n ':c': reactData.bBoardList[reactData.group_id].groupRec.common_activities\n },\n ExpressionAttributeNames: {\n '#c': 'common_activities'\n },\n TableName: \"Groups\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Group; error is: `, error);\n });\n reactData.textInput[reactData.selectedSection]['new'] = '';\n }\n let bbResponse = await setBBoard();\n updateReactData({\n bBoardList: bbResponse,\n textInput: reactData.textInput,\n addLink: false,\n showQuickSearch: false,\n needsHeader: false,\n changesMade: true\n }, true);\n }}\n />\n\n }\n \n \n );\n};\n","import React from 'react';\nimport { Box, Typography, Button } from '@material-ui/core/';\nimport { restAPI, isEmpty } from '../../util/AVAUtilities';\nimport { useGeolocated } from \"react-geolocated\";\n\nimport { AVATextStyle, AVAclasses } from '../../util/AVAStyles';\nimport TextField from '@material-ui/core/TextField';\n\nexport default ({ currentValues, reactData, updateField }) => {\n\n const AVAClass = AVAclasses();\n\n const {\n coords,\n getPosition,\n isGeolocationAvailable,\n isGeolocationEnabled,\n positionError,\n } = useGeolocated({\n positionOptions: {\n enableHighAccuracy: true,\n },\n userDecisionTimeout: 5000,\n watchLocationPermissionChange: true,\n });\n\n return (\n \n {\n let updateList =\n [{\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.latitude',\n newData: event.target.value\n }];\n if (currentValues.customizationRecs.client_weather.customization_value.longitude && event.target.value) {\n let nws_info = await restAPI({\n hostname: 'api.weather.gov',\n path: `/points/${event.target.value},${currentValues.customizationRecs.client_weather.customization_value.longitude}`,\n method: 'GET',\n headers: {\n \"User-Agent\": \"(AVASeniorConnect.com, rsteele@avaseniorconnect.com)\"\n }\n }, '');\n if (nws_info.hasOwnProperty('properties')) {\n updateList.push(...[\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.nws_office',\n newData: nws_info.properties.gridId\n },\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.nws_x',\n newData: nws_info.properties.gridX\n },\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.nws_y',\n newData: nws_info.properties.gridY\n },\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.nws_place',\n newData: `${nws_info.properties.relativeLocation?.properties?.city}, ${nws_info.properties.relativeLocation?.properties?.state}`\n }]);\n }\n }\n await updateField({ updateList });\n }}\n defaultValue={currentValues.customizationRecs.client_weather.customization_value.latitude}\n helperText='Latitude'\n />\n {\n let updateList =\n [{\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.longitude',\n newData: `-${Math.abs(Number(event.target.value))}`\n }];\n if (currentValues.customizationRecs.client_weather.customization_value.latitude && event.target.value) {\n let nws_info = await restAPI({\n hostname: 'api.weather.gov',\n path: `/points/${currentValues.customizationRecs.client_weather.customization_value.latitude},-${Math.abs(Number(event.target.value))}`,\n method: 'GET',\n headers: {\n \"User-Agent\": \"(AVASeniorConnect.com, rsteele@avaseniorconnect.com)\"\n }\n }, '');\n if (nws_info.hasOwnProperty('properties')) {\n updateList.push(...[\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.nws_office',\n newData: nws_info.properties.gridId\n },\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.nws_x',\n newData: nws_info.properties.gridX\n },\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.nws_y',\n newData: nws_info.properties.gridY\n },\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.nws_place',\n newData: `${nws_info.properties.relativeLocation?.properties?.city}, ${nws_info.properties.relativeLocation?.properties?.state}`\n }]);\n }\n }\n await updateField({ updateList });\n }}\n defaultValue={currentValues.customizationRecs.client_weather.customization_value.longitude}\n helperText='Longitude'\n />\n {\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.place_name',\n newData: event.target.value\n }]\n });\n }}\n defaultValue={currentValues.customizationRecs.client_weather.customization_value.place_name}\n helperText='Place Name'\n />\n {\n let updateList;\n getPosition();\n let newText;\n if (!isEmpty(positionError)) {\n newText = `Location Error ${JSON.stringify(positionError)}`;\n }\n else if (!isGeolocationAvailable) {\n newText = \"Device doesn't support location ID\";\n }\n else if (!isGeolocationEnabled) {\n newText = `User blocked location ID`;\n\n }\n if (newText) {\n updateList = {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.place_name',\n newData: newText\n };\n }\n else {\n updateList =\n [{\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.longitude',\n newData: ((Math.round(coords.longitude * 100)) / 100)\n },\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.latitude',\n newData: ((Math.round(coords.latitude * 100)) / 100)\n }];\n let nws_info = await restAPI({\n hostname: 'api.weather.gov',\n path: `/points/${(Math.round(coords.latitude * 100)) / 100},${(Math.round(coords.longitude * 100)) / 100}`,\n method: 'GET',\n headers: {\n \"User-Agent\": \"(AVASeniorConnect.com, rsteele@avaseniorconnect.com)\"\n }\n }, '');\n if (nws_info) {\n updateList.push(...[\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.nws_office',\n newData: nws_info.properties.gridId\n },\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.nws_x',\n newData: nws_info.properties.gridX\n },\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.nws_y',\n newData: nws_info.properties.gridY\n },\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.nws_place',\n newData: `${nws_info.properties.relativeLocation?.properties?.city}, ${nws_info.properties.relativeLocation?.properties?.state}`\n },\n {\n tableName: 'customizationRecs',\n fieldName: 'client_weather.customization_value.place_name',\n newData: `${nws_info.properties.relativeLocation?.properties?.city}, ${nws_info.properties.relativeLocation?.properties?.state}`\n }]);\n }\n }\n await updateField({ updateList });\n }}\n >\n \n {'Use my Location'}\n \n \n \n \n {`Location: ${currentValues.customizationRecs.client_weather.customization_value.nws_place}`}\n \n \n {`NWS Office: ${currentValues.customizationRecs.client_weather.customization_value.nws_office}`}\n \n \n {`NWS Grid: ${currentValues.customizationRecs.client_weather.customization_value.nws_x}/${currentValues.customizationRecs.client_weather.customization_value.nws_y}`}\n \n \n \n );\n};\n","import React from 'react';\n\nimport Typography from '@material-ui/core/Typography';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport { Box, Checkbox, IconButton, TextField, Button } from '@material-ui/core';\n\nimport QuickSearch from './QuickSearch';\n\nimport { AVATextStyle, AVAclasses } from '../../util/AVAStyles';\nimport { makeTime } from '../../util/AVADateTime';\nimport { listFromArray } from '../../util/AVAUtilities';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport ArrowDownwardIcon from '@material-ui/icons/ArrowDownward';\nimport ArrowUpwardIcon from '@material-ui/icons/ArrowUpward';\n\nexport default ({ currentValues, errorList, setError, updateField, updateReactData, reactData }) => {\n\n const AVAClass = AVAclasses();\n\n const messageOptions = [\n {\n option: 'hold',\n label: `Hold all messages - message will be sent at the end of the rule's time window`,\n exclusive: false,\n withPeopleList: false\n },\n {\n option: 'block',\n label: `Block all messages - this message will not be sent`,\n exclusive: true,\n withPeopleList: false\n },\n {\n option: 'replace_recipients',\n label: `Send to these recipients instead of the original addressee`,\n exclusive: false,\n withPeopleList: true\n },\n {\n option: 'add_recipients',\n label: `Send to these recipients in addition to the original addressee`,\n exclusive: false,\n withPeopleList: true\n },\n {\n option: 'add_replyTo',\n label: `Add these recipients to the \"reply to\" list`,\n exclusive: false,\n withPeopleList: true\n }\n ];\n\n\n function searchButtonText() {\n if (reactData.selections.length === 0) {\n return 'Exit';\n }\n if (reactData.selections.length > 1) {\n return `Select ${reactData.selections.reduce((total, this_selection) => {\n return (this_selection.peopleList ? (total + this_selection.peopleList.length) : (total + 1));\n }, 0)} people`;\n }\n // options below if only one item selected\n if (reactData.selections[0].hasOwnProperty('person_id')) {\n return `Select ${reactData.selections[0].person_name.split(' ')[0]}`;\n }\n else {\n return `Select`;\n }\n }\n\n function groupButtonText() {\n if (reactData.selections.length === 0) {\n return 'Exit';\n }\n if (reactData.selections.length > 1) {\n return `Select ${reactData.selections.length} groups`;\n }\n // options below if only one item selected\n if (reactData.selections[0].hasOwnProperty('group_id')) {\n return `Select ${reactData.selections[0].group_name}`;\n }\n else {\n return `Select`;\n }\n }\n\n return (\n \n\n \n \n {`Use Rules to set alternate delivery options based on content, urgency, time of day, and day of week`}\n \n {currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules && (currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules.length > 1) &&\n \n {`These rules will be evaluated in the order they appear below (the first one that matches \"wins\")`}\n \n }\n {\n if (!currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules = [];\n }\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules.unshift({\n name: `${currentValues.customizationRecs.client_name?.customization_value} Global Rule #${currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules.length + 1}`,\n methods: [],\n });\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n });\n }}\n className={AVAClass.AVAButton}\n style={{ marginLeft: 0, backgroundColor: 'white', color: 'black' }}\n size='small'\n >\n {'Add a Rule'}\n \n \n\n \n {currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n && currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules.map((this_rule, i) => (\n \n \n \n {!this_rule.rule_id &&\n \n {this_rule.rule_id = `${new Date().getTime()}_${i}`}\n \n }\n {!this_rule.name &&\n \n {this_rule.name = `${currentValues.customizationRecs.client_name?.customization_value} Global Rule #${i + 1}`}\n \n }\n \n \n {\n if (!currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i]) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i] = this_rule;\n }\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].name = event.target.value;\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n });\n }}\n helperText='Rule Name'\n />\n \n \n {(i < (currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules.length - 1)) &&\n {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules.splice(i, 1);\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules.splice(i + 1, 0, this_rule);\n let updateObj = {\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n };\n await updateField(updateObj);\n }}\n >\n \n \n }\n {(i > 0) &&\n {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules.splice(i, 1);\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules.splice(i - 1, 0, this_rule);\n let updateObj = {\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n };\n await updateField(updateObj);\n }}\n >\n \n \n }\n {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules.splice(i, 1);\n let updateObj = {\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n };\n let instructions = [];\n for (let errorField in errorList) {\n if (errorField.startsWith('time_based_rules__')) {\n const errorIndex = Number(errorField.split(/.*(?:_|^)(.*)/gm)[1]);\n if (errorIndex >= i) {\n instructions.unshift({\n errorField,\n isError: false\n });\n }\n if (errorIndex > i) {\n instructions.push(Object.assign({},\n errorList[errorField],\n { errorField: errorField.replace(`_${errorIndex}`, `_${errorIndex - 1}`) }\n ));\n }\n }\n }\n if (instructions.length > 0) {\n updateObj.errorObj = instructions;\n }\n await updateField(updateObj);\n }}\n >\n \n \n \n \n\n \n \n {\n let from_time = makeTime(event.target.value);\n if (from_time.error || from_time.empty) {\n // This is an error.\n setError({\n errorField: `time_based_rules__time_from_${i}`,\n errorValue: event.target.value,\n isError: true,\n errorMessage: `${event.target.value} is not valid`\n });\n return;\n }\n if (!currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i]) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i] = this_rule;\n }\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].time_from = from_time.time;\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].time_range = {\n start: from_time.numeric24,\n end: (this_rule.time_range?.end\n ? this_rule.time_range.end\n : (this_rule.time_to\n ? makeTime(this_rule.time_to).numeric24\n : 2359)\n )\n };\n let updateObj = {\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n };\n if (errorList.hasOwnProperty(`time_based_rules__time_from_${i}`)) {\n updateObj.errorObj = {\n errorField: `time_based_rules__time_from_${i}`,\n isError: false\n };\n }\n await updateField(updateObj);\n }}\n />\n {\n let to_time = makeTime(event.target.value);\n if (to_time.error || to_time.empty) {\n // This is an error.\n setError({\n errorField: `time_based_rules__time_to_${i}`,\n errorValue: event.target.value,\n isError: true,\n errorMessage: `${event.target.value} is not valid`\n });\n return;\n }\n if (!currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i]) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i] = this_rule;\n }\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].time_to = to_time.time;\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].time_range = {\n end: to_time.numeric24,\n start: (this_rule.time_range?.start\n ? this_rule.time_range.start\n : (this_rule.time_from\n ? makeTime(this_rule.time_from).numeric24\n : 0)\n )\n };\n let updateObj = {\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n };\n if (errorList.hasOwnProperty(`time_based_rules__time_to_${i}`)) {\n updateObj.errorObj = {\n errorField: `time_based_rules__time_to_${i}`,\n isError: false\n };\n }\n await updateField(updateObj);\n }}\n />\n \n \n {['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'].map((this_day, day_num) => (\n {\n if (!this_rule.day) {\n this_rule.day = '';\n }\n if (this_rule.day?.includes(day_num.toString())) {\n let s = currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].day;\n let c = day_num.toString();\n let l = s.replace(c, \"\");\n this_rule.day = l;\n }\n else {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].day += day_num.toString();\n }\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n });\n }}\n inputProps={{ 'aria-labelledby': `message_routing_${i}_${day_num}` }}\n />\n }\n label={\n \n {this_day}\n }\n labelPlacement='bottom'\n />\n ))}\n \n \n {\n if (!currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i]) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i] = this_rule;\n }\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].keyWords = event.target.value;\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n });\n }}\n helperText='During these times, only use this rule if a message contains any of these keywords'\n />\n\n\n\n \n {\n if (!currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i]) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i] = this_rule;\n }\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].when_urgent = !currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].when_urgent;\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n \n {`During these times, only use this rule if a message is marked Urgent`}\n \n \n\n \n {\n if (!currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i]) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i] = this_rule;\n }\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].when_notUrgent = !currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].when_notUrgent;\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n \n {`During these times, only use this rule if a message is NOT marked Urgent`}\n \n \n\n\n\n\n\n\n\n\n\n\n \n 0)) || false}\n onClick={async () => {\n if (!currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i]) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i] = this_rule;\n }\n if (!currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].groupList) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].groupList = [];\n }\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `groupList_checkbox_3` }}\n />\n \n \n {`Use this rule if the Addressee is a member of one of these selected Groups:`}\n \n {\n updateReactData({\n showRuleGroupsQuickSearch: true,\n showGroupList: true,\n ruleIndex: i,\n linkedPersonFilter: '',\n selections: (this_rule.groupList\n ? (this_rule.groupList.map((this_group, pX) => {\n return { group_id: this_group, group_name: this_rule.groupNames[pX] };\n }))\n : []\n )\n }, true);\n }}\n >\n {(this_rule.hasOwnProperty('groupList')\n && (this_rule.groupList.length > 0)) &&\n \n {(this_rule.groupList.length > 3)\n ? (`${this_rule.groupList.length} groups`)\n : (`${listFromArray(this_rule.groupNames, {or: true})}`)\n }\n \n }\n \n {(!this_rule.hasOwnProperty('groupList')\n || this_rule.groupList.length === 0)\n ? '(Tap here to select Groups)'\n : `(Tap here to add/change Groups)`\n }\n \n \n \n\n\n \n \n \n {`When this rule applies, the system will automatically...`}\n \n \n {messageOptions.map((this_option, tIndex) => (\n \n {\n if (!this_rule.methods) {\n this_rule.methods = [];\n }\n let optionAt = this_rule.methods.findIndex(this_method => {\n return (this_method === this_option.option);\n });\n if (optionAt === -1) {\n // wasn't there before; you must have clicked it ON\n if (this_option.exclusive) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].methods = [this_option.option];\n }\n else {\n // have to turn off any exclusive option that was previously on\n let previous_option = messageOptions.find(check_option => {\n return (this_rule.methods[0] === check_option.option);\n });\n if (previous_option && (previous_option.option === 'hold' || previous_option.exclusive)) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].methods = [this_option.option];\n }\n else {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].methods.push(this_option.option);\n }\n }\n }\n else {\n // was there before; you must have clicked it OFF\n if (this_rule.methods.length === 1) {\n // nothing is left?\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].methods = [];\n }\n else {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[i].methods.splice(optionAt, 1);\n }\n }\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }]\n });\n }}\n disableRipple\n inputProps={{ 'aria-labelledby': `message_routing_3` }}\n />\n \n \n {`${this_option.label}${this_option.enabled || ''}`}\n \n\n\n\n\n\n {this_option.withPeopleList &&\n {\n updateReactData({\n showRulesQuickSearch: true,\n ruleIndex: i,\n linkedPersonFilter: '',\n selectedOption: this_option.option,\n selections: (this_rule.hasOwnProperty(this_option.option)\n ? (this_rule[this_option.option].peopleList.map((this_person, pX) => {\n return { person_id: this_person, person_name: this_rule[this_option.option].peopleNames[pX] };\n }))\n : []\n )\n }, true);\n }}\n >\n {(this_rule.hasOwnProperty(this_option.option)\n && this_rule[this_option.option].hasOwnProperty('peopleList')\n && this_rule[this_option.option].peopleList.length > 0) &&\n \n {(this_rule[this_option.option].peopleList.length > 4)\n ? (`${this_rule[this_option.option].peopleList.length} recipients`)\n : (`${listFromArray(this_rule[this_option.option].peopleNames)}`)\n }\n \n }\n \n {(!this_rule.hasOwnProperty(this_option.option)\n || !this_rule[this_option.option].hasOwnProperty('peopleList')\n || this_rule[this_option.option].peopleList.length === 0)\n ? '(Tap here to select Recipients)'\n : `(Tap here to add/change Recipients)`\n }\n \n \n }\n \n\n\n \n ))}\n \n \n\n \n \n {`Rule ID: ${this_rule.rule_id}`}\n \n \n \n ))}\n\n\n\n {reactData.showRulesQuickSearch &&\n {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[reactData.ruleIndex][reactData.selectedOption] =\n {\n peopleList: [],\n peopleNames: []\n };\n if (selections.length > 0) {\n if (!currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[reactData.ruleIndex].hasOwnProperty('methods')) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[reactData.ruleIndex].methods = [reactData.selectedOption];\n }\n else if (!currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[reactData.ruleIndex].methods.includes(reactData.selectedOption)) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[reactData.ruleIndex].methods.push(reactData.selectedOption);\n }\n for (const this_selection of selections) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[reactData.ruleIndex][reactData.selectedOption].peopleList.push(this_selection.person_id);\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[reactData.ruleIndex][reactData.selectedOption].peopleNames.push(this_selection.person_name);\n }\n } \n \n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }],\n reactUpd: {\n showRulesQuickSearch: false,\n changesMade: true\n }\n });\n }}\n />\n }\n\n {reactData.showRuleGroupsQuickSearch &&\n {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[reactData.ruleIndex].groupList = [];\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[reactData.ruleIndex].groupNames = [];\n if (selections.length > 0) {\n for (const this_selection of selections) {\n if (this_selection.hasOwnProperty('group_id')) {\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[reactData.ruleIndex].groupList.push(this_selection.group_id);\n currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules[reactData.ruleIndex].groupNames.push(this_selection.group_name);\n }\n }\n }\n await updateField({\n updateList:\n [{\n tableName: 'customizationRecs',\n fieldName: 'global_mail_rules.customization_value.time_based_rules',\n newData: currentValues.customizationRecs.global_mail_rules.customization_value.time_based_rules\n }],\n reactUpd: {\n showRuleGroupsQuickSearch: false,\n showGroupList: false,\n changesMade: true\n }\n });\n }}\n />\n }\n\n\n\n\n\n \n \n );\n};\n","import React from 'react';\n\nimport { deepCopy, isEmpty, dbClient, cl, recordExists } from '../../util/AVAUtilities';\nimport { AVAclasses, AVATextStyle, isDark } from '../../util/AVAStyles';\n\nimport useSession from '../../hooks/useSession';\n\nimport ClientProfileSection from '../sections/ClientProfileSection';\nimport ClientMessagingSection from './ClientMessagingSection';\nimport WeatherSection from '../sections/WeatherSection';\nimport GlobalMessagePreferencesSection from '../sections/GlobalMessagePreferencesSection';\n\nimport { Snackbar, Button, Avatar, Box, Dialog, Typography, Menu, MenuList, MenuItem, Paper } from '@material-ui/core';\nimport { Alert, AlertTitle } from '@material-ui/lab/';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nconst useStyles = makeStyles(theme => ({\n clientPopUp: {\n borderRadius: '30px 30px 30px 30px',\n },\n popUpMenu: {\n marginRight: theme.spacing(3),\n paddingRight: 2,\n },\n paperPallette: {\n borderRadius: '30px 30px 30px 30px',\n width: '95%',\n },\n padRight: {\n marginRight: theme.spacing(2),\n },\n}));\n\nexport default ({ client_id, personRec, initialValues, options = {}, onClose }) => {\n\n const isMounted = React.useRef(false);\n const { state } = useSession();\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n const [reactData, setReactData] = React.useState({\n initialized: false,\n popupMenuOpen: false,\n client_id,\n isMobile: (window.window.innerWidth < 800),\n linkedPersonFilter: {},\n mode: options.mode || 'edit',\n addFamilyMember: false,\n viewFamilyMember: false,\n user_id: state.user.user_id,\n formHistoryMode: false,\n recentlyCompletedDocs: [],\n addAccountList: [],\n familyFormsObj: {},\n user_class: state.user.account_class,\n administrative_account: (['admin', 'support', 'master'].includes(state.user.account_class)),\n OKtoSave: false,\n alert: false,\n myFormListObj: {},\n myImage: '',\n image_editing: false,\n selections: [],\n showRulesQuickSearch: false,\n selectedRulesPeople: [],\n special_values: [{\n person_id: '*Caregivers*',\n groups: [],\n first: 'Caregiver(s)',\n last: 'of Addressee'\n }],\n group_id: 'ALL',\n MessagingInitialized: false,\n bBoardList: {},\n deletePending: false,\n spliceAt: -1,\n confirmMessage: '',\n accessList: (state.accessList && state.accessList[state.session.client_id])\n ? state.accessList[state.session.client_id].list\n : [],\n textInput: {},\n editMode: {},\n addAttachment: false,\n isError: false,\n showQuickSearch: false,\n addLink: false,\n needsHeader: false,\n changesMade: false,\n components: {\n ClientProfileSection: {\n component_id: ClientProfileSection,\n },\n ClientWeatherSection: {\n component_id: WeatherSection,\n },\n ClientMessagingSection: {\n component_id: ClientMessagingSection,\n },\n GlobalMessagePreferencesSection: {\n component_id: GlobalMessagePreferencesSection,\n }\n\n },\n og: {\n customizationRecs: false,\n },\n current: {\n customizationRecs: {},\n },\n errorList: {},\n options\n });\n\n const [refreshTrigger, setRefreshTrigger] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n if (isMounted.current) {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setRefreshTrigger(refreshTrigger => !refreshTrigger); }\n }\n };\n\n React.useEffect(() => {\n async function initialize() {\n let reactUpdObj = {\n initialized: true,\n sections: [{\n section_name: 'Client Name & Profile',\n color: initialValues?.color || 'orange',\n isOpen: false,\n isAuthorized: true,\n version_id: 0,\n component_name: 'ClientProfileSection'\n },\n {\n section_name: 'Weather',\n color: initialValues?.color || 'orange',\n isOpen: false,\n isAuthorized: true,\n version_id: 0,\n component_name: 'ClientWeatherSection'\n },\n {\n section_name: 'Global Messaging Rules',\n color: initialValues?.color || 'orange',\n isOpen: false,\n isAuthorized: true,\n version_id: 0,\n component_name: 'GlobalMessagePreferencesSection'\n },\n {\n section_name: 'Preferred Recipients',\n color: initialValues?.color || 'orange',\n isOpen: false,\n isAuthorized: true,\n version_id: 0,\n component_name: 'ClientMessagingSection'\n }]\n };\n // incoming client_id should tell us who we are editing here\n\n // there will be a Customization entry for key \"editable_entries\" in the global client \"AVA\" and in the local client_id\n // it's customization_value will be an array of Objects in the form {key: , }\n\n // Client Profile fields\n // Field custom_key customization_value data type\n // -------- ----------------- --------------------------- -------------\n // Profile\n // Name client_name text \n // Logo logo image file URL\n // Background Image client_style .checkin_image image file URL\n // Background Color .backgroundColor hex color value\n //\n // Weather\n // Suppress client_weather .suppress_on_marquee \n // Latitude/Longitude .nws_office .nws_x .nws_y\n // Place Name .place_name\n //\n // Messaging\n // Message Targets message_targets . array of objs [{name_on_menu, [{type: , id: }, ...]}, {}, ...]\n // Global Rules global_mail_rules .time_based_rules array of objs [{day, method, from, to}, {}, ...]\n\n let cRecs = await dbClient\n .query({\n TableName: 'Customizations',\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': reactData.client_id }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading Cusomtizations for client ${reactData.client_id} - error is ${error}`);\n });\n reactUpdObj.og = { // this default will be replaced in the for...of loop below if a legitimate global_mail_rules key exists\n customizationRecs: {\n global_mail_rules: {\n client_id: reactData.client_id,\n custom_key: 'global_mail_rules',\n customization_value: {}\n },\n client_style: {\n client_id: reactData.client_id,\n custom_key: 'client_style',\n customization_value: {}\n },\n }\n };\n if (recordExists(cRecs)) {\n for (const this_cRec of cRecs.Items) {\n switch (this_cRec.custom_key) {\n case 'client_name':\n case 'client_weather':\n case 'client_style': {\n reactUpdObj.og.customizationRecs[this_cRec.custom_key] = this_cRec;\n break;\n }\n case 'logo': {\n reactUpdObj.myImage = this_cRec.customization_value || this_cRec.icon;\n this_cRec.customization_value = reactUpdObj.myImage;\n this_cRec.icon = reactUpdObj.myImage;\n reactUpdObj.og.customizationRecs[this_cRec.custom_key] = this_cRec;\n break;\n }\n case 'global_mail_rules': {\n if (this_cRec.customization_value?.time_based_rules && (this_cRec.customization_value?.time_based_rules.length > 0)) {\n this_cRec.customization_value.time_based_rules.forEach((this_rule, ndx) => {\n if (this_rule.method && !this_rule.methods) {\n this_cRec.customization_value.time_based_rules[ndx].methods = [this_rule.method];\n }\n });\n }\n else {\n this_cRec.customization_value.time_based_rules = [];\n }\n reactUpdObj.og.customizationRecs['global_mail_rules'].customization_value.time_based_rules = this_cRec.customization_value.time_based_rules;\n break;\n }\n default: {\n reactUpdObj.og.customizationRecs[this_cRec.custom_key] = this_cRec;\n }\n }\n }\n reactUpdObj.current = {\n customizationRecs: deepCopy(\n Object.assign({},\n reactUpdObj.og.customizationRecs,\n initialValues?.peopleRec\n ))\n };\n }\n else {\n return {\n response_code: 400,\n errorMessage: `AVA doesn't recognize ID ${client_id} - No Client data found.`\n };\n }\n updateReactData(reactUpdObj, true);\n window.addEventListener('resize', handleResize);\n };\n function handleResize() {\n updateReactData({\n isMobile: (window.window.innerWidth < 800),\n }, true);\n }\n isMounted.current = true;\n initialize();\n return () => {\n isMounted.current = false;\n window.removeEventListener('resize', handleResize);\n };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n function renderSection(componentName) {\n const SectionToRender = reactData.components[componentName].component_id;\n return (\n {\n for (let errorObj of [errorList].flat()) {\n const { errorField, isError } = errorObj;\n if (!isError) {\n delete reactData.errorList[errorField];\n }\n else {\n reactData.errorList[errorField] = errorObj;\n }\n }\n updateReactData({\n errorList: reactData.errorList,\n }, true);\n }}\n updateField={async ({ updateList, errorObj, reactUpd }) => {\n if (reactData.mode !== 'view') {\n let reactUpdObj = {\n OKtoSave: true,\n current: reactData.current,\n };\n if (reactUpd) {\n Object.assign(reactUpdObj, reactUpd);\n };\n if (errorObj) {\n reactUpdObj.errorList = reactData.errorList;\n for (let errorItem of [errorObj].flat()) {\n const { errorField, isError } = errorItem;\n if (!isError) {\n delete reactUpdObj.errorList[errorField];\n }\n else {\n reactUpdObj.errorList[errorField] = errorItem;\n }\n }\n }\n for (let this_update of [updateList].flat()) {\n if (this_update) {\n const { tableName, fieldName, newData } = this_update; // fieldName as .customization_value...\n let result = resolve(reactData.current[tableName], fieldName.split('.'), newData);\n reactUpdObj.current[tableName] = result;\n }\n }\n updateReactData(reactUpdObj, true);\n }\n }}\n reactData={reactData}\n updateReactData={(newData, force) => {\n updateReactData(newData, force);\n }}\n />);\n }\n\n const resolve = (object, key, value) => {\n const this_key = key.shift();\n if (key.length === 0) {\n object[this_key] = value;\n return object;\n }\n else if (!object.hasOwnProperty(this_key)) {\n let resolvedObj = resolve({}, key, value);\n object[this_key] = resolvedObj;\n return object;\n }\n else if (isEmpty(object)) {\n let resolvedObj = resolve({}, key, value);\n object = resolvedObj;\n return object;\n }\n else {\n let resolvedObj = resolve(object[this_key], key, value);\n object[this_key] = resolvedObj;\n return object;\n }\n };\n\n const handleAbort = () => {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Changes are Pending',\n message: `There are unsaved changes. Exit anyway?`,\n action: [\n {\n text: `Keep editing`,\n function: () => {\n updateReactData({\n alert: false\n }, true);\n }\n },\n {\n text: `Exit`,\n function: () => {\n onClose(false);\n }\n }\n ]\n }\n }, true);\n };\n\n const saveChanges = async () => {\n // validation\n let errorsExist = false;\n if (reactData.current.customizationRecs?.global_mail_rules?.customization_value?.time_based_rules\n && (reactData.current.customizationRecs.global_mail_rules.customization_value.time_based_rules.length > 0)\n ) {\n for (let check_rule of reactData.current.customizationRecs.global_mail_rules.customization_value.time_based_rules) {\n if (!check_rule.methods || (check_rule.methods.length === 0)) {\n updateReactData({\n alert: {\n severity: 'error',\n title: `Error on Rule \"${check_rule.name}\"`,\n message: `You didn't select any actions for this rule`,\n }\n }, false);\n errorsExist = true;\n }\n else {\n if (((check_rule.methods.includes('add_recipients') && (!check_rule.hasOwnProperty('add_recipients') || (check_rule['add_recipients'].length === 0))))\n || (check_rule.methods.includes('replace_recipients') && (!check_rule.hasOwnProperty('replace_recipients') || (check_rule['replace_recipients'].length === 0)))) {\n updateReactData({\n alert: {\n severity: 'error',\n title: `Error on Rule \"${check_rule.name}\"`,\n message: `When using \"instead of\" or \"in addition to\" rules, you must select at least one recipient`\n }\n }, false);\n errorsExist = true;\n }\n }\n }\n }\n if (errorsExist) {\n return false;\n }\n else {\n if (JSON.stringify(reactData.og.customizationRecs) !== JSON.stringify(reactData.current.customizationRecs)) {\n for (const this_key in reactData.current.customizationRecs) {\n if (JSON.stringify(reactData.og.customizationRecs[this_key]) !== JSON.stringify(reactData.current.customizationRecs[this_key])) {\n await dbClient\n .put({\n TableName: 'Customizations',\n Item: reactData.current.customizationRecs[this_key]\n })\n .promise()\n .catch(error => {\n console.log(`caught error putting to Customizations at key ${this_key}; error is:`, error);\n });\n reactData.og.customizationRecs[this_key] = deepCopy(reactData.current.customizationRecs[this_key]);\n }\n }\n updateReactData({\n OKtoSave: false,\n og: reactData.og,\n current: reactData.current\n }, true);\n }\n }\n return true;\n };\n\n return (\n reactData.initialized &&\n {\n if (reactData.OKtoSave) {\n handleAbort();\n }\n else {\n onClose({\n newName: reactData.current.customizationRecs.client_name.customization_value\n });\n }\n }}\n >\n \n \n \n \n {reactData.current.customizationRecs.client_name.customization_value || `Client ${reactData.client_id}`}\n \n \n {/* Logo and Pop-up Menu */}\n \n {\n updateReactData({\n anchorEl: event.currentTarget,\n popupMenuOpen: true\n }, true);\n }}\n />\n\n \n {\n updateReactData({\n popupMenuOpen: false\n }, true);\n }}\n keepMounted>\n \n \n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n \n \n {`User ${state.session.user_id}${state.session.patient_id !== state.session.user_id ? (' (' + state.session.patient_id + ')') : ''}`}\n \n \n \n \n \n \n\n \n {reactData.sections.map((this_section, sectionNdx) => (\n (this_section.isAuthorized &&\n \n {\n reactData.sections[sectionNdx].isOpen = !reactData.sections[sectionNdx].isOpen;\n updateReactData({\n sections: reactData.sections\n }, true);\n }}\n >\n \n {this_section.section_name.trim()}\n \n \n {this_section.isOpen &&\n \n \n {renderSection(this_section.component_name)}\n \n {\n reactData.sections[sectionNdx].isOpen = !reactData.sections[sectionNdx].isOpen;\n updateReactData({\n sections: reactData.sections\n }, true);\n }}\n justifyContent='center'\n flexDirection='column'\n minHeight={30}\n height={30}\n />\n \n }\n \n )\n ))}\n \n\n \n {\n if (reactData.OKtoSave) {\n handleAbort();\n }\n else {\n onClose({\n newName: reactData.current.customizationRecs.client_name.customization_value\n });\n }\n }}\n >\n {'Exit'}\n \n {reactData.OKtoSave ?\n (isEmpty(reactData.errorList) ?\n \n {\n const result = await saveChanges();\n updateReactData({\n OKtoSave: !result\n }, true);\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'lightcyan', color: 'black' }}\n size='small'\n >\n {reactData.isMobile ? 'Save' : 'Save/Continue'}\n \n {\n let result = await saveChanges();\n if (result) {\n onClose({\n newName: reactData.current.customizationRecs.client_name.customization_value\n });\n }\n else {\n updateReactData({\n OKtoSave: !result\n }, true);\n }\n }}\n className={AVAClass.AVAButton}\n style={{ backgroundColor: 'green', color: 'white' }}\n size='small'\n >\n {'Save/Finish'}\n \n \n :\n \n \n {(Object.keys(reactData.errorList).length === 1)\n ? `${reactData.errorList[Object.keys(reactData.errorList)[0]].errorMessage}`\n : `${Object.keys(reactData.errorList).length} issues`\n }\n \n \n )\n :\n \n \n {`${(reactData.current.customizationRecs.client_name.customization_value + \"'s\").replace(\"s's\", \"s'\")} Organizational Data`}\n \n {(reactData.mode === 'view') &&\n \n {`** View only **`}\n \n }\n {(reactData.mode === 'view') &&\n \n {`No Changes allowed`}\n \n }\n \n }\n \n\n {reactData.alert &&\n {\n updateReactData({\n alert: false\n }, true);\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center'\n }}\n >\n \n {([reactData.alert.action].flat()).map((this_action, actionNdx) => (\n this_action.function()}\n >\n {this_action.text}\n \n ))}\n \n : null\n )}\n variant='filled'\n onClose={() => {\n updateReactData({\n alert: false\n }, true);\n }}\n >\n {reactData.alert.title && {reactData.alert.title}}\n {reactData.alert.message}\n \n \n }\n \n );\n};\n","import React from 'react';\n\nimport useSession from '../../hooks/useSession';\n\nimport { getMemberList } from '../../util/AVAGroups';\nimport { dbClient, recordExists, cl, titleCase } from '../../util/AVAUtilities';\nimport QuickSearch from '../sections/QuickSearch';\nimport { getPerson, getImage, makeName } from '../../util/AVAPeople';\nimport PeopleMaintenance from '../dialogs/PeopleMaintenance';\nimport { addDays, makeDate } from '../../util/AVADateTime';\nimport FormFillB from '../forms/FormFillB';\nimport { createDocument } from '../../util/AVADocuments';\n\nimport { Snackbar, Paper, Box, Dialog, DialogActions, Button, Typography } from '@material-ui/core';\nimport Select from \"react-dropdown-select\";\nimport { Alert, AlertTitle } from '@material-ui/lab/';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport CloseIcon from '@material-ui/icons/ExitToApp';\nimport PeopleIcon from '@material-ui/icons/People';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport SendIcon from '@material-ui/icons/Send';\n\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle';\nimport EditIcon from '@material-ui/icons/Edit';\nimport VisibilityIcon from '@material-ui/icons/Visibility';\n\nimport { AVAclasses, AVATextStyle } from '../../util/AVAStyles';\nimport MessageForm from '../forms/MessageForm';\n\nconst useStyles = makeStyles(theme => ({\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n myImageArea: {\n minWidth: '50px',\n maxWidth: '50px',\n minHeight: '50px',\n maxHeight: '50px',\n marginRight: theme.spacing(1),\n borderRadius: '25px'\n },\n peopleBox: {\n paddingTop: 0,\n paddingBottom: theme.spacing(2),\n overflowX: 'auto',\n scrollbarWidth: 'thin',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n display: 'flex',\n width: '100%',\n flexDirection: 'column'\n },\n peopleBoxWithSpace: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(2),\n overflowX: 'auto',\n scrollbarWidth: 'thin',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n display: 'flex',\n width: '100%',\n flexDirection: 'row'\n },\n paperPallette: {\n borderRadius: '30px 30px 30px 30px',\n width: '95%',\n height: '100%',\n overflow: 'hidden'\n },\n dragNamesFirst: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: '3px',\n marginBottom: '-10px'\n },\n dragNamesLast: {\n fontSize: theme.typography.fontSize * 0.8,\n marginTop: '3px',\n fontWeight: 'bold',\n marginBottom: '-10px'\n },\n assignment_avatar: {\n marginTop: 0,\n marginBottom: 0,\n height: 40,\n width: 40,\n paddingTop: 0,\n fontSize: '1.2rem',\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n listItemAVA: {\n fontSize: theme.typography.fontSize * 1.5,\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n}));\n\nexport default ({ defaults, onClose }) => {\n\n const { state } = useSession();\n\n const [reactData, setReactData] = React.useState({\n alert: false,\n window_width: 1,\n administrative_account: (['admin', 'support', 'master'].includes(state.user.account_class)),\n\n // from defaults\n\n activity_filter: '',\n lower_activity_filter: null,\n filterComplete: false,\n filterNotStarted: false,\n filterInProcess: false,\n default_filters: [{\n value: 'completed',\n label: 'Complete'\n },\n {\n value: 'in_process',\n label: 'In Process'\n },\n {\n value: 'pending',\n label: 'Pending'\n },\n {\n value: 'not started',\n label: 'Not Started'\n }],\n anchorEl: null,\n building: 'not started',\n defaults,\n denseView: false,\n display_name: state.patient?.name?.first || 'My',\n event_being_edited: false,\n isDarkMode: useMediaQuery('(prefers-color-scheme: dark)'),\n isEditing: false,\n loading: false,\n masterFormList: {},\n masterPeopleList: {},\n needRef: false,\n newGroups: {},\n popUpOpen: false,\n progressMessage: 'Building Group List',\n pWidth: 60,\n rowLimit: 50,\n selectDate: null,\n selectedPerson_id: null,\n selectedPersonRec: false,\n selectedPersonFirstName: '',\n selectedPersonLastName: '',\n showGroupSelect: false,\n showQuickSearch: false,\n selectedGroup_id: null,\n selectedGroupRec: false,\n selectedGroupMembers: false,\n updatesMade: false,\n viewPeopleMaintenance: false\n });\n const [refreshTrigger, setRefreshTrigger] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setRefreshTrigger(refreshTrigger => !refreshTrigger); }\n };\n\n\n function handleResize() {\n updateReactData({\n window_width: Math.min(((window.window.innerWidth - 220) / 1400), 1),\n }, true);\n }\n\n const handleDragStart = (ev, id) => {\n ev.dataTransfer.setData('id', JSON.stringify(id));\n };\n\n const handleDragOver = (ev) => {\n ev.preventDefault();\n };\n\n const placeholderImage =\n 'https://theseus-medical-storage.s3.amazonaws.com/public/patients/tboone.jpg';\n\n const onImageError = (e) => {\n e.target.src = placeholderImage;\n };\n\n // const autoFocus = (element) => element?.focus();\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const handleChangeActivityFilter = selectedValue => {\n let lower = selectedValue.value.toLowerCase();\n updateReactData({\n activity_filter: selectedValue.label,\n lower_activity_filter: lower,\n filterComplete: lower.includes('complete'),\n filterNotStarted: lower.includes('not start'),\n filterInProcess: lower.includes('process'),\n filterPending: lower.includes('pending')\n }, true);\n };\n\n function OKtoShow(this_person, this_form, display_data) {\n if (!reactData.lower_activity_filter) { return true; }\n if (reactData.filterComplete) {\n return (reactData.masterPeopleList[this_person]?.[this_form]?.status === 'completed');\n }\n else if (reactData.filterInProcess) {\n return (reactData.masterPeopleList[this_person]?.[this_form]?.status === 'in_process');\n }\n else if (reactData.filterPending) {\n return (reactData.masterPeopleList[this_person]?.[this_form]?.status === 'pending');\n }\n else if (reactData.filterNotStarted) {\n return (!reactData.masterPeopleList[this_person].hasOwnProperty(this_form)\n || (reactData.masterPeopleList[this_person]?.[this_form]?.status === 'not started'));\n }\n return (display_data.toLowerCase().includes(reactData.lower_activity_filter));\n };\n\n async function personForms(this_person) {\n reactData.masterPeopleList[this_person] = {};\n for (let this_form in reactData.masterFormList) {\n if (reactData.masterFormList[this_form].hasOwnProperty('groupList') &&\n reactData.masterFormList[this_form].groupList.some(g => { return reactData.selectedPersonRec.groups.includes(g); })) {\n reactData.masterPeopleList[this_person][this_form] = {\n status: 'not started',\n last_update: 0\n };\n if (!reactData.masterFormList[this_form].hasOwnProperty('memberList')) {\n reactData.masterFormList[this_form].memberList = {};\n }\n reactData.masterFormList[this_form].memberList[this_person] = {\n person_id: reactData.selectedPerson_id,\n person_name: `${reactData.selectedPersonRec.name.first} ${reactData.selectedPersonRec.name.last}`,\n person_first: reactData.selectedPersonRec.name.first,\n person_last: reactData.selectedPersonRec.name.last,\n wipDocs: [],\n assignedDocs: [],\n completedDocs: [],\n };\n }\n }\n // get all Documents for this person\n let allDocs = await dbClient\n .query({\n KeyConditionExpression: 'pertains_to = :p',\n IndexName: 'person_form-index',\n TableName: 'DocumentMaster',\n ExpressionAttributeValues: {\n ':p': this_person\n }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading CompletedDocuments; error is ${error}`);\n });\n if (recordExists(allDocs)) {\n for (const this_doc of allDocs.Items) {\n await buildMasters(this_doc);\n }\n }\n updateReactData({\n masterPeopleList: reactData.masterPeopleList,\n masterFormList: reactData.masterFormList\n }, true);\n }\n\n async function buildMasters(this_doc) {\n if ((this_doc.restricted_access === 'admin_only') && (!reactData.administrative_account)) {\n return; // skip this document\n }\n if (!reactData.masterFormList.hasOwnProperty(this_doc.form_type)) {\n reactData.masterFormList[this_doc.form_type] = { memberList: {} };\n }\n else if (!reactData.masterFormList[this_doc.form_type].hasOwnProperty('memberList')) {\n reactData.masterFormList[this_doc.form_type].memberList = {};\n }\n if (!reactData.masterFormList[this_doc.form_type].memberList.hasOwnProperty(this_doc.pertains_to)) {\n reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to] = {\n person_id: this_doc.pertains_to,\n //person_name: `${reactData.selectedPersonRec.name.first} ${reactData.selectedPersonRec.name.last}`,\n //person_first: reactData.selectedPersonRec.name.first,\n //person_last: reactData.selectedPersonRec.name.last,\n person_name: await makeName(this_doc.pertains_to),\n person_first: `${this_doc.pertains_to}`,\n person_last: `${this_doc.pertains_to}`,\n wipDocs: [],\n assignedDocs: [],\n completedDocs: [],\n };\n };\n if (!reactData.masterPeopleList.hasOwnProperty(this_doc.pertains_to)) {\n reactData.masterPeopleList[this_doc.pertains_to] = {};\n }\n if (this_doc.history[0].last_update === 0) {\n let splitter = this_doc.document_id.split('#');\n this_doc.history[0].last_update = splitter[splitter.length - 1];\n }\n if (this_doc.status === 'complete') {\n const completed_count = reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to].completedDocs.length;\n const cObj = {\n document_id: this_doc.document_id,\n location: this_doc.history[0].url,\n last_update: this_doc.history[0].last_update,\n date_completed: makeDate(this_doc.history[0].last_update).relative,\n title: this_doc.title,\n amendments: this_doc.amendments\n };\n if ((completed_count === 0) || (this_doc.history[0].last_update > reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to].completedDocs[0].last_update)) {\n reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to].completedDocs.unshift(cObj);\n if (!reactData.masterPeopleList[this_doc.pertains_to].hasOwnProperty(this_doc.form_type) || (this_doc.history[0].last_update > reactData.masterPeopleList[this_doc.pertains_to][this_doc.form_type].last_update)) {\n reactData.masterPeopleList[this_doc.pertains_to][this_doc.form_type] = {\n status: 'completed',\n last_update: this_doc.history[0].last_update\n };\n }\n }\n else if (this_doc.history[0].last_update < reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to].completedDocs[completed_count - 1].last_update) {\n reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to].completedDocs.push(cObj);\n }\n else {\n const foundAt = reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to].completedDocs.findIndex(d => {\n return (d.last_update < this_doc.history[0].last_update);\n });\n reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to].completedDocs.splice(foundAt, 0, cObj);\n }\n }\n else if ((this_doc.status === 'in_process') || (this_doc.status === 'pending')) {\n if (!reactData.masterPeopleList[this_doc.pertains_to].hasOwnProperty(this_doc.form_type) || (this_doc.history[0].last_update > reactData.masterPeopleList[this_doc.pertains_to][this_doc.form_type].last_update)) {\n reactData.masterPeopleList[this_doc.pertains_to][this_doc.form_type] = {\n status: this_doc.status,\n last_update: this_doc.history[0].last_update\n };\n }\n if ((reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to].wipDocs.length > 0) && (reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to].wipDocs[0].last_update < this_doc.history[0].last_update)) {\n reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to].wipDocs.unshift({\n document_id: this_doc.document_id,\n last_update: this_doc.history[0].last_update,\n doc_status: this_doc.status,\n due_date: this_doc.due_date || reactData.masterFormList[this_doc.form_type].dueDate,\n title: this_doc.title\n });\n }\n else {\n reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to].wipDocs.push({\n document_id: this_doc.document_id,\n last_update: this_doc.history[0].last_update,\n doc_status: this_doc.status,\n due_date: this_doc.due_date || reactData.masterFormList[this_doc.form_type].dueDate,\n title: this_doc.title\n });\n }\n }\n else {\n reactData.masterFormList[this_doc.form_type].memberList[this_doc.pertains_to].assignedDocs.push({\n document_id: this_doc.document_id,\n last_update: this_doc.history[0].last_update,\n due_date: this_doc.due_date || reactData.masterFormList[this_doc.form_type].dueDate,\n title: this_doc.title\n });\n }\n }\n\n async function formPeople(this_form) { // gathers all the people tha should (or do) have this form\n if (!reactData.masterFormList[this_form].hasOwnProperty('groupList')) {\n return;\n }\n reactData.masterFormList[this_form].memberList = {};\n reactData.masterPeopleList = {};\n for (let this_group of reactData.masterFormList[this_form].groupList) {\n let response = await getMemberList(this_group, state.session.client_id, { \"exclude\": false });\n for (let this_member of response.peopleList) {\n reactData.masterFormList[this_form].memberList[this_member.person_id] = {\n person_id: this_member.person_id,\n person_name: `${this_member.name.first} ${this_member.name.last}`,\n person_first: this_member.name.first,\n person_last: this_member.name.last,\n wipDocs: [],\n assignedDocs: [],\n completedDocs: [],\n };\n reactData.masterPeopleList[this_member.person_id] = {\n [this_form]: {\n status: 'not started',\n last_update: 0\n }\n };\n }\n }\n\n // get all Documents for this form type\n let allDocs = await dbClient\n .query({\n KeyConditionExpression: 'client_id_form_type = :p',\n IndexName: 'client_form_person-index',\n TableName: 'DocumentMaster',\n ExpressionAttributeValues: {\n ':p': `${state.session.client_id}%%${this_form}`\n }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading CompletedDocuments; error is ${error}`);\n });\n if (recordExists(allDocs)) {\n for (const this_doc of allDocs.Items) {\n await buildMasters(this_doc);\n }\n }\n updateReactData({\n masterPeopleList: reactData.masterPeopleList,\n masterFormList: reactData.masterFormList\n }, true);\n }\n\n async function initialize() {\n // this will get a list of forms, and include the groups that each form is attached to (if any)\n const today = makeDate('today');\n let temp_dueDate = today.numeric$ + 10000; // one year from today\n let masterFormList = {};\n // and build myFormListObj with one object for each form assigned to members of this person's groups\n // get all the forms that are assigned people in this group \n let allForms = await dbClient\n .query({\n KeyConditionExpression: 'client_id = :c',\n TableName: 'Forms',\n ExpressionAttributeValues: {\n ':c': state.session.client_id,\n }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading Forms; error is ${error}`);\n });\n if (recordExists(allForms)) {\n for (let formRec of allForms.Items) {\n if (!formRec.active) { continue; }\n // due_by works like this...\n // if due_by is single date and the date is in the future, use that date\n // if due_by is an array of dates, take the nearest date that is in the future\n // if due_by is a number, and docData.dueDate_key exists, add/subtract due_by to docData.dueDate_key\n // if due_by is a number, and no docData.dueDate_key exists, add due_by to today\n let date_assigned = false;\n for (const this_dueBy of [formRec.due_by].flat()) {\n let candidate = Number(this_dueBy);\n if ((candidate > today.numeric$) && (candidate < temp_dueDate)) { // is it a date in the future that is earlier than the current temp_dueDate?\n temp_dueDate = candidate;\n date_assigned = true;\n }\n else if (candidate < 20000000) { // it is not a date at all\n let checkMe = addDays((formRec.dueDate_key || today.date), candidate);\n if (checkMe.numeric$ > today.numeric$) {\n temp_dueDate = checkMe.numeric$;\n date_assigned = true;\n break;\n }\n }\n }\n masterFormList[formRec.form_id] = {\n form_id: formRec.form_id,\n form_name: formRec.form_name || `Form ${titleCase(formRec.form_id.replace(/[^a-zA-z0-9]|_/g, ' '))}`,\n groupList: [], // all the groups that require this form\n options: formRec.options || {},\n dueDate: date_assigned,\n };\n }\n }\n // are there one or more groups that require this form?\n let allGroups = await dbClient\n .query({\n KeyConditionExpression: 'client_id = :c',\n TableName: 'Groups',\n ExpressionAttributeValues: {\n ':c': state.session.client_id,\n }\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n cl(`Security Violation or no Internet Connection`);\n }\n cl(`Error reading Groups; error is ${error}`);\n });\n if (recordExists(allGroups)) {\n for (let groupRec of allGroups.Items) {\n if (groupRec.forms) {\n for (let this_form of groupRec.forms) {\n if (masterFormList.hasOwnProperty(this_form)) {\n masterFormList[this_form].groupList.push(groupRec.group_id);\n }\n }\n }\n }\n }\n // now we've got a list of all the forms that are attached to all the groups \n let sortedForms = Object.keys(masterFormList).sort((a, b) => {\n return (masterFormList[a].form_name < masterFormList[b].form_name ? -1 : 1);\n });\n\n updateReactData({\n sortedForms,\n masterFormList,\n formsInitialized: true\n }, true);\n }\n\n React.useEffect(() => {\n initialize();\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, [state.session]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n // **************************\n\n return (\n \n {(Object.keys(reactData.masterFormList).length === 0)\n ?\n \n \n {reactData.formsInitialized ? `No Forms to show for ${state.session.user_display_name}` : 'Loading'}\n \n \n :\n \n \n \n \n {'Select a form from this list'}\n \n\n \n \n {(reactData.selectedPerson_id || reactData.selectedForm_id) &&\n \n {\n if (values.length === 0) {\n handleChangeActivityFilter({ value: '', label: '' });\n }\n else {\n handleChangeActivityFilter(values[0]);\n }\n }}\n onChange={(values) => {\n if (values.length === 0) {\n handleChangeActivityFilter({ value: '', label: '' });\n }\n else {\n handleChangeActivityFilter(values[0]);\n }\n }}\n />\n \n \n {`Filter`}\n \n \n \n }\n \n \n \n {\n updateReactData({ showQuickSearch: true }, true);\n }}\n />\n \n\n \n\n {/* LEFT SIDE */}\n \n \n {`${state.session.client_name} Forms`}\n \n \n \n {reactData.sortedForms.map((this_formID, listIndex) => (\n \n \n {\n updateReactData({\n selectedForm_id: false,\n selectedFormRec: false,\n selectedFormMembers: false,\n selectedPerson_id: false,\n selectedPersonRec: false,\n activity_filter: '',\n lower_activity_filter: '',\n filterComplete: false,\n filterNotStarted: false,\n filterInProcess: false,\n isEditing: {\n calledFrom: 'master',\n person_id: state.session.client_id,\n form_id: this_formID,\n document_id: 'new'\n }\n }, true);\n }}\n style={AVATextStyle({\n size: 1.5,\n margin: { right: 0.5 },\n })}\n size='small'\n />\n handleDragStart(e, {\n form_id: this_formID,\n reason: 'createForm'\n })}\n onClick={async () => {\n await formPeople(this_formID);\n updateReactData({\n selectedForm_id: this_formID,\n selectedFormRec: reactData.masterFormList[this_formID],\n selectedFormMembers: reactData.masterFormList[this_formID].memberList,\n selectedPerson_id: false,\n selectedPersonRec: false,\n selectedPersonFirstName: false,\n selectedPersonLastName: false,\n activity_filter: '',\n lower_activity_filter: '',\n filterComplete: false,\n filterNotStarted: false,\n filterInProcess: false\n }, true);\n }}\n style={AVATextStyle({\n size: 1.2,\n margin: { left: 0, top: 0 },\n })}>\n {reactData.masterFormList[this_formID].form_name}\n \n \n \n ))}\n \n \n \n\n {/* RIGHT SIDE */}\n {reactData.selectedPerson_id &&\n \n \n handleDragOver(e)}\n onDrop={async (e) => {\n e.preventDefault();\n let draggedFrom = JSON.parse(e.dataTransfer.getData('id'));\n if (draggedFrom.reason === 'createForm') {\n let newDocument = await createDocument({\n docData: {\n client_id: state.session.client_id,\n form_type: draggedFrom.form_id,\n pertains_to: reactData.selectedPerson_id\n },\n author: state.session.patient_id\n });\n cl(newDocument);\n }\n }}\n alignItems='center'\n >\n handleDragStart(e, {\n person_id: reactData.selectedPerson_id,\n person_name: `${reactData.selectedPersonRec.name.first} ${reactData.selectedPersonRec.name.last}`,\n })}\n\n style={Object.assign({},\n AVATextStyle({\n size: 1.5,\n overflow: 'visible',\n bold: true,\n margin: { top: 1, bottom: 1, right: 0 },\n }), { textWrap: 'nowrap' }\n )}\n >\n {`${reactData.selectedPersonRec.name.first} ${reactData.selectedPersonRec.name.last}'${reactData.selectedPersonRec.name.last.trim().endsWith('s') ? '' : 's'} Forms`}\n \n \n {\n updateReactData({\n viewPeopleMaintenance: reactData.selectedPerson_id\n }, true);\n }}\n >\n \n \n \n \n handleDragOver(e)}\n onDrop={async (e) => {\n e.preventDefault();\n let draggedFrom = JSON.parse(e.dataTransfer.getData('id'));\n if (draggedFrom.reason === 'createForm') {\n let newDocument = await createDocument({\n docData: {\n client_id: state.session.client_id,\n form_type: draggedFrom.form_id,\n pertains_to: reactData.selectedPerson_id\n },\n author: state.session.patient_id\n });\n cl(newDocument);\n }\n }}\n >\n {\n e.preventDefault();\n let draggedFrom = JSON.parse(e.dataTransfer.getData('id'));\n if (draggedFrom.reason === 'createForm') {\n let newDocument = await createDocument({\n docData: {\n client_id: state.session.client_id,\n form_type: draggedFrom.form_id,\n pertains_to: reactData.selectedPerson_id\n },\n author: state.session.patient_id\n });\n cl(newDocument);\n }\n }}\n key={`form_column`}\n justifyContent='flex-start'\n alignItems='flex-start'\n >\n {reactData.masterPeopleList.hasOwnProperty(reactData.selectedPerson_id) &&\n Object.keys(reactData.masterPeopleList[reactData.selectedPerson_id]).map((this_form, gX) => (\n (OKtoShow(reactData.selectedPerson_id, this_form, reactData.masterFormList[this_form].form_name) &&\n {\n e.preventDefault();\n updateReactData({\n alert: {\n severity: 'info',\n title: `${reactData.masterFormList[this_form].form_name}`,\n message:
    \n Person ID: {reactData.selectedPerson_id}
    \n Form Type: {this_form}
    \n Status: {reactData.masterPeopleList[reactData.selectedPerson_id]?.[this_form]?.status}
    \n WIP Doc ID: {(reactData.masterFormList[this_form].memberList?.[reactData.selectedPerson_id]?.wipDocs[0]?.document_id || 'n/a')}
    \n Completed Doc ID: {(reactData.masterFormList[this_form].memberList?.[reactData.selectedPerson_id]?.completedDocs[0]?.document_id || 'n/a')}
    \n }\n }, true);\n }}\n style={AVATextStyle({\n size: 1.2,\n margin: { top: 0, bottom: 0.8 }\n })}\n >\n {(reactData.masterPeopleList[reactData.selectedPerson_id]?.[this_form]?.status === 'completed')\n ?\n {\n let nowJ = new Date().getTime();\n window.open(`${reactData.masterFormList[this_form].memberList[reactData.selectedPerson_id].completedDocs[0].location}?qt=${nowJ.toString()}`\n , reactData.masterFormList[this_form].memberList[reactData.selectedPerson_id].completedDocs[0].location);\n }}\n size='small'\n />\n :\n {\n updateReactData({\n isEditing: {\n calledFrom: 'people',\n person_id: reactData.selectedPerson_id,\n form_id: this_form,\n document_id: (reactData.masterFormList[this_form].memberList?.[reactData.selectedPerson_id]?.wipDocs[0]?.document_id || 'new')\n }\n }, true);\n }}\n style={AVATextStyle({\n size: 1.5,\n margin: { right: 0.5 },\n color: ((reactData.masterPeopleList[reactData.selectedPerson_id]?.[this_form]?.status === 'not started')\n ? 'red'\n : 'orange')\n })}\n size='small'\n />\n }\n handleDragStart(e, {\n person_id: reactData.selectedPerson_id,\n person_name: `${reactData.selectedPersonRec.name.first} ${reactData.selectedPersonRec.name.last}`,\n reason: 'form'\n })}\n style={AVATextStyle({\n size: 1.2,\n margin: { top: 0, bottom: 0 },\n color: ((!reactData.masterPeopleList.hasOwnProperty(reactData.selectedPerson_id))\n ? 'red'\n : (!reactData.masterPeopleList[reactData.selectedPerson_id].hasOwnProperty(this_form)\n ? 'red'\n : ((reactData.masterPeopleList[reactData.selectedPerson_id][this_form].status === 'completed')\n ? 'green'\n : ((reactData.masterPeopleList[reactData.selectedPerson_id][this_form].status === 'not started')\n ? 'red'\n : 'orange')\n )))\n })}\n onClick={async () => {\n await formPeople(this_form);\n updateReactData({\n selectedForm_id: this_form,\n selectedFormRec: reactData.masterFormList[this_form],\n selectedFormMembers: reactData.masterFormList[this_form].memberList,\n selectedPerson_id: false,\n selectedPersonRec: false,\n activity_filter: '',\n lower_activity_filter: '',\n filterComplete: false,\n filterNotStarted: false,\n filterInProcess: false\n\n }, true);\n }}\n >\n {`${reactData.masterFormList[this_form].form_name}`}\n \n
    \n )\n ))}\n
    \n
    \n handleDragOver(e)}\n onDrop={async (e) => {\n e.preventDefault();\n let draggedFrom = JSON.parse(e.dataTransfer.getData('id'));\n let sendMessage = [];\n if (draggedFrom.reason === 'form') {\n let jumpTo = window.location.href.replace('refresh', 'theseus');\n if (jumpTo.includes('?')) {\n jumpTo = jumpTo.split('?')[0];\n }\n sendMessage.push({\n person_id: draggedFrom.person_id,\n person_name: draggedFrom.person_name,\n subject: `Your ${state.session.client_name} forms`,\n messageText: `To access your ${state.session.client_name} forms, click the attached link!`,\n attachmentList: [`${jumpTo}?user=${draggedFrom.person_id}&forms=true`]\n });\n }\n else if (draggedFrom.hasOwnProperty('person_id')) {\n sendMessage.push({\n person_id: draggedFrom.person_id,\n person_name: `${draggedFrom.person_name}`\n });\n }\n updateReactData({\n sendMessage\n }, true);\n }}\n edge=\"start\"\n />\n
    \n }\n {reactData.selectedForm_id &&\n \n\n \n \n {`${reactData.masterFormList[reactData.selectedForm_id].form_name}`}\n \n \n \n \n {reactData.masterFormList[reactData.selectedForm_id] && Object.keys(reactData.masterFormList[reactData.selectedForm_id].memberList).sort((a, b) => {\n return (reactData.masterFormList[reactData.selectedForm_id].memberList[a].person_name > reactData.masterFormList[reactData.selectedForm_id].memberList[b].person_name) ? 1 : -1;\n }).map((this_person, cX) => (\n (OKtoShow(this_person, reactData.selectedForm_id, reactData.masterFormList[reactData.selectedForm_id].memberList[this_person].person_name) &&\n {\n e.preventDefault();\n updateReactData({\n alert: {\n severity: 'info',\n title: `${reactData.masterFormList[reactData.selectedForm_id].memberList[this_person].person_name}`,\n message:
    \n Person ID: {this_person}
    \n Form Type: {reactData.selectedForm_id}
    \n Status: {reactData.masterPeopleList[this_person]?.[reactData.selectedForm_id]?.status}
    \n WIP Doc ID: {(reactData.masterFormList[reactData.selectedForm_id].memberList?.[this_person]?.wipDocs[0]?.document_id || 'n/a')}
    \n Completed Doc ID: {(reactData.masterFormList[reactData.selectedForm_id].memberList?.[this_person]?.completedDocs[0]?.document_id || 'n/a')}
    \n }\n }, true);\n }}\n\n style={{ marginBottom: '6px' }}\n >\n {(reactData.masterPeopleList[this_person]?.[reactData.selectedForm_id]?.status === 'completed')\n ?\n {\n let nowJ = new Date().getTime();\n window.open(`${reactData.masterFormList[reactData.selectedForm_id].memberList[this_person].completedDocs[0].location}?qt=${nowJ.toString()}`\n , reactData.masterFormList[reactData.selectedForm_id].memberList[this_person].completedDocs[0].location);\n }}\n size='small'\n />\n :\n {\n updateReactData({\n isEditing: {\n calledFrom: 'forms',\n person_id: this_person,\n form_id: reactData.selectedForm_id,\n document_id: (reactData.masterFormList[reactData.selectedForm_id].memberList?.[this_person]?.wipDocs[0]?.document_id || 'new')\n }\n }, true);\n }}\n style={AVATextStyle({\n size: 1.5,\n margin: { right: 0.5 },\n color: ((reactData.masterPeopleList[this_person]?.[reactData.selectedForm_id]?.status === 'not started')\n ? 'red'\n : 'orange')\n })}\n size='small'\n />\n }\n handleDragStart(e, {\n person_id: this_person,\n person_name: `${reactData.masterFormList[reactData.selectedForm_id].memberList[this_person].person_name}`,\n reason: 'form'\n })}\n onClick={async () => {\n updateReactData({\n selectedForm_id: false,\n selectedFormRec: false,\n selectedFormMembers: false,\n selectedPerson_id: this_person,\n selectedPersonRec: await getPerson(this_person),\n activity_filter: '',\n lower_activity_filter: '',\n filterComplete: false,\n filterNotStarted: false,\n filterInProcess: false\n }, true);\n await personForms(this_person);\n }}\n >\n {`${reactData.masterFormList[reactData.selectedForm_id].memberList[this_person].person_name}`}\n \n
    \n )\n ))}\n
    \n
    \n handleDragOver(e)}\n onDrop={async (e) => {\n e.preventDefault();\n let draggedFrom = JSON.parse(e.dataTransfer.getData('id'));\n let sendMessage = [];\n if (draggedFrom.reason === 'form') {\n let jumpTo = window.location.href.replace('refresh', 'theseus');\n if (jumpTo.includes('?')) {\n jumpTo = jumpTo.split('?')[0];\n }\n sendMessage.push({\n person_id: draggedFrom.person_id,\n person_name: draggedFrom.person_name,\n subject: `Your ${state.session.client_name} forms`,\n messageText: `To access your ${state.session.client_name} forms, click the attached link!`,\n attachmentList: [`${jumpTo}?user=${draggedFrom.person_id}&forms=true`]\n });\n }\n else if (draggedFrom.hasOwnProperty('person_id')) {\n sendMessage.push({\n person_id: draggedFrom.person_id,\n person_name: draggedFrom.person_name\n });\n }\n updateReactData({\n sendMessage\n }, true);\n }}\n edge=\"start\"\n />\n
    \n }\n \n\n \n }\n {reactData.isEditing &&\n {\n if (statusObj.document_status === 'work_in_process') {\n reactData.masterPeopleList[reactData.isEditing.person_id][reactData.isEditing.form_id].status = 'in_process';\n if (!reactData.masterFormList[reactData.isEditing.form_id].memberList.hasOwnProperty(reactData.isEditing.person_id)) {\n reactData.masterFormList[reactData.isEditing.form_id].memberList[reactData.isEditing.person_id] = {\n person_id: reactData.isEditing.person_id,\n person_name: reactData.isEditing.person_id,\n person_first: reactData.isEditing.person_id,\n person_last: reactData.isEditing.person_id,\n wipDocs: [],\n assignedDocs: [],\n completedDocs: [],\n };\n }\n if (reactData.masterFormList[reactData.isEditing.form_id].memberList[reactData.isEditing.person_id].wipDocs.length === 0) {\n reactData.masterFormList[reactData.isEditing.form_id].memberList[reactData.isEditing.person_id].wipDocs.unshift({\n document_id: statusObj.document_id,\n last_update: new Date().getTime(),\n doc_status: 'in_process',\n due_date: reactData.masterFormList[reactData.isEditing.form_id].dueDate,\n title: statusObj.document_title\n });\n }\n else {\n reactData.masterFormList[reactData.isEditing.form_id].memberList[reactData.isEditing.person_id].wipDocs[0].document_id = statusObj.document_id;\n }\n }\n else if (statusObj.document_status === 'complete') {\n reactData.masterPeopleList[reactData.isEditing.person_id][reactData.isEditing.form_id].status = 'completed';\n if (!reactData.masterFormList[reactData.isEditing.form_id].memberList.hasOwnProperty(reactData.isEditing.person_id)) {\n reactData.masterFormList[reactData.isEditing.form_id].memberList[reactData.isEditing.person_id] = {\n person_id: reactData.isEditing.person_id,\n person_name: reactData.isEditing.person_id,\n person_first: reactData.isEditing.person_id,\n person_last: reactData.isEditing.person_id,\n wipDocs: [],\n assignedDocs: [],\n completedDocs: [],\n };\n }\n reactData.masterFormList[reactData.isEditing.form_id].memberList[reactData.isEditing.person_id].completedDocs.unshift({\n document_id: statusObj.document_id,\n location: statusObj.location,\n last_update: new Date().getTime(),\n date_completed: makeDate(new Date().getTime()).relative,\n title: statusObj.document_title\n });\n }\n updateReactData({\n masterPeopleList: reactData.masterPeopleList,\n masterFormList: reactData.masterFormList,\n }, false);\n if (reactData.isEditing.calledFrom === 'people') {\n await personForms(reactData.isEditing.person_id);\n }\n else {\n await formPeople(reactData.isEditing.form_id);\n }\n updateReactData({\n isEditing: false\n }, true);\n }}\n />\n }\n {\n reactData.showQuickSearch &&\n {\n if (selections && (selections.length > 0)) {\n updateReactData({\n showQuickSearch: false,\n selectedForm_id: false,\n selectedFormRec: false,\n selectedFormMembers: false,\n selectedPerson_id: selections[0].person_id,\n selectedPersonRec: await getPerson(selections[0].person_id,),\n }, true);\n await personForms(selections[0].person_id);\n }\n else {\n updateReactData({\n showQuickSearch: false,\n }, true);\n }\n }}\n />\n }\n {\n reactData.sendMessage &&\n {\n updateReactData({\n sendMessage: false\n }, true);\n }}\n options={{\n newMessage: true,\n recipients: reactData.sendMessage.map(r => {\n return {\n person_id: r.person_id,\n person_name: r.person_name\n };\n }),\n subject: reactData.sendMessage[0].subject,\n messageText: reactData.sendMessage[0].messageText,\n attachmentList: reactData.sendMessage.map(a => {\n return a.attachmentList;\n }).flat(),\n }}\n />\n }\n {\n reactData.viewPeopleMaintenance &&\n {\n updateReactData({\n viewPeopleMaintenance: false\n }, true);\n }}\n />\n }\n \n }\n onClick={() => {\n onClose();\n }}\n >\n {'Done'}\n \n ;\n {\n reactData.alert &&\n {\n updateReactData({\n alert: false\n }, true);\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center'\n }}\n >\n \n {([reactData.alert.action].flat()).map((this_action, actionNdx) => (\n this_action.function()}\n >\n {this_action.text}\n \n ))}\n \n : null\n )}\n variant='filled'\n onClose={() => {\n updateReactData({\n alert: false\n }, true);\n }}\n >\n {reactData.alert.title && {reactData.alert.title}}\n {reactData.alert.message}\n \n \n }\n \n );\n};\n","import React from 'react';\nimport useSession from '../../hooks/useSession';\nimport Box from '@material-ui/core/Box';\nimport { cl } from '../../util/AVAUtilities';\nimport GroupForm from '../forms/GroupForm';\nimport ShowCalendar from '../dialogs/ShowCalendar';\nimport ImageGallery from 'react-image-gallery';\nimport \"react-image-gallery/styles/css/image-gallery.css\";\nimport { useSnackbar } from 'notistack';\n\nexport default ({ filter = {}, onClose }) => {\n\n const [reactData, setReactData] = React.useState({\n carousel_status: 'loading',\n progressMessage: 'Building Group List',\n saveState: {},\n current_index: 0,\n visible_y: window.window.innerHeight,\n visible_x: window.window.innerWidth\n });\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n cl(forceRedisplay);\n\n const { state } = useSession();\n reactData.saveState = state;\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n const gallery = React.useRef(null);\n\n const { enqueueSnackbar } = useSnackbar();\n\n const renderVideoUrl = (video) => {\n return (\n \n \n \n );\n };\n let imageList = [\n 'https://theseus-medical-storage.s3.amazonaws.com/ademo.jpg',\n 'https://theseus-medical-storage.s3.amazonaws.com/public/patients/aconklin.jpg',\n 'https://theseus-medical-storage.s3.amazonaws.com/Picture+st+pats.png',\n 'https://theseus-medical-storage.s3.amazonaws.com/s3.jpg',\n 'https://theseus-medical-storage.s3.amazonaws.com/public/IMG_2270.mov',\n 'https://theseus-medical-storage.s3.amazonaws.com/public/patients/ballen.jpg',\n 'https://theseus-medical-storage.s3.amazonaws.com/public/patients/bsherrill.jpg',\n 'https://theseus-medical-storage.s3.amazonaws.com/s2.jpg',\n 'https://theseus-medical-storage.s3.amazonaws.com/s1.jpg',\n 'https://theseus-medical-storage.s3.amazonaws.com/public/documents/2021-04-15+14.59.27.mp4'\n ];\n\n let AVAdata = [\n { slide_type: 'person', person_id: 'ademo' },\n { slide_type: 'person', person_id: 'aconklin' },\n { slide_type: 'event', event_id: 'oncampus_fc7bd3#20240313' },\n { slide_type: 'event', event_id: 'oncampus_fc7bd3#20240313' },\n { slide_type: 'video', video_url: 'https://theseus-medical-storage.s3.amazonaws.com/public/IMG_2270.mov' },\n { slide_type: 'person', person_id: 'ballen' },\n { slide_type: 'person', person_id: 'bsherrill' },\n { slide_type: 'event', event_id: 'oncampus_fc7bd3#20240313' },\n { slide_type: 'event', event_id: 'oncampus_fc7bd3#20240313' },\n { slide_type: 'video', video_url: 'https://theseus-medical-storage.s3.amazonaws.com/public/documents/2021-04-15+14.59.27.mp4' }\n ];\n\n const buildDashboard = async () => {\n reactData.carousel_status = 'loading';\n setReactData(reactData);\n reactData.slideShow = [];\n imageList.forEach((this_image, x) => {\n reactData.slideShow[x] = {\n original: this_image,\n originalHeight: `${.55 * reactData.visible_y}px`,\n originalWidth: `${.5 * reactData.visible_y}px`,\n thumbnail: this_image,\n thumbnailHeight: `${.1 * reactData.visible_y}px`,\n thumbnailWidth: `${.1 * reactData.visible_y}px`,\n AVA: AVAdata[x]\n };\n let extension = this_image.split('.').pop();\n switch (extension) {\n case 'mov':\n case 'mp4': {\n reactData.slideShow[x].renderItem = renderVideoUrl.bind(reactData.slideShow[x]);\n reactData.slideShow[x].thumbnail = 'https://ava-icons.s3.amazonaws.com/movie.png';\n break;\n }\n default: { }\n }\n });\n\n if (reactData.slideShow.length === 0) {\n enqueueSnackbar(`Nothing was loaded`, { variant: 'error', persist: false });\n onClose();\n }\n reactData.carousel_status = 'carousel';\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n };\n\n\n\n React.useEffect(() => {\n async function initialize() {\n await buildDashboard();\n }\n if (!reactData.hasOwnProperty('slideShow')) { initialize(); }\n }, [filter]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n // ******************\n\n return (\n \n {(reactData.carousel_status === 'carousel') &&\n reactData.slideShow &&\n (reactData.slideShow.length > 0) &&\n {\n cl(content);\n reactData.current_index = gallery.current.state.currentIndex;\n if (reactData.slideShow[reactData.current_index].hasOwnProperty('AVA') && reactData.slideShow[reactData.current_index].AVA.slide_type) {\n switch (reactData.slideShow[reactData.current_index].AVA.slide_type) {\n case 'person': {\n if (reactData.saveState.accessList) {\n reactData.carousel_status = `show_person`;\n reactData.selected_image = reactData.slideShow[reactData.current_index];\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n }\n else {\n cl('We will send a message telling to wait a bit');\n }\n break;\n }\n case 'event': {\n if (reactData.saveState.accessList) {\n reactData.carousel_status = `show_event`;\n reactData.selected_image = reactData.slideShow[reactData.current_index];\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n }\n else {\n cl('We will send a message telling to wait a bit');\n }\n break;\n }\n default: {\n\n }\n }\n }\n }}\n />\n }\n {(reactData.carousel_status === 'show_person') &&\n {\n reactData.carousel_status = 'carousel';\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n return;\n }}\n />\n }\n {(reactData.carousel_status === 'show_event') &&\n {\n reactData.carousel_status = 'carousel';\n setReactData(reactData);\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n return;\n }}\n />\n }\n \n );\n};","import {\n resolveVariables, stringToColor, cl, clt, recordExists, uuid,\n dbClient, makeArray, isObject, deepCopy, deepResolve, makeObject\n} from '../util/AVAUtilities';\nimport { getPerson } from '../util/AVAPeople';\nimport { makeDate } from '../util/AVADateTime';\nimport { getGroup, getMemberList, prepareTargets } from '../util/AVAGroups';\nimport { makeObservationList } from '../util/AVAObservations';\n\nlet AVAIcon = process.env.REACT_APP_AVA_LOGO;\n\nlet customObj = {};\nlet activityObj = {};\nlet groupObj = {};\n\nexport default async (requestor, masterClient, screenStatus, subMenuData = null, forceRefresh = false, state) => {\n\n if (forceRefresh) {\n customObj = {};\n activityObj = {};\n groupObj = {};\n requestor = await getPerson(requestor.person_id, '*all', true);\n };\n\n let groupList = [];\n\n let numberOfRows = 1000;\n let sectionDetails = {};\n let activityHistory = {};\n\n function makeVersion(inStr) {\n let p = inStr.split('.');\n let response = p.reduce((ans, s) => { \n let n = Number(s);\n if (isNaN(n)) {\n return ans;\n }\n else {\n return (ans * 100) + n;\n }\n }, 0)\n if (response < 100) {\n return 999999\n }\n else if (response < 10000) {\n let today = new Date();\n return ((today.getFullYear() % 100) * 10000) + response;\n }\n else {\n return response;\n }\n }\n\n function makeNumber(inStr) {\n let [vYr, vMo, vDay] = inStr.split(/\\./g);\n return (20000000 + ((Number(vYr) % 100) * 10000) + (Number(vMo) * 100) + Number(vDay));\n }\n\n let sectionCheck = {};\n function alreadyInSection(pSec, pActIn) {\n let pAct;\n if (typeof (pActIn) === 'string') {\n pAct = pActIn;\n }\n else {\n pAct = pActIn.title || pActIn.activity_code;\n }\n if (sectionCheck[pSec]) {\n if (sectionCheck[pSec].includes(pAct)) { return true; }\n else { sectionCheck[pSec].push(pAct); }\n }\n else { sectionCheck[pSec] = [pAct]; }\n return false;\n }\n\n let ava_version_number = makeVersion(process.env.REACT_APP_AVA_VERSION);\n let ava_env = window.location.href.split('//')[1].slice(0, 1).toUpperCase();\n let todays_numeric_date = makeDate(new Date()).numeric;\n\n // Main line\n\n let pPerson = requestor.person_id;\n if (!masterClient) { masterClient = requestor.client_id; };\n if (subMenuData) { return await handleSubMenu(subMenuData); }\n else {\n let returnMe = await buildMainMenu(pPerson);\n return returnMe;\n }\n\n\n // Functions\n\n async function handleSubMenu(pSubMenu, pActivities = null, pOverrides = null) {\n let returnArray = [];\n let [sectionColor, sectionIcon] = await getCustomizations(pSubMenu.menu_name);\n if (pOverrides) {\n if (pOverrides.color) { sectionColor = pOverrides.color; }\n if (pOverrides.icon) { sectionIcon = pOverrides.icon; }\n }\n let subActivities = [];\n if (pActivities) { subActivities.push(...pActivities); }\n else { subActivities = await getSubMenu(pSubMenu.event_id, pSubMenu.client_id); }\n let aL = subActivities.length;\n if (aL > 0) {\n for (let a = 0; a < aL; a++) {\n let pos = 100 + a;\n let subClient, subKey;\n if (isObject(subActivities[a])) {\n if (subActivities[a].hasOwnProperty('client')) {\n subClient = subActivities[a].client;\n }\n else {\n subClient = pSubMenu.client_id;\n }\n subKey = subActivities[a].activity_code;\n }\n else if (subActivities[a].includes('//')) {\n [subClient, subKey] = subActivities[a].split('//');\n }\n else {\n subClient = pSubMenu.client_id;\n subKey = subActivities[a];\n }\n let this_row =\n await addRow(\n `${subClient}//${subKey}`, // activity_code\n pSubMenu.event_id, // this menu_id \n pSubMenu.parent, // parent menu_id\n pSubMenu.parent_name, // parent menu name\n `ZZZZ_SUB-${pSubMenu.event_id}-${pos}`, // sort position\n pSubMenu.menu_name, // this menu name\n sectionColor, // this menu color\n sectionIcon, // this menu icon\n (`${pSubMenu.reason} Sub-menu ${pSubMenu.event_id}`).trim() // why is this row in the menu\n );\n if (this_row) { returnArray.push(this_row); }\n }\n }\n return returnArray;\n }\n\n async function getSubMenu(pEvent, pClient) {\n let queryObj = {\n KeyConditionExpression: 'client_event_id = :e',\n ExpressionAttributeValues: {\n ':e': `${pClient}~${pEvent}`\n },\n TableName: \"ActivityEvent\",\n IndexName: 'sequence-index',\n ScanIndexForward: false\n };\n let mRecs = await dbClient\n .query(queryObj)\n .promise()\n .catch(error => {\n cl({ 'Error reading ActivityEvent': error });\n });\n if (recordExists(mRecs) && (mRecs.Count > 0)) {\n for (let m = 0; m < mRecs.Items.length; m++) {\n if (!mRecs.Items[m].sort_order) {\n if (mRecs.Items[m].sequence) {\n mRecs.Items[m].sort_order = (Number.MAX_SAFE_INTEGER - mRecs.Items[m].sequence).toString();\n }\n else { mRecs.Items[m].sort_order = ''; }\n }\n mRecs.Items[m].resolved = await resolveVariables(`%%${mRecs.Items[m].sort_order}%%`, { client_id: masterClient, patient_id: pPerson, user_id: pPerson });\n mRecs.Items[m].resolved = mRecs.Items[m].resolved.replace(/%%/g, '');\n }\n mRecs.Items.sort((a, b) => {\n if (a.resolved > b.resolved) { return 1; }\n else { return -1; }\n });\n return (mRecs.Items.map(m => { return m.activity_code; }));\n }\n else {\n return [];\n }\n }\n\n async function buildMainMenu(pPerson) {\n let returnArray = [];\n let sectionSort = '';\n let sectionName = '';\n let sectionColor = '';\n let sectionIcon = '';\n let duplicateCheck = [];\n let menuStructure = [{ menuName: 'main', currentSection: '' }];\n\n let logo_Rec = await dbClient\n .get({\n Key: {\n client_id: masterClient,\n custom_key: 'logo'\n },\n TableName: \"Customizations\",\n })\n .promise()\n .catch(error => {\n });\n if (recordExists(logo_Rec)) {\n AVAIcon = logo_Rec.Item.icon;\n }\n // Get Favorites from the People record\n // ({ '** FAVORITES **': (requestor.favorite_activities || 'no favorite activities') });\n sectionSort = '**2';\n if (!requestor.hasOwnProperty('name') || !requestor.name.hasOwnProperty('first')) {\n requestor.name = {\n first: requestor.person_id\n };\n }\n sectionName = `${requestor.name.first.trim()}'${requestor.name.first.trim().slice(-1) === 's' ? '' : 's'} Favorites`;\n sectionColor = '#6bb44b';\n sectionIcon = 'https://ava-icons.s3.amazonaws.com/icons8-favorite-50.png';\n let aL = 0;\n if (requestor.hasOwnProperty('favorite_activities')) {\n aL = requestor.favorite_activities.length;\n for (let a = 0; a < aL; a++) {\n screenStatus('Loading Favorites', ((a / aL) * 100), ((aL / 40) + .75), returnArray);\n let this_activity = requestor.favorite_activities[a];\n if (isObject(this_activity)) {\n // is \"section\" a key?\n if (this_activity.section) {\n sectionName = this_activity.section;\n }\n }\n else {\n // pick off \"~[section=
    ]\" and put this favorite in that section\n let parsed = this_activity.match(/(.*?)~\\[section=(.*?)](.*)/mi);\n if (parsed) {\n sectionName = parsed[2];\n this_activity = `${parsed[1]}${parsed[3] || ''}`;\n }\n }\n let this_row = await addRow(this_activity, 'main', null, null, sectionSort, sectionName, sectionColor, sectionIcon, 'Favorite');\n if (this_row) { returnArray.push(this_row); }\n }\n }\n else {\n requestor.favorite_activities = [];\n }\n\n // ({ '** PRIORITIES **': (requestor.priority_activities || 'no priority activities') });\n if (requestor.hasOwnProperty('priority_activities')) {\n sectionSort = '**2b';\n sectionName = `${requestor.name.first.trim()}'${requestor.name.first.trim().slice(-1) === 's' ? '' : 's'} priorities`;\n sectionColor = \"#a0985f\";\n sectionIcon = 'https://ava-icons.s3.amazonaws.com/icons8-idea-sharing-64.png';\n let aL = requestor.priority_activities.length;\n for (let a = 0; a < aL; a++) {\n screenStatus('Priority Items', ((a / aL) * 100), ((aL / 40) + .75), returnArray);\n let this_activity = requestor.priority_activities[a];\n if ((typeof (this_activity) === 'string') && (this_activity.startsWith('~~'))) {\n let sectionKeys = this_activity.split('~~');\n if (sectionKeys.length > 2) {\n sectionSort = sectionKeys[1];\n sectionName = sectionKeys[2];\n }\n else {\n sectionSort = sectionKeys[1];\n sectionName = sectionKeys[1];\n }\n if (!(sectionName in sectionDetails)) {\n [sectionColor, sectionIcon] = await getCustomizations(sectionName);\n sectionDetails[sectionName] = {\n color: sectionColor,\n icon: sectionIcon,\n sort_key: sectionSort\n };\n }\n }\n let this_row = await addRow(this_activity, 'main', null, null, sectionSort, sectionName, sectionColor, sectionIcon, 'Priorities');\n if (this_row) { returnArray.push(this_row); }\n }\n }\n\n // Get all Groups this person is associated with\n let neededGroups = [];\n requestor.groups.forEach(e => {\n if (e in groupObj) { groupList.push(groupObj[e]); }\n else { neededGroups.push(e); }\n });\n if (neededGroups.length > 0) {\n let addGroupList = await getGroupsPersonBelongsTo(neededGroups);\n addGroupList.forEach(c => {\n groupList.push(c);\n groupObj[c.group_id] = c;\n });\n }\n groupList.sort((a, b) => {\n if (a.group_id < b.group_id) { return -1; }\n else { return 1; }\n });\n // ('** GROUPS **');\n let allowDuplicates = false;\n let gL = groupList.length;\n for (let g = 0; g < gL; g++) {\n let this_group = groupList[g];\n sectionSort = 'ZZZ';\n sectionName = `Common activities for the ${this_group.name}${!this_group.name.includes('roup') ? ' group' : ''}`;\n sectionColor = stringToColor(sectionName);\n sectionIcon = AVAIcon;\n // (`Checking group ${this_group.group_id} (${this_group.name}): ${(this_group.common_activities || 'no common activities')}`);\n if (!this_group.hasOwnProperty('common_activities')) { continue; }\n for (let a = 0; a < this_group.common_activities.length; a++) {\n let aL = this_group.common_activities.length;\n screenStatus(`Common activities for ${this_group.name}`, ((a / aL) * 100), ((aL / 40) + .75), returnArray);\n let this_activity = this_group.common_activities[a];\n if (isObject(this_activity)) {\n if (this_activity.auth) {\n let authorized = state.user.groups.some(user_group => {\n return (this_activity.auth.includes(user_group));\n });\n if (!authorized) {\n continue;\n }\n }\n }\n let overrideColor = '';\n let overrideIcon = '';\n if (!allowDuplicates && duplicateCheck.includes(this_activity)) { // this_activity is already loaded\n continue;\n }\n if ((typeof (this_activity) === 'string') && this_activity.includes('~[auth=')) {\n let aPieces = this_activity.match(/~\\[auth=.+|\\]/g);\n let foundAt = aPieces.findIndex(p => { return (p === '~[auth=view]'); });\n if (foundAt > -1) {\n if (!state.accessList\n || ((state.accessList[masterClient].groups.hasOwnProperty(this_group.group_id))\n && (state.accessList[masterClient].groups[this_group.group_id] === 0))\n ) {\n continue;\n }\n }\n this_activity = this_activity.replace('~[auth=view]', '');\n }\n if ((typeof (this_activity) === 'string') && (this_activity.startsWith('~~'))) {\n if (this_activity.includes('~[adopt=')) {\n let [, oGroup,] = this_activity.split(/~\\[adopt=|\\]/g);\n let oClient;\n if (oGroup.includes('//')) { [oClient, oGroup] = oGroup.split('//'); }\n else { oClient = masterClient; }\n let oGroupRec = await getGroup(oGroup, oClient);\n if (oGroupRec && oGroupRec.common_activities) {\n this_group.common_activities.splice(a, 1, ...oGroupRec.common_activities);\n a--;\n }\n continue;\n }\n if (this_activity.includes('~~duplicate=OK') || this_activity.includes('~[duplicate=OK]')) {\n allowDuplicates = true;\n this_activity = this_activity.replace('~~duplicate=OK', '');\n this_activity = this_activity.replace('~[duplicate=OK]', '');\n }\n else { allowDuplicates = false; }\n if (this_activity.includes('~[color=')) {\n let [front, oColor, back] = this_activity.split(/~\\[color=|\\]/g);\n overrideColor = oColor;\n this_activity = front;\n if (back) { this_activity += back; };\n }\n if (this_activity.includes('~[icon=')) {\n let [front, oIcon, back] = this_activity.split(/~\\[icon=|\\]/g);\n overrideIcon = oIcon;\n this_activity = front;\n if (back) { this_activity += back; };\n }\n let sectionKeys = this_activity.split('~~');\n if (sectionKeys.length > 2) {\n sectionSort = sectionKeys[1];\n sectionName = sectionKeys[2];\n }\n else {\n sectionSort = sectionKeys[1];\n sectionName = sectionKeys[1];\n }\n if (sectionName.startsWith('section=')) {\n sectionName = sectionName.split(/=(.*)/)[1];\n }\n if (sectionName.startsWith('submenu=')) {\n let subName = sectionName.split(/=(.*)/)[1];\n let subOverrides = {};\n if (overrideColor) { subOverrides.color = overrideColor; }\n if (overrideIcon) { subOverrides.icon = overrideIcon; }\n let currentMenu = menuStructure.length - 1;\n let this_section = menuStructure[currentMenu].currentSection;\n if (alreadyInSection(this_section, `submenu.${subName}`)) { continue; }\n let subMenuObj = {\n client_id: masterClient,\n event_id: `submenu.${subName}`,\n parent: ((currentMenu === 0) ? null : menuStructure[currentMenu - 1].menuName),\n parent_name: ((currentMenu === 0) ? null : menuStructure[currentMenu - 1].menuName),\n menu_name: subName\n };\n returnArray.push({\n menu_name: menuStructure[currentMenu].menuName,\n sort_key: `${sectionDetails[this_section].sort_key}-${numberOfRows + 1000}`,\n section_name: this_section,\n section_color: sectionDetails[this_section].color,\n raw_data: this_activity,\n section_icon: sectionDetails[this_section].icon,\n row_color: sectionDetails[this_section].color,\n activity_code: `submenu.${subName}`,\n activity_name: await resolveVariables(subName, { client_id: masterClient, patient_id: pPerson, user_id: pPerson }),\n row_type: 'event',\n default_value: null,\n parent_menu: ((currentMenu === 0) ? null : menuStructure[currentMenu - 1].menuName),\n child_menu: subName,\n reason: `Group ${this_group.group_id}`,\n last_used: -1,\n is_favorite: false,\n subMenu_data: subMenuObj\n });\n await addRow(\n `submenu.${subName}`, // activity_code\n menuStructure[currentMenu].menuName, // this menu_id \n subMenuObj.parent, // parent menu_id\n subMenuObj.parent_name, // parent menu name\n sectionDetails[this_section].sort_key, // pSectionSort\n this_section, // pSectionName\n sectionDetails[this_section].color, // pSectionColor\n sectionDetails[this_section].icon, // pSectionIcon\n `Group ${this_group.group_id}` // pReason\n );\n menuStructure.push({ menuName: subName, currentSection: subName });\n let subActivities = [];\n let nextA;\n for (let s = a + 1; ((s < aL) && (this_group.common_activities[s] !== '~~end_submenu')); s++) {\n subActivities.push(this_group.common_activities[s]);\n nextA = s;\n }\n subMenuObj = {\n client_id: masterClient,\n event_id: subName,\n parent: menuStructure[currentMenu].menuName,\n parent_name: menuStructure[currentMenu].menuName,\n menu_name: subName,\n reason: `Group ${this_group.group_id}`\n };\n let subLines = await handleSubMenu(subMenuObj, subActivities, subOverrides);\n returnArray.push(...subLines);\n menuStructure.pop();\n sectionName = menuStructure[menuStructure.length - 1].currentSection;\n a = nextA + 1;\n continue;\n }\n else {\n menuStructure[menuStructure.length - 1].currentSection = sectionName;\n }\n if (!(sectionName in sectionDetails)) {\n [sectionColor, sectionIcon] = await getCustomizations(sectionName);\n if (overrideColor) { sectionColor = overrideColor; }\n if (overrideIcon) { sectionIcon = overrideIcon; }\n sectionDetails[sectionName] = {\n color: sectionColor,\n icon: sectionIcon,\n sort_key: sectionSort\n };\n }\n }\n else {\n if (!(sectionName in sectionDetails)) {\n [sectionColor, sectionIcon] = await getCustomizations(sectionName);\n if (overrideColor) { sectionColor = overrideColor; }\n if (overrideIcon) { sectionIcon = overrideIcon; }\n sectionDetails[sectionName] = {\n color: sectionColor,\n icon: sectionIcon,\n sort_key: sectionSort\n };\n }\n let currentMenu = menuStructure.length - 1;\n if (!alreadyInSection(sectionName, this_activity)) {\n let this_row = await addRow\n (this_activity, // pActivity\n menuStructure[currentMenu].menuName, // pMenu\n (currentMenu === 0 ? null : menuStructure[currentMenu - 1].menuName), // pParent\n null, // pParentName\n sectionDetails[sectionName].sort_key, // pSectionSort\n sectionName, // pSectionName\n sectionDetails[sectionName].color, // pSectionColor\n sectionDetails[sectionName].icon, // pSectionIcon\n `Group ${this_group.group_id}` // pReason\n );\n if (this_row) {\n returnArray.push(this_row);\n duplicateCheck.push(this_activity);\n }\n }\n }\n }\n }\n\n // Filter the result to remove sections or functions prohibited by People record\n if (requestor.hasOwnProperty('prohibited')) {\n if (!requestor.prohibited.activity_code) { requestor.prohibited.activity_code = []; }\n if (!requestor.prohibited.section) { requestor.prohibited.section = []; }\n returnArray = returnArray.filter(row => {\n return !(requestor.prohibited.activity_code.includes(row.activity_code) || (requestor.prohibited.section.includes(row.section_name)));\n });\n }\n\n // Add sort key where needed\n for (let ndx = 0; ndx < returnArray.length; ndx++) {\n let row = returnArray[ndx];\n if (row.sort_key.startsWith('#need-')) {\n let sData = {};\n if (row.section_name in sectionDetails) {\n sData = sectionDetails[row.section_name];\n }\n else {\n let [customColor, customIcon] = await getCustomizations(row.section_name);\n sData = {\n sort_key: `Z1~${row.section_name}`,\n color: customColor,\n icon: customIcon\n };\n }\n returnArray[ndx].sort_key = `${sData.sort_key}${row.sort_key.substring(5)}`;\n returnArray[ndx].section_color = sData.color;\n returnArray[ndx].row_color = sData.color;\n returnArray[ndx].section_icon = sData.icon;\n };\n };\n\n // Sort by sort_key\n returnArray.sort((a, b) => {\n if (a.sort_key > b.sort_key) { return 1; }\n else { return -1; }\n });\n\n // save for easy retieval next time\n saveMenu(pPerson, returnArray);\n return returnArray;\n }\n\n async function saveMenu(pPerson, pMenu) {\n let timeStamp = new Date().getTime();\n await dbClient\n .update({\n Key: {\n person_id: `${state.session.patient_id}%%${state.session.user_id}`\n },\n UpdateExpression: \"set AVA_main_menu = :m, menu_version = :v\",\n ExpressionAttributeValues: {\n \":m\": pMenu,\n \":v\": timeStamp\n },\n TableName: \"AVAMenu\"\n })\n .promise()\n .catch(error => {\n clt({ 'Menu not updated. Error is': error });\n });\n }\n\n async function getCustomizations(pName) {\n if (pName in customObj) {\n return [customObj[pName].color, customObj[pName].icon];\n }\n let cRec = await dbClient\n .get({\n Key: {\n client_id: masterClient,\n custom_key: pName\n },\n TableName: \"Customizations\",\n })\n .promise()\n .catch(error => {\n cl(`Caught error reading Customizations.Error is: ${error} \n with client = ${masterClient} and custom_key = ${pName} `);\n });\n if (recordExists(cRec)) {\n customObj[pName] = {\n color: cRec.Item.color || stringToColor(pName),\n icon: cRec.Item.icon || AVAIcon\n };\n return [cRec.Item.color || stringToColor(pName), cRec.Item.icon || AVAIcon];\n }\n else {\n customObj[pName] = {\n color: stringToColor(pName),\n icon: AVAIcon\n };\n return [stringToColor(pName), AVAIcon];\n }\n }\n\n /*\n async function getActivityLog(pPerson) {\n let aRecs = await dbClient\n .query({\n KeyConditionExpression: 'user_id = :p',\n ExpressionAttributeValues: { ':p': pPerson },\n TableName: \"ActivityLog\",\n ScanIndexForward: false,\n Limit: 20\n })\n .promise()\n .catch(error => {\n cl({ 'Error reading ActivityLog': error });\n });\n let history = {};\n // ({ 'Activity Log query got:': aRecs });\n if (recordExists(aRecs)) {\n let aL = aRecs.Items.length;\n for (let a = 0; a < aL; a++) {\n if (aRecs.Items[a].activity_code in history) {\n history[aRecs.Items[a].activity_code].push(aRecs.Items[a].timestamp);\n }\n else {\n history[aRecs.Items[a].activity_code] = [aRecs.Items[a].timestamp];\n }\n }\n return history;\n }\n else { return []; }\n }\n */\n\n async function addRow(pActivity, pMenu, pParent, pParentName, pSectionSort, pSectionName, pSectionColor, pSectionIcon, pReason) {\n let activityRec = await getActivity(pActivity);\n if (Object.keys(activityRec).length === 0) {\n return false;\n };\n let last_used = ((activityRec.activity_code in activityHistory) ?\n Math.max(...activityHistory[activityRec.activity_code]) :\n -1\n );\n numberOfRows++;\n let aClient = activityRec.client_id;\n let [aType, aCode] = activityRec.activity_code.split('.');\n if (aType.includes('//')) {\n [aClient, aType] = aType.split('//');\n }\n let favorite = false;\n if (pReason === 'History') { favorite = true; }\n else {\n if (requestor.hasOwnProperty('favorite_activities')) {\n favorite = makeArray(requestor.favorite_activities).some(r => {\n if (isObject(r)) {\n return (r.activity_code === activityRec.activity_code);\n }\n else {\n return (r.split('~')[0] === activityRec.activity_code);\n }\n });\n }\n }\n let pSort;\n if (activityRec.section_name && !favorite) {\n pSort = `#need-${numberOfRows}`;\n }\n else {\n pSort = `${pSectionSort}-${numberOfRows}`;\n }\n activityRec.code = activityRec.activity_code;\n let returnRowObject = {\n activity_rec: activityRec,\n code: activityRec.activity_code,\n raw_data: pActivity,\n menu_name: pMenu,\n sort_key: pSort,\n section_name: (!favorite && activityRec.section_name) || pSectionName,\n section_color: pSectionColor,\n section_icon: pSectionIcon,\n row_color: pSectionColor,\n activity_code: activityRec.activity_code,\n activity_name: await resolveVariables(activityRec.name, { client_id: aClient, patient_id: pPerson, user_id: pPerson }),\n row_type: activityRec.type,\n default_value: activityRec.validation?.default_value || null,\n parent_menu: pParent,\n child_menu: ((aType === 'event') ? aCode : null),\n reason: pReason,\n last_used: last_used,\n is_favorite: favorite,\n subMenu_data: ((aType !== 'event')\n ? null\n : {\n client_id: aClient,\n event_id: aCode,\n parent: pMenu,\n parent_name: pSectionName,\n menu_name: activityRec.name\n }\n )\n };\n if (activityRec.preLoad) {\n let preLoad_code = uuid(8);\n returnRowObject.preLoad_code = preLoad_code;\n makeObservationList(Object.assign({}, returnRowObject, returnRowObject.activity_rec), state.session)\n .then(resolvedActivity => {\n resolvedActivity.activityRec.name = returnRowObject.activity_name;\n prepareDefaults(resolvedActivity.activityRec)\n .then(response => {\n [resolvedActivity.activityRec.default_value, resolvedActivity.activityRec.default_object] = response;\n dbClient\n .put({\n TableName: 'PreLoads',\n Item: {\n client_id: state.session.client_id,\n preLoad_key: preLoad_code,\n preLoad_data: resolvedActivity\n }\n })\n .promise()\n .catch(error => {\n console.log(`error preloading ${resolvedActivity.activityRec.name} (${returnRowObject.code}) as preload_code ${preLoad_code}`, error.message);\n });\n console.log(`done with preload for ${resolvedActivity.activityRec.name} (${returnRowObject.code}) as preload_code ${preLoad_code}`);\n })\n });\n };\n return returnRowObject;\n };\n\n async function prepareDefaults(fact) {\n let excludeList = ['reservation', 'play_video'];\n let returnArray = [];\n let returnObject = {};\n if (!fact.default_value) { return [returnArray, returnObject]; }\n if (excludeList.includes(fact.activity_rec?.type) || excludeList.includes(fact.type)) {\n return [fact.default_value, { default: fact.default_value }];\n }\n if (fact.activity_rec?.type === 'make_message') {\n\n }\n\n // check for default values in the person's record\n if (state.patient.hasOwnProperty('defaultValues')) {\n let pDefaults = state.patient.defaultValues;\n for (let key in pDefaults) {\n returnArray.push(`private~${key}=${pDefaults[key]}`);\n }\n }\n // now pull in default values associated with this specific function call\n let defaultValues = {};\n if (isObject(fact.default_value)) {\n defaultValues = Object.assign({}, fact.default_value);\n }\n else {\n // old style is a string of key/value pairs (in the form key=value) separated by \" ~ \"\n makeArray(fact.default_value, /\\s~|~\\s/g).forEach((d, x) => {\n if (d.includes('=')) {\n let dO = d.split('=');\n defaultValues[dO[0]] = dO[1];\n }\n else {\n // a value may not be in the form key=value; in this case, just use value\n defaultValues[`_key_${x}`] = d;\n }\n });\n }\n for (let dField in defaultValues) {\n let dValue = await resolveDefaults(fact, dField, defaultValues[dField]);\n // we're returning an array and an object, they are duplicates of one another and consumed as needed by their targets\n // each entry is a default value which could be:\n // a string alone (as in \"myDefault\")\n // a string with some field name (as in \"requestType=myDefault\")\n // an object (as in {requestType: myDefault, peopleList: [person1, person2, ...], ...})\n let rKey;\n let k = dField.match(/_key_(.*)/);\n if (k) { // if no field name was specified\n rKey = `d${k[1]}`;\n }\n else {\n rKey = (dField.split('.')).pop();\n }\n returnObject[rKey] = dValue;\n if (typeof dValue !== 'string') {\n returnArray.push({ [rKey]: dValue });\n }\n else {\n returnArray.push(`${k ? '' : (rKey + '=')}${dValue}`);\n }\n }\n return [returnArray, returnObject];\n }\n\n\n async function resolveDefaults(fact, this_key, this_value) {\n if (typeof (this_value) !== 'string') {\n let workObj = deepCopy(this_value);\n for (let aKey in workObj) {\n workObj[aKey] = await resolveDefaults(fact, aKey, workObj[aKey]);\n }\n workObj = await specialCases(this_key, workObj);\n return workObj;\n }\n let a = this_value.split('.');\n // if there are two or more \".\" in the value, use the value itself \n if (a.length > 2) {\n return this_value;\n }\n let dValue = await resolveVariables(a.pop(), state.session, { ignoreArrayCheck: true });\n // if anything remains in array a (after the pop above), the value was in the form instruction=value\n // we'll act as per that instruction here\n if (a.length > 0) {\n dValue = await specialCases(a[0], dValue);\n }\n return dValue;\n\n async function specialCases(key, dValue) {\n switch (key) {\n case 'people': {\n let factClient;\n if (fact.activity_rec.client_id) { factClient = fact.activity_rec.client_id; }\n else if (fact.activity_code.includes('//')) { factClient = fact.activity_code.split('//')[0]; }\n else { factClient = state.session.client_id; }\n dValue = await getMemberList(makeArray(dValue, ','), factClient, { sort: true, shortList: true });\n break;\n }\n case 'person': {\n if (dValue === 'patientRec') {\n dValue = state.patient;\n }\n else if (dValue === 'userRec') {\n dValue = state.user;\n }\n else {\n dValue = {\n 'peopleList': [state.patient]\n };\n }\n break;\n }\n case 'select': {\n if (dValue === 'accessList' && state.accessList) {\n dValue = {\n 'selectionList': state.accessList[state.session.client_id].shortList\n };\n }\n else if (state.patients) {\n dValue = state.patients;\n }\n else {\n let targetObj = await prepareTargets(state.session.patient_id, state.session.client_id, { includeGroups: true });\n dValue = targetObj.responsibleList.sort();\n }\n break;\n }\n case 'events': {\n dValue = deepCopy(state.calendar);\n break;\n }\n case 'activities': {\n // activities dValue is an object with\n // global_defaults - pass to every column\n // column_list - an array with info about each column to return\n // response entries will be resolved activities (with observation records prepared as per the instructions in the array element)\n // each element is an object with\n // activity_id - optional; if missing use the activity_id that this is a part of\n // column_defaults - add these to the global defaults when resolving and handling the activity\n let responseArray = [];\n let global_defaults = dValue.global_defaults;\n if (!dValue.hasOwnProperty('column_list') || (dValue.column_list.length === 0)) {\n let column_defaults = Object.assign({}, global_defaults);\n let column_object = deepCopy(await makeObservationList(fact.activity_code, state.session, column_defaults));\n column_object.column_defaults = column_defaults;\n responseArray.push(column_object);\n }\n else {\n for (let m = 0; m < dValue.column_list.length; m++) {\n let column_defaults = Object.assign({}, global_defaults, dValue.column_list[m].column_defaults);\n let column_object = deepCopy(await makeObservationList(dValue.column_list[m].activity_id, state.session, column_defaults));\n column_object.column_defaults = column_defaults;\n responseArray.push(column_object);\n }\n }\n dValue = responseArray;\n break;\n }\n default: {\n if (key && (typeof (dValue) === 'string') && (key !== 'default')) {\n dValue = `${key}.${dValue}`;\n }\n }\n }\n return dValue;\n }\n }\n\n async function getActivity(pActivityCode) {\n if (isObject(pActivityCode)) {\n let aResolved = await getActivityFromObject(pActivityCode);\n activityObj[pActivityCode] = aResolved;\n return aResolved;\n }\n if (pActivityCode in activityObj) { return activityObj[pActivityCode]; }\n let pClient = masterClient;\n let addClient = false;\n let overrideDefault, overrideTitle;\n let parts = pActivityCode.split('~[');\n let pActivity = parts[0];\n if (pActivity.includes('//')) {\n [pClient, pActivity] = pActivity.split('//');\n addClient = true;\n }\n for (let p = 1; p < parts.length; p++) {\n // let [iType, iData] = parts[p].split(/[<>=%\\]]/);\n let [iType, iData] = parts[p].split(/[=\\]]/);\n switch (iType) {\n case 'default': {\n overrideDefault = await resolveVariables(iData, { client_id: pClient, patient_id: pPerson, user_id: pPerson });\n if (overrideDefault.charAt(0) === '[') {\n overrideDefault = makeArray(overrideDefault);\n }\n break;\n }\n case 'title': {\n overrideTitle = await resolveVariables(iData, { client_id: pClient, patient_id: pPerson, user_id: pPerson });;\n break;\n }\n case 'env': {\n if ((iData.toLowerCase() === 'test') && (!['T', 'L'].includes(ava_env))) { return {}; }\n else if ((iData.toLowerCase() === 'dev') && (ava_env !== 'D')) { return {}; }\n break;\n }\n case 'vers':\n case 'rel':\n case 'version':\n case 'release': {\n let checkVer = makeVersion(iData);\n if (checkVer >= 999900) {\n if (!['T', 'L'].includes(ava_env)) { // special case; vers 9999.99 only runs in test envs\n return {};\n }\n }\n else if ((parts[p].includes('<') && (ava_version_number >= checkVer))\n || (parts[p].includes('>') && (ava_version_number <= checkVer))\n || (parts[p].includes('=') && (checkVer !== ava_version_number))) {\n activityObj[pActivityCode] = {};\n return {};\n }\n break;\n }\n case 'date': {\n let checkDate = makeNumber(iData);\n if ((parts[p].includes('<') && (todays_numeric_date >= checkDate))\n || (parts[p].includes('>') && (todays_numeric_date <= checkDate))\n || (parts[p].includes('=') && (checkDate !== todays_numeric_date))) {\n activityObj[pActivityCode] = {};\n return {};\n }\n break;\n }\n default: { break; }\n }\n }\n let aRecs = await dbClient\n .get({\n Key: {\n client_id: pClient,\n activity_code: pActivity\n },\n TableName: 'Activities'\n })\n .promise()\n .catch(error => {\n clt(`Error reading Activities is ${error}.`);\n });\n if (recordExists(aRecs)) {\n if (addClient) { aRecs.Item.activity_code = `${pClient}//${pActivity}`; };\n if (overrideDefault) {\n if (!('validation' in aRecs.Item)) { aRecs.Item.validation = {}; }\n aRecs.Item.validation.default_value = overrideDefault;\n }\n if (overrideTitle) {\n aRecs.Item.name = overrideTitle;\n }\n activityObj[pActivityCode] = aRecs.Item;\n return aRecs.Item;\n }\n activityObj[pActivityCode] = {};\n return {};\n }\n\n async function getActivityFromObject(pActivityObj) {\n let pClient = pActivityObj.client || masterClient;\n let addClient = !(pClient === masterClient);\n let overrideDefault, overrideTitle;\n let pActivity = pActivityObj.activity_code || pActivityObj.activity;\n\n for (let [iType, iData] of Object.entries(pActivityObj)) {\n iData = await deepResolve(iData, { client_id: pClient, patient_id: pPerson, user_id: pPerson });\n switch (iType) {\n case 'default': {\n overrideDefault = iData;\n break;\n }\n case 'title': {\n overrideTitle = iData;\n break;\n }\n case 'env': {\n if ((iData.toLowerCase() === 'test') && (!['T', 'L'].includes(ava_env))) { return {}; }\n else if ((iData.toLowerCase() === 'dev') && (ava_env !== 'D')) { return {}; }\n break;\n }\n case 'vers':\n case 'rel':\n case 'version':\n case 'release': {\n let checkVer = makeVersion(iData);\n if (checkVer >= 9999) {\n if (!['T', 'L'].includes(ava_env)) { // special case; vers 9999.99 only runs in test envs\n return {};\n }\n }\n else if ((iData.includes('<') && (ava_version_number >= checkVer))\n || (iData.includes('>') && (ava_version_number <= checkVer))\n || (iData.includes('=') && (checkVer !== ava_version_number))) {\n return {};\n }\n break;\n }\n case 'date': {\n let checkDate = makeNumber(iData);\n if ((iData.includes('<') && (todays_numeric_date >= checkDate))\n || (iData.includes('>') && (todays_numeric_date <= checkDate))\n || (iData.includes('=') && (checkDate !== todays_numeric_date))) {\n return {};\n }\n break;\n }\n default: { break; }\n }\n }\n let aRecs = await dbClient\n .get({\n Key: {\n client_id: pClient,\n activity_code: pActivity\n },\n TableName: 'Activities'\n })\n .promise()\n .catch(error => {\n clt(`Error reading Activities is ${error}.`);\n });\n if (recordExists(aRecs)) {\n if (addClient) { aRecs.Item.activity_code = `${pClient}//${pActivity}`; };\n if (overrideDefault) {\n if (!('validation' in aRecs.Item)) {\n aRecs.Item.validation = {\n default_value: deepCopy(overrideDefault)\n };\n }\n else {\n if ((aRecs.Item.validation.default_value) && (!isObject(aRecs.Item.validation.default_value))) {\n let a1 = aRecs.Item.validation.default_value.split('.');\n let a2 = a1.pop();\n let a3 = makeArray(a2, '~');\n let a4 = makeObject(a3);\n aRecs.Item.validation.default_value = a4;\n }\n aRecs.Item.validation.default_value = deepCopy(Object.assign({}, aRecs.Item.validation.default_value, overrideDefault));\n }\n }\n if (overrideTitle) {\n aRecs.Item.name = overrideTitle;\n }\n return aRecs.Item;\n }\n return {};\n }\n\n async function getGroupsPersonBelongsTo(neededGroupArray) {\n // ({ 'in getGroupsPersonBelongsTo': { pPerson } });\n let batchGetRequest = {\n RequestItems: {\n 'Groups': {\n Keys: []\n }\n }\n };\n\n // requestor.groups was unexpectedly found to have duplicate entries in one instance\n // When that happened, this batchGetRequest would fail and no menu was rendered at all\n // the code \"[...new Set(requestor.groups)]\" assures that unique values only are considered\n [...new Set(neededGroupArray)].forEach(g => {\n batchGetRequest.RequestItems.Groups.Keys.push(\n {\n client_id: masterClient,\n group_id: g\n }\n );\n });\n let groupRecs = await dbClient\n .batchGet(batchGetRequest)\n .promise()\n .catch(error => {\n clt({ 'Bad get on Groups - caught error is': error });\n });\n if (groupRecs && ('Responses' in groupRecs)) {\n return groupRecs.Responses.Groups;\n }\n else { return []; }\n }\n\n}; // end\n","import React from 'react';\nimport { Auth } from '@aws-amplify/auth';\nimport { useSnackbar } from 'notistack';\nimport { recordExists, isObject, cl, switchActiveAccount, makeArray, s3, dbClient, lambda } from '../../util/AVAUtilities';\nimport { makeDate, makeTime } from '../../util/AVADateTime';\nimport { getImage } from '../../util/AVAPeople';\nimport { getActivityDetail } from '../../util/AVAActivityLoader';\nimport { AVATextStyle, AVADefaults, hexToRgb } from '../../util/AVAStyles';\nimport AVACarousel from '../dialogs/AVACarousel';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n// import useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport { useCookies } from 'react-cookie';\nimport { useIdleTimer } from 'react-idle-timer';\nimport useSession from '../../hooks/useSession';\nimport SwitchPatientDialog from '../dialogs/SwitchPatientDialog';\nimport StaffAccess from '../dialogs/StaffAccess';\nimport PatientDialog from '../dialogs/PatientDialog';\nimport NewFactDialog from '../dialogs/NewFactDialog';\nimport AVAConfirm from '../forms/AVAConfirm';\nimport MakeAVAMenu from '../../util/MakeAVAMenu';\n\nimport List from '@material-ui/core/List';\nimport Box from '@material-ui/core/Box';\nimport Avatar from '@material-ui/core/Avatar';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport IconButton from '@material-ui/core/IconButton';\nimport Dialog from '@material-ui/core/Dialog';\n\nimport Menu from '@material-ui/core/Menu';\nimport MenuList from '@material-ui/core/MenuList';\nimport MenuItem from '@material-ui/core/MenuItem';\n\nimport EditIcon from '@material-ui/icons/PersonOutlineOutlined';\nimport FavoriteIcon from '@material-ui/icons/FavoriteBorder';\nimport NotFavorite from '@material-ui/icons/DeleteForever';\nimport ExitToAppIcon from '@material-ui/icons/ExitToApp';\nimport SwapHorizIcon from '@material-ui/icons/SwapHoriz';\nimport SubscriptionIcon from '@material-ui/icons/CardMembership';\nimport HomeIcon from '@material-ui/icons/Home';\nimport AutorenewIcon from '@material-ui/icons/Autorenew';\nimport NewReleasesOutlinedIcon from '@material-ui/icons/NewReleasesOutlined';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport PersonAddIcon from '@material-ui/icons/PersonAdd';\n\nimport Tooltip from '@material-ui/core/Tooltip';\n\nconst useStyles = makeStyles(theme => ({\n page: {\n height: 950,\n maxWidth: 1000\n },\n progressBar: {\n marginBottom: theme.spacing(3),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px'\n },\n pendingBar: {\n marginRight: theme.spacing(2.2),\n marginTop: theme.spacing(1),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px',\n alignSelf: 'flex-end'\n },\n freeInput: {\n marginLeft: '25px',\n marginRight: 2,\n marginBottom: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: theme.spacing(1),\n width: '60%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n },\n avatar: {\n marginTop: 0,\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(1),\n marginBottom: 0,\n height: 60,\n width: 60,\n paddingTop: 0,\n fontSize: '1.3rem',\n },\n logoSmall: {\n maxWidth: '100px',\n marginBottom: '15px'\n },\n popUpMenuButton: {\n alignContent: 'center',\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n paddingTop: 0,\n fontSize: '1.3rem',\n },\n popUpMenu: {\n marginRight: theme.spacing(3),\n paddingRight: 2,\n },\n title: {\n marginTop: 0,\n marginLeft: 0,\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n hello: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: 0,\n fontSize: theme.typography.fontSize * 1.5,\n },\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n rowButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'contained',\n size: 'small'\n },\n rowButtonDefault: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n color: theme.palette.reject[theme.palette.type],\n },\n rowButtonGreen: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n },\n rowButtonBlue: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n },\n listItem: {\n justifyContent: 'space-between',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(1),\n },\n sectionHeader: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n },\n messageArea: {\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n profileArea: {\n alignItems: 'center'\n },\n popUpMenuRow: {\n marginLeft: theme.spacing(1),\n fontSize: theme.typography.fontSize * 1.0,\n },\n popUpFooter: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n logoDisplay: {\n maxWidth: '600px',\n },\n\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n makeIconStyle: {\n marginRight: theme.spacing(1),\n },\n locationLine: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n preferenceLine: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n techInfoLine: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(2),\n },\n techInfoLine2: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(4),\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n lastName: {\n fontWeight: 'bold',\n marginRight: theme.spacing(1),\n },\n boldCenter: {\n fontWeight: 'bold',\n textAlign: 'center'\n }\n}));\n\nexport default ({ pPerson, patient, defaultClient, onReset }) => {\n\n const classes = useStyles();\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n\n const { state } = useSession();\n const { roles, session } = state;\n\n const [selected, setSelected] = React.useState(null);\n\n const [, , removeCookie] = useCookies(['AVAuser']);\n\n const [mainMenu, setMainMenu] = React.useState([]);\n const [greetingName, setGreetingName] = React.useState('');\n const [greetingWords, setGreetingWords] = React.useState('');\n const [confirmMessage, setConfirmMessage] = React.useState('');\n const [pendingFact, setPendingFact] = React.useState('');\n\n const [currentMenu, setCurrentMenu] = React.useState('main');\n const [menuArray, setMenuArray] = React.useState(['main']);\n const [menuNames, setMenuNames] = React.useState([]);\n const [sectionOpen, setSectionOpen] = React.useState();\n const [showPersonSelect, setShowPersonSelect] = React.useState(false);\n const [showStaffAccess, setShowStaffAccess] = React.useState(false);\n const [showProfileEdit, setShowProfileEdit] = React.useState(false);\n const [showAddAccount, setShowAddAccount] = React.useState(false);\n const [showNewFactDialog, setShowNewFactDialog] = React.useState(-1);\n const [needsConfirmation, setNeedsConfirmation] = React.useState(-1);\n const [toggleClick, setToggleClick] = React.useState(false);\n const [popupMenuOpen, setPopupMenuOpen] = React.useState(false);\n const [anchorEl, setAnchorEl] = React.useState(null);\n const [groupData, setGroupData] = React.useState({});\n\n const [loading, setLoading] = React.useState('Initializing');\n const [progress, setProgress] = React.useState(100);\n const [pWidth, setPWidth] = React.useState(60);\n\n const [reactData, setReactData] = React.useState({\n lastActiveTime: new Date(),\n idleState: true,\n menu_reloaded: false,\n loadedMenuVersion: 1\n });\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n\n let currentSection = '';\n\n const oneMinute = 1000 * 60;\n const oneHour = 60 * oneMinute;\n const msBeforeSleeping = 1 * oneMinute;\n\n const subMenuHead = React.useRef(null);\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n const avatarStyle = {\n width: `${(30 * user_fontSize)}px`,\n height: `${(30 * user_fontSize)}px`\n };\n\n const onIdle = async () => {\n cl(`Idle fired at ${new Date().toLocaleString()}. Last active at ${reactData.lastActiveTime.toLocaleString()}.`);\n let now = new Date();\n if ((now.getTime() - reactData.lastActiveTime.getTime()) > oneHour) {\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${now.getTime()}`);\n }\n else if (!reactData.menu_reloaded) {\n await checkReload();\n }\n updateReactData({\n idleState: true,\n }, true);\n reset();\n };\n\n const checkReload = async () => {\n let menuRec = await dbClient\n .get({\n Key: { person_id: pPerson },\n TableName: \"AVAMenu\"\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n enqueueSnackbar(`There is no internet connection.`, { variant: 'error', persist: true });\n }\n cl(`caught error getting People record; error is:`, error);\n });\n if (recordExists(menuRec) && (menuRec.Item.menu_version !== reactData.loadedMenuVersion)) {\n if ((menuRec.Item.AVA_main_menu.length > 0)) {\n setMainMenu(menuRec.Item.AVA_main_menu);\n }\n cl(`Completed AVA Menu reload`);\n updateReactData({\n menu_reloaded: true,\n loadedMenuVersion: menuRec.Item.menu_version\n }, true);\n }\n };\n\n const onAction = async () => {\n let now = new Date();\n if (reactData.idleState) {\n cl(`Action at ${now.toLocaleString()}. Was idle since ${new Date(getLastActiveTime()).toLocaleString()}`);\n }\n if (!reactData.menu_reloaded) {\n await checkReload();\n }\n updateReactData({\n lastActiveTime: now,\n idleState: false\n }, false);\n reset();\n };\n\n const { start, reset, getLastActiveTime } = useIdleTimer({\n onIdle,\n onAction,\n timeout: msBeforeSleeping,\n throttle: 500\n });\n\n let nowTime = new Date().getTime();\n\n const buildMenu = async (reload = false, beQuiet = null) => {\n setSectionOpen({});\n\n // reload = true;\n\n // AVA_section_open in People record, or (legacy code) current_event in SessionV2 record\n // is used to save what the screen looked like last time the user was in AVA\n let menuRec = await dbClient\n .get({\n Key: { person_id: pPerson },\n TableName: \"AVAMenu\"\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n enqueueSnackbar(`There is no internet connection.`, { variant: 'error', persist: true });\n }\n cl(`caught error getting People record; error is:`, error);\n });\n if (recordExists(menuRec)) {\n updateReactData({ loadedMenuVersion: menuRec.Item.menu_version }, false);\n setSectionOpen(menuRec.Item.AVA_section_open || {});\n if ((menuRec.Item.AVA_main_menu.length > 0) && !reload) {\n setMainMenu(menuRec.Item.AVA_main_menu);\n return menuRec.Item.AVA_main_menu;\n }\n }\n\n // we are going to have to build their menu for the first time...\n let forceRefresh = true;\n let wholeMenu = await MakeAVAMenu(patient, defaultClient, (beQuiet ? screenQuiet : screenStatus), null, forceRefresh, state);\n\n if (wholeMenu.length > 0) {\n // cl(`Reloaded menu at ${new Date().toLocaleString()}.`);\n await updateAVA(sectionOpen, wholeMenu);\n setMainMenu(wholeMenu);\n return wholeMenu;\n }\n else {\n // cl(`Empty menu for ${patient} in ${defaultClient} at ${new Date().toLocaleString()}.`);\n enqueueSnackbar(`AVA didn't find any options for you. Ask AVA Support to check on this.`,\n { variant: 'error', persist: true }\n );\n let helpRow = {\n activity_code: 'message.chubbie_request',\n activity_name: 'Send a message to AVA Support',\n child_menu: null,\n default_value: null,\n menu_name: 'help',\n parent_menu: null,\n row_color: '#a1adb8',\n row_type: 'message',\n section_color: '#a1adb8',\n section_icon: 'https://ava-icons.s3.amazonaws.com/icons8-new-message-50.png',\n section_name: 'Get AVA Help',\n sort_key: 'Messages, Comments, and Feedback'\n };\n setSectionOpen({ 'Get AVA Help': true });\n setMainMenu([helpRow]);\n }\n // end\n return mainMenu;\n };\n\n const updateAVA = async (pOpen, pMenu) => {\n if (pOpen) {\n dbClient\n .update({\n Key: { person_id: pPerson },\n UpdateExpression: 'set AVA_section_open = :o',\n ExpressionAttributeValues: {\n ':o': pOpen\n },\n TableName: \"AVAMenu\",\n })\n .promise()\n .catch(error => {\n cl(`AVA couldn't update your Menu settings. Error is ${error}`);\n });\n dbClient\n .update({\n Key: { session_id: session.user_id },\n UpdateExpression: 'set current_event = :e',\n ExpressionAttributeValues: {\n ':e': JSON.stringify(pOpen)\n },\n TableName: \"SessionsV2\",\n })\n .promise()\n .catch(error => { cl(`caught error updating SessionsV2; error is:`, error); });\n }\n start();\n };\n\n async function putS3Object(pMediaData, pType) {\n /*\n pMediaData = {\n Bucket: 'theseus-medical-storage',\n Key: fName,\n Body: fObj,\n ACL: 'public-read-write',\n ContentType: fObj.type,\n Metadata: { 'Content-Type': fObj.type }\n }\n */\n let buff, buffer;\n let fileSize = 1;\n let forceSingle = false;\n try {\n buff = await pMediaData.Body.arrayBuffer();\n buffer = new Float32Array(buff, 4, 4);\n fileSize = buffer.length;\n }\n catch {\n enqueueSnackbar(`${pMediaData.Key} is really big. This may take a few minutes...`, { variant: 'error', persist: false });\n forceSingle = true;\n }\n\n let uploadId;\n try {\n // Multipart upload will pass chunks of 10Mb\n let partSize = 10000000;\n let numberOfParts = 10;\n if (fileSize > (partSize * numberOfParts)) { partSize = fileSize / 10; }\n else { numberOfParts = Math.ceil(fileSize / partSize); }\n\n if ((numberOfParts === 1) || forceSingle) {\n enqueueSnackbar(`AVA is saving your ${pType.toLowerCase()} with the name ${pMediaData.Key}`, { variant: 'info', persist: false });\n let uploadOK = true;\n await s3\n .putObject(pMediaData)\n .promise()\n .catch(err => {\n uploadOK = false;\n enqueueSnackbar(`Uh oh! AVA couldn't save that. The reason is ${err.message}`,\n { variant: 'error', persist: true });\n });\n if (uploadOK) {\n closeSnackbar();\n enqueueSnackbar(`${pMediaData.Key} was saved successfully`, { variant: 'success', persist: true });\n return pMediaData.Key;\n };\n return null;\n }\n\n // this is a multi-part load\n enqueueSnackbar(`AVA broke your ${pType.toLowerCase()} with the name ${pMediaData.Key} into ${numberOfParts} pieces and is uploading them now`, { variant: 'info', persist: false });\n let upParms = {\n Bucket: pMediaData.Bucket,\n Key: pMediaData.Key,\n ACL: pMediaData.ACL,\n ContentType: pMediaData.ContentType,\n Metadata: pMediaData.MetaData\n };\n let mpUp = await s3.createMultipartUpload(upParms).promise();\n uploadId = mpUp.UploadId;\n\n const uploadPromises = [];\n // Upload each part.\n for (let i = 0; i < numberOfParts; i++) {\n const start = i * partSize;\n const end = start + partSize;\n let uPartParm = {\n Bucket: pMediaData.Bucket,\n Key: pMediaData.Key,\n UploadId: uploadId,\n Body: buffer.subarray(start, end),\n PartNumber: i + 1,\n };\n uploadPromises.push(s3.uploadPart(uPartParm).promise());\n }\n\n const uploadResults = await Promise.all(uploadPromises);\n let upDone = {\n Bucket: pMediaData.Bucket,\n Key: pMediaData.Key,\n UploadId: uploadId,\n MultipartUpload: {\n Parts: uploadResults.map(({ ETag }, i) => ({\n ETag,\n PartNumber: i + 1,\n })),\n }\n };\n let s3Resp = await s3.completeMultipartUpload(upDone).promise();\n enqueueSnackbar(`All parts of ${s3Resp.Key} were saved successfully to ${s3Resp.Location}`, { variant: 'success', persist: true });\n return pMediaData.Key;\n\n // Verify the output by downloading the file from the Amazon Simple Storage Service (Amazon S3) console.\n // Because the output is a 25 MB string, text editors might struggle to open the file.\n } catch (err) {\n console.error(err);\n enqueueSnackbar(`That didn't work. ${err}`, { variant: 'error', persist: true });\n if (uploadId) {\n let s3Bad = await s3.abortMultipartUpload({\n Bucket: pMediaData.Bucket,\n Key: pMediaData.Key,\n UploadId: uploadId,\n }).promise();\n console.log(s3Bad);\n }\n return null;\n }\n };\n\n const screenQuiet = (statusMessage) => {\n return;\n };\n\n const screenStatus = (statusMessage, progressPct, progressWidth, interimMenu) => {\n setLoading(statusMessage);\n setProgress(progressPct);\n setPWidth(progressWidth * 100);\n setForceRedisplay(!forceRedisplay);\n if (interimMenu) {\n setMainMenu(interimMenu);\n }\n };\n\n const updateFavorites = async (pType, activityRowIndex) => {\n setLoading('Resetting your Favorites');\n setForceRedisplay(!forceRedisplay);\n makeGreeting();\n let activityRow = mainMenu[activityRowIndex];\n let activityLine = activityRow.raw_data;\n // let activityLine = activityRow.activity_code;\n // if (activityRow.default_value) { activityLine += `~[default=${activityRow.default_value}]`; }\n // if (activityRow.activity_name) { activityLine += `~[title=${activityRow.activity_name}]`; }\n let changeMade = false;\n let personRec = await dbClient\n .get({\n Key: { person_id: pPerson },\n TableName: \"People\"\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n enqueueSnackbar(`There is no internet connection.`, { variant: 'error', persist: true });\n }\n cl(`caught error getting People record; error is:`, error);\n });\n if (recordExists(personRec)) {\n // add or remove from the favoriteList as appropriate\n let favoriteList = [];\n if ('favorite_activities' in personRec.Item) {\n favoriteList = personRec.Item.favorite_activities;\n }\n let indexAt = favoriteList.findIndex(r => {\n if (typeof (r) === 'string') {\n return (r.split('~')[0] === activityRow.activity_code);\n }\n else {\n return (r.activity_code === activityRow.activity_code);\n }\n });\n if ((indexAt === -1) && (pType === 'add')) {\n favoriteList.unshift(activityLine);\n changeMade = true;\n }\n else if (pType === 'remove') {\n favoriteList.splice(indexAt, 1);\n changeMade = true;\n }\n // remove from the blockedList if it is in there\n let favoriteBlocked = [];\n if ('favorite_blocked' in personRec.Item) {\n favoriteBlocked = personRec.Item.favorite_blocked;\n }\n indexAt = favoriteBlocked.findIndex(r => {\n if (typeof (r) === 'string') {\n return (r.split('~')[0] === activityRow.activity_code);\n }\n else {\n return (r.activity_code === activityRow.activity_code);\n }\n });\n if ((indexAt === -1) && (pType === 'remove')) {\n favoriteBlocked.push(activityLine);\n changeMade = true;\n }\n else if (pType === 'add') {\n favoriteBlocked.splice(indexAt, 1);\n changeMade = true;\n }\n // rewrite the People record with the new favorite and blocked lists\n if (changeMade) {\n await dbClient\n .update({\n Key: { person_id: pPerson },\n UpdateExpression: 'set favorite_activities = :f, favorite_blocked = :b',\n ExpressionAttributeValues: {\n ':f': favoriteList,\n ':b': favoriteBlocked\n },\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n enqueueSnackbar(`AVA couldn't update your Favorites. Error is ${error}`,\n { variant: 'error', persist: true }\n );\n return;\n });\n if (pType === 'add') {\n mainMenu[activityRowIndex].is_favorite = true;\n mainMenu.unshift({\n menu_name: 'main',\n sort_key: `**2-0000`,\n section_name: (mainMenu[0].section_name.includes('favorites')\n ? mainMenu[0].section_name\n : `My Favorites`\n ),\n section_color: '#6bb44b',\n section_icon: 'https://ava-icons.s3.amazonaws.com/icons8-favorite-50.png',\n row_color: '#6bb44b',\n activity_code: activityRow.activity_code,\n activity_name: activityRow.activity_name,\n activity_class: activityRow.activity_class,\n row_type: activityRow.row_type,\n default_value: activityRow.default_value || null,\n parent_menu: null,\n child_menu: activityRow.child_menu,\n reason: 'Favorite',\n last_used: activityRow.last_used,\n is_favorite: true\n });\n }\n else {\n mainMenu.splice(activityRowIndex, 1);\n };\n }\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n setMainMenu(mainMenu);\n setLoading(false);\n setForceRedisplay(!forceRedisplay);\n };\n return;\n };\n\n const onSaveFact = async (pFact, pFactName, pIndex) => {\n if (pFact.activity_key.includes('//')) {\n [pFact.client_id, pFact.activity_key] = pFact.activity_key.split('//');\n }\n if (typeof (pFact.value) === 'string') { putFact(pFact, pFactName, pIndex); }\n else {\n let factFlavor = pFact.activity_key.split('.')[0];\n if (factFlavor !== 'action'\n && pFact.value.hasOwnProperty('selected')\n ) {\n setPendingFact(pFact);\n let foundText = [];\n let valueArray = pFact.value.selected.map(selection => { // this adds anything that was selected (checkbox)\n // add qualifiers if applicable\n let constructedQualifier = '';\n if (pFact.value.qualifiers && (selection in pFact.value.qualifiers)) {\n let qArray = [];\n Object\n .keys(pFact.value.qualifiers[selection])\n .forEach(key => {\n if (pFact.value.qualifiers[selection][key].length > 0) {\n qArray.push(`${key}: ${pFact.value.qualifiers[selection][key].join(' and ')}`);\n }\n });\n if (qArray.length > 0) { constructedQualifier = ` ( ${qArray.join('; ')} )`; }\n }\n if (pFact.value.freeText && pFact.value.freeText.hasOwnProperty(selection)) {\n let freeText = pFact.value.freeText[selection];\n foundText.push(selection); // we might have free text that is NOT associated with a check box, use foundText to prevent duplication\n return `${selection} = ${freeText}${constructedQualifier}`;\n }\n else {\n return `${selection}${constructedQualifier}`;\n }\n });\n for (const key in pFact.value.freeText) {\n if (key !== '%filter%' && !foundText.includes(key)) {\n let constructedQualifier = '';\n if (pFact.value.qualifiers && (key in pFact.value.qualifiers)) {\n let qArray = [];\n Object\n .keys(pFact.value.qualifiers[key])\n .forEach(subkey => {\n if (pFact.value.qualifiers[key][subkey].length > 0) {\n return `${subkey}: ${pFact.value.qualifiers[key][subkey].join(' and ')}`;\n }\n });\n if (qArray.length > 0) { constructedQualifier = ` ( ${qArray.join('; ')} )`; }\n }\n valueArray.push(`${key} = ${pFact.value.freeText[key]}${constructedQualifier}`);\n }\n }\n\n let factValueType = 'selection';\n\n // special cases include forms, messages, and media\n if (factFlavor === 'form' || factFlavor === 'message') {\n if (pFact.status !== 'confirmed') {\n let cMessage = [\n 'Review & Confirm please',\n pFactName];\n if (valueArray.length > 0) {\n cMessage.push(\n '~~~~',\n 'Your selections are:',\n );\n valueArray.forEach(v => {\n if (v.charAt(0) !== '~') { cMessage.push(v.split(/:/)[0]); }\n });\n }\n setConfirmMessage(cMessage);\n setNeedsConfirmation(pIndex);\n return;\n }\n else {\n factValueType = 'form_selections';\n }\n }\n if (pFact.value.mediaData) {\n let newName = pFact.value?.freeText?.Title || pFact.value.mediaData.Key;\n let fileExtension = pFact.value.mediaData.Key.split('.').pop();\n pFact.value.mediaData.Key = newName.trim().replace(/[\\s/.]/g, '_') + '.' + fileExtension;\n let fileType = ((pFact.value.mediaData.ContentType?.includes('video') || pFact.value.mediaData.Body?.type?.includes('video')) ? 'Video' : 'File');\n let fileName = await putS3Object(pFact.value.mediaData, fileType);\n valueArray.unshift(`s3file=${fileName}`, fileType, `userTag=${pFact.value.tag}`);\n factValueType = 'file_details';\n }\n\n // set the value that will be written into the Fact table\n pFact.value = factValueType + '.' + valueArray.join(' ~ ');\n\n // write the Fact Table entry\n putFact(pFact, pFactName, pIndex);\n }\n };\n setShowNewFactDialog(-1);\n setForceRedisplay(!forceRedisplay);\n };\n\n const onNextFact = async () => {\n setShowNewFactDialog(-1);\n setForceRedisplay(!forceRedisplay);\n };\n\n React.useEffect(() => {\n if (subMenuHead && subMenuHead.current) {\n subMenuHead.current.scrollIntoView({\n behavior: 'smooth',\n block: 'end',\n });\n }\n }, [currentMenu]);\n\n React.useEffect(() => {\n let response = (\n async () => {\n setLoading('Getting your Information');\n setForceRedisplay(!forceRedisplay);\n makeGreetingName(patient.hasOwnProperty('name') ? patient.name.first : (session.patient_display_name || pPerson));\n makeGreeting();\n setLoading('Building your AVA menu');\n setForceRedisplay(!forceRedisplay);\n await buildMenu();\n setLoading(false);\n setForceRedisplay(!forceRedisplay);\n }\n );\n if (mainMenu.length === 0) {\n response();\n }\n }, [pPerson]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const accessLog = async (pUser, pPwd, pMessage) => {\n var payload =\n {\n 'test': false,\n 'action': \"add_entry\",\n 'request': {\n 'attempted_user': pUser,\n 'attempted_password': pPwd,\n 'result': pMessage\n }\n };\n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:AccessLogMaintenance',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: JSON.stringify(payload)\n };\n lambda\n .invoke(params)\n .promise()\n .catch(err => {\n cl('Access log call failed. Error is', JSON.stringify(err));\n });\n };\n\n const activityLog = async (pUser, pCode, pName, pIndex) => {\n let postTime = new Date().getTime();\n await dbClient\n .put({\n TableName: 'ActivityLog',\n Item: {\n timestamp: postTime,\n user_id: pUser,\n activity_code: pCode,\n activity_name: pName,\n AVA_version: `${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`\n }\n })\n .promise()\n .catch(error => {\n cl(`Bad put to ActivityLog - caught error is: ${error}`);\n });\n mainMenu[pIndex].last_used = postTime;\n setMainMenu(mainMenu);\n };\n\n const putFact = async (pFact, pFactName, pIndex) => {\n let postTime = new Date().getTime();\n const newFact = {\n person_id: pFact.patient_id,\n activity_key: (pFact.client_id ? ((pFact.client_id) + '//') : '') + pFact.activity_key + '#' + postTime,\n value: pFact.value,\n status: 'recorded',\n user_id: pPerson,\n session_id: ((needsConfirmation > -1) ? 'Confirmed' : 'Done'),\n method: 'AVAMenu',\n posted_time: postTime\n };\n if (pFact.value) {\n let valueArray = makeArray(pFact.value, '~');\n if (valueArray.length > 0) {\n newFact.valueObj = {};\n valueArray.forEach((val, ndx) => {\n if ((ndx === 0) && (val.includes('.'))) {\n val = val.split('.').slice(1).join('.');\n }\n let [key, value] = val.split(/=/);\n if (!value) {\n [key, value] = val.split(/:/);\n }\n if (!value) {\n value = key;\n key = `v_${ndx}`;\n }\n newFact.valueObj[key.trim()] = value.trim();\n });\n }\n }\n if (pFact.commonKey) {\n newFact.common_key = pFact.commonKey;\n newFact.request_id = pFact.commonKey;\n }\n await dbClient\n .put({\n TableName: 'Facts',\n Item: newFact\n })\n .promise()\n .catch(error => { console.error('Error adding a fact:', error.message); });\n if (pFactName.toLowerCase().includes('send a')) {\n enqueueSnackbar(`AVA is sending your ${pFactName.replace(/send a/i, '').trim()}.`, { variant: 'success' });\n }\n else if (pFact.commonKey) {\n enqueueSnackbar(`Your request is on the way!`, { variant: 'success' });\n }\n else {\n enqueueSnackbar(`Done!`, { variant: 'success' });\n }\n };\n\n function makeGreetingName(pString) {\n setGreetingName(pString || 'AVA User');\n return pString;\n }\n\n function makeExpiration() {\n let sessionObject = JSON.parse(sessionStorage.getItem('AVASessionData'));\n let sTime = new Date((sessionObject?.cognitoSession?.accessToken?.payload?.exp * 1000) || (nowTime + oneHour));\n return `Sess exp ${sTime.toLocaleDateString('en-US', {\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true\n })}`;\n }\n\n function makeGreeting() {\n if (session?.custom_greeting) {\n setGreetingWords(session.custom_greeting);\n return session.custom_greeting;\n }\n let response = `Good ${makeTime(new Date()).dayPart}`;\n setGreetingWords(response);\n return response;\n }\n\n function proxyAuthority() {\n if (state.accessList && state.accessList.hasOwnProperty(session.client_id) && state.accessList[session.client_id].hasOwnProperty('count')) {\n if ((state.accessList[session.client_id].count.proxy > 0) || (state.accessList[session.client_id].count.full > 0)) {\n return true;\n }\n }\n return false;\n }\n\n const createAccountAuthority = () => {\n if (state.accessList && state.accessList.hasOwnProperty(session.client_id) && state.accessList[session.client_id].hasOwnProperty('count')) {\n if (state.user?.account_class && (['master', 'support', 'admin'].includes(state.user.account_class))) {\n return true;\n }\n }\n return false;\n };\n\n const handleClick = async (event) => {\n setAnchorEl(event.currentTarget);\n };\n\n function rowIsOpen(pRow) {\n return (sectionOpen[pRow.section_name] || (currentMenu !== 'main'));\n }\n\n // ******************\n\n return (\n \n \n {/* Header with Avatar, Message, and VertMenu */}\n \n {\n if (!state.hasOwnProperty('groups') || !state.groups.hasOwnProperty('adminHierarchy')) {\n enqueueSnackbar(`AVA is still loading. Wait just a moment and try again, please.`, { variant: 'warning' });\n }\n else {\n setPopupMenuOpen(false);\n setGroupData(state.groups);\n setShowProfileEdit(true);\n }\n }}\n >\n \n {session?.kiosk_mode ? 'View/Update not available' : `View/Update ${greetingName}'${greetingName.slice(-1) === 's' ? '' : 's'} Profile`}\n \n }\n placement='bottom-start'>\n \n \n \n \n {`${greetingWords},`}\n \n \n {`${greetingName}!`}\n \n \n \n \n \n \n {`${makeDate(new Date()).dateOnly.split(',').pop().trim()}`}\n \n \n {`${makeDate(new Date()).timeOnly.split(' ').join('').toLowerCase()}`}\n \n \n \n \n {\n handleClick(event);\n setPopupMenuOpen(true);\n }}\n alt=''\n src={process.env.REACT_APP_AVA_LOGO}\n />\n {!reactData.menu_reloaded &&\n \n }\n \n { setPopupMenuOpen(false); }}\n keepMounted>\n \n {(session?.patient_id !== session?.user_id) && (\n {\n setPopupMenuOpen(false);\n await switchActiveAccount(\n session,\n (session.user_homeClient || session.client_id),\n {\n id: session.user_id,\n name: session.user_display_name\n }\n );\n }}>\n \n \n {`Switch to My Profile (${session.user_id})`}\n \n \n )}\n {!session?.kiosk_mode && (\n {\n if (!state.hasOwnProperty('groups') || !state.groups.hasOwnProperty('adminHierarchy')) {\n enqueueSnackbar(`AVA is still loading. Wait just a moment and try again, please.`, { variant: 'warning' });\n }\n else {\n setPopupMenuOpen(false);\n setGroupData(state.groups);\n setShowProfileEdit(true);\n }\n }}>\n \n \n \n {(session.patient_id === session.user_id) ? `Edit your Profile` : `Edit ${greetingName}'${greetingName.slice(-1) === 's' ? '' : 's'} Profile`}\n \n \n \n )\n }\n {(\n state.hasOwnProperty('accessList') &&\n state.accessList.hasOwnProperty('subscription') &&\n state.accessList.subscription.subscription_active\n )\n &&\n {\n window.open(`https://families.avaseniorliving.com/p/login/9AQ4hT0kI91OcFidQQ`);\n }}>\n \n \n {'Manage Subscription'}\n \n \n }\n {proxyAuthority()\n &&\n {\n setPopupMenuOpen(false);\n setShowPersonSelect(true);\n }}>\n \n \n {'Switch Account'}\n \n \n }\n {createAccountAuthority()\n &&\n {\n setGroupData(state.groups);\n setPopupMenuOpen(false);\n setShowAddAccount(true);\n }}>\n \n \n {'Create Account'}\n \n \n }\n {\n await accessLog(session.user_id, `*na*`, `Manual sign-out`);\n removeCookie(\"AVAuser\");\n Auth.signOut().then(() => {\n let jumpTo = window.location.origin;\n window.location.replace(jumpTo);\n });\n }}>\n \n \n {'Sign Out'}\n \n \n {\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }}>\n \n \n {'Restart AVA'}\n \n \n {(window.location.href.split('//')[1].slice(0, 1).toUpperCase() !== 'T') &&\n {\n window.location.replace(`https://test.smsoftware.io?rel=${new Date().getTime()}`);\n }}>\n \n \n {'Use Beta Version'}\n \n \n }\n {(window.location.href.split('//')[1].slice(0, 1).toUpperCase() === 'T') &&\n {\n window.location.replace(`https://dev.smsoftware.io?rel=${new Date().getTime()}`);\n }}>\n \n \n {'Use Public Version'}\n \n \n }\n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n {makeExpiration()}\n \n {`User ${session.user_id}${session.patient_id !== session.user_id ? (' (' + session.patient_id + ')') : ''}`}\n \n \n \n \n \n\n {/* AVA Menu */}\n {mainMenu && mainMenu.length > 0 &&\n \n \n \n \n \n \n \n \n \n IMPORTANT MESSAGE... PLEASE SIGN-UP FOR VACCINE - TAP HERE\n \n \n \n {\n handleClick(event);\n setShowStaffAccess(true);\n }}\n alt=''\n src={session.client_logo || process.env.REACT_APP_AVA_LOGO}\n />\n \n \n \n \n \n \n {currentMenu !== 'main' &&\n \n {\n menuArray.pop();\n setCurrentMenu(menuArray[menuArray.length - 1]);\n setMenuArray(menuArray);\n menuNames.pop();\n setMenuNames(menuNames);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n \n \n \n \n \n {`Return to ${menuNames[menuNames.length - 1]}`}\n \n \n \n \n \n \n }\n {mainMenu.map((this_row, index) => (\n ((this_row.menu_name === currentMenu) &&\n \n {currentSection !== this_row.section_name &&\n \n \n {\n sectionOpen[this_row.section_name] = !sectionOpen[this_row.section_name];\n setSectionOpen(sectionOpen);\n await updateAVA(sectionOpen, mainMenu);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n \n \n \n \n \n \n {(currentSection = this_row.section_name)}\n \n {this_row.section_name.trim()}\n \n \n {(currentMenu !== 'main') ? null : (!sectionOpen[this_row.section_name] ? 'Show' : 'Hide')}\n \n \n \n \n \n }\n {rowIsOpen(this_row) &&\n \n \n \n {\n e.preventDefault();\n enqueueSnackbar(
    \n 1. Func {this_row.activity_code}
    \n 2. Type {this_row.row_type}
    \n 3. Reas {this_row.reason}
    \n 4. Defs {isObject(this_row.default_value) ? JSON.stringify(this_row.default_value) : this_row.default_value}
    ,\n { variant: 'info', persist: true });\n }}\n >\n {\n await activityLog(pPerson, this_row.activity_code, this_row.activity_name, index);\n if (!toggleClick && (this_row.row_type !== 'document')) {\n if (this_row.subMenu_data) {\n let subMenu = await MakeAVAMenu(patient, defaultClient, screenQuiet, this_row.subMenu_data);\n delete mainMenu[index].subMenu_data;\n mainMenu.push(...subMenu);\n setMainMenu(mainMenu);\n }\n if (this_row.child_menu) {\n setCurrentMenu(this_row.child_menu);\n menuArray.push(this_row.child_menu);\n setMenuArray(menuArray);\n menuNames.push((currentMenu === 'main') ? 'AVA Main Menu' : this_row.section_name);\n setMenuNames(menuNames);\n setForceRedisplay(!forceRedisplay);\n }\n else {\n setLoading('Loading');\n setForceRedisplay(!forceRedisplay);\n let gad_response = await getActivityDetail(this_row, state);\n setSelected(gad_response.activityRec);\n setLoading(false);\n if (gad_response.loadError) {\n enqueueSnackbar(`AVA is still loading. Wait just a moment and try again, please.`, { variant: 'warning' });\n }\n else {\n setShowNewFactDialog(index);\n }\n }\n }\n setToggleClick(false);\n }}\n >\n {this_row.row_type === 'document' ?\n \n {this_row.activity_name}\n \n :\n {this_row.activity_name}\n }\n \n \n {(this_row.is_favorite) ?\n ((['Favorite', 'History'].includes(this_row.reason)) &&\n {\n await updateFavorites('remove', index);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n \n )\n :\n {\n await updateFavorites('add', index);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n \n \n }\n \n \n \n
    \n {((index === (mainMenu.length - 1))\n || (this_row.menu_name !== mainMenu[index + 1].menu_name)\n || (this_row.section_name !== mainMenu[index + 1].section_name)\n ) &&\n }\n
    \n }\n \n )\n ))}\n \n \n \n \n \n }\n\n {/* Message Box */}\n {mainMenu && mainMenu.length > 0 &&\n \n \n \n {loading &&\n \n {`Loading AVA`}\n \n {`AVA version ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n \n \n }\n \n {`AVA for ${state.session.client_name}`}\n \n {loading && loading.startsWith('Common activities') &&\n \n {'Common activities for'}\n {loading.split(' for ')[1]}\n \n }\n {loading && !loading.startsWith('Common activities') &&\n {loading}\n }\n \n {loading &&\n \n \n \n \n }\n \n \n }\n\n {showPersonSelect &&\n {\n setShowPersonSelect(false);\n }}\n />\n }\n\n {showStaffAccess &&\n {\n updateReactData({\n last_selected_person: last_selected\n }, false);\n setShowStaffAccess(false);\n }}\n />\n }\n\n {showProfileEdit &&\n {\n setShowProfileEdit(false);\n if (updatedPerson && updatedPerson.person_id) {\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n }}\n />\n }\n\n {showAddAccount &&\n {\n setShowAddAccount(false);\n }}\n />\n }\n\n {/* Launch Children */}\n {(showNewFactDialog > -1) &&\n selected &&\n {\n oopsieMessage && (enqueueSnackbar(oopsieMessage, { variant: 'error' }));\n setShowNewFactDialog(-1);\n if (session?.url_parameters && ('activity' in session.url_parameters) && ('user' in session.url_parameters)) {\n let jumpTo = window.location.href.replace('theseus', 'thankyou').split('?')[0];\n jumpTo += `?user=${session.url_parameters.user}`;\n window.location.replace(jumpTo);\n }\n }}\n onSave={\n async (pResult) => {\n if ('client_id' in selected) { pResult.client_id = selected.client_id; }\n await onSaveFact(pResult, selected.name, showNewFactDialog);\n }\n }\n onNext={onNextFact}\n onSelected={() => { }}\n />\n }\n\n {/* Confirm Fact before saving */\n (needsConfirmation > -1) &&\n {\n setNeedsConfirmation(-1);\n setForceRedisplay(!forceRedisplay);\n }}\n onConfirm={async () => {\n pendingFact.status = 'confirmed';\n await onSaveFact(pendingFact, selected.name, needsConfirmation);\n setNeedsConfirmation(-1);\n }}\n >\n \n }\n \n \n );\n};","import React from 'react';\nimport { titleCase, updateDb, deleteDbRec, sentenceCase, parseNumeric, cl, dbClient, makeArray, deepCopy } from '../../util/AVAUtilities';\nimport useSession from '../../hooks/useSession';\nimport { getObservationItems } from '../../util/AVAObservations';\nimport AVAConfirm from './AVAConfirm';\nimport { makeDate, addDays } from '../../util/AVADateTime';\nimport { AVATextStyle } from '../../util/AVAStyles';\nimport { buildQualifiers } from '../../util/AVAActivityLoader';\nimport Select from \"react-dropdown-select\";\n\nimport { useSnackbar } from 'notistack';\n\nimport { Collapse, Radio } from '@material-ui/core';\n\nimport AVATextInput from './AVATextInput';\nimport LoadMenuSpreadsheet from './LoadMenuSpreadsheet';\n\nimport { DialogContent, Box, Typography, IconButton } from '@material-ui/core';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport EditIcon from '@material-ui/icons/Edit';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport ExpandLessIcon from '@material-ui/icons/VisibilityOff';\nimport ExpandMoreIcon from '@material-ui/icons/Visibility';\n\nconst useStyles = makeStyles(theme => ({\n listItem: {\n justifyContent: 'space-between',\n },\n typeOfLine: {\n fontSize: theme.typography.fontSize * 0.8,\n marginBottom: 0,\n },\n dialogBox: {\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n minHeight: '100%',\n },\n innerBox: {\n paddingLeft: '4px',\n minHeight: '500px',\n // maxHeight: '90%'\n },\n recipeCode: {\n fontSize: theme.typography.fontSize * 0.8,\n marginBottom: 0,\n marginLeft: theme.spacing(2)\n },\n observationLine: {\n marginTop: 0,\n fontSize: theme.typography.fontSize * 1.8,\n },\n}));\n\nexport default ({ observationList, recipeList, keyDate, onReset }) => {\n\n const classes = useStyles();\n\n const { state } = useSession();\n let local_service_details = {};\n const defaultCharacteristics = [\n {\n \"description\": \"Calories\",\n \"uom\": \"\",\n \"code\": \"calories\"\n },\n {\n \"description\": \"Cholesterol\",\n \"uom\": \"mg\",\n \"code\": \"cholesterol\"\n },\n {\n \"description\": \"Sodium\",\n \"uom\": \"mg\",\n \"code\": \"sodium\"\n },\n {\n \"description\": \"Total Carbs\",\n \"uom\": \"g\",\n \"code\": \"total_carb\"\n },\n {\n \"description\": \"Total Fat\",\n \"uom\": \"g\",\n \"code\": \"total_fat\"\n }\n ];\n\n const { enqueueSnackbar } = useSnackbar();\n\n const [reactData, setReactData] = React.useState({\n addMode: false,\n savedRequestUpdates: [],\n observationItemMode: false,\n oIValues: [],\n oIImage: '',\n oIKey: '',\n ogSelectedObservation: {},\n loadMode: false,\n deletePending: false,\n selectedObservation: {},\n recipeList: [],\n rowOpen: [],\n parm_keyDate: keyDate,\n visible_y: window.window.innerHeight,\n dateKey: makeDate(keyDate),\n oiCharacteristics: state.session.observation_item_characteristics || defaultCharacteristics,\n selectedMealType: null,\n selectedDateKey: null,\n selectedMenu: null,\n selectedArea: null,\n service_details: menuTypeList(),\n });\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) {\n setForceRedisplay(forceRedisplay => !forceRedisplay);\n }\n };\n\n async function loadOIValues(OIKey) {\n let OIObj = await getObservationItems(OIKey);\n if (Object.keys(OIObj).length === 0) {\n return {\n values: [],\n oIName: null,\n image: null\n };\n }\n let OIValues = reactData.oiCharacteristics.map(c => {\n let response = '';\n if (OIObj[c.code]) {\n if (OIObj[c.code].value) {\n response = OIObj[c.code].value.toString();\n if (OIObj[c.code].uom) {\n if (OIObj[c.code].uom === '$') {\n response = new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n }).format(OIObj[c.code].value);\n }\n else {\n response += ` ${OIObj[c.code].uom}`;\n }\n }\n }\n else if (OIObj[c.code].display_value) {\n response = ` ${OIObj[c.code].display_value}`;\n }\n }\n return response;\n });\n return {\n values: OIValues,\n oIName: (OIObj.hasOwnProperty('observation_name') ? OIObj['observation_name'].display_value : null),\n image: (OIObj.hasOwnProperty('image') ? OIObj['image'].display_value : null)\n };\n }\n\n async function handleAddOItem(oKey, newDataList, newAttachmentList) {\n // newDataList[0] is observation_code\n let this_observationCode = newDataList.shift();\n if (!reactData.oIogName\n || (reactData.oIogName === `Item ${oKey}`)\n || (reactData.oIogName !== this_observationCode)\n ) {\n await dbClient\n .put({\n TableName: 'Observation_Items',\n Item: {\n observation_key: oKey,\n display_value: (this_observationCode && (this_observationCode.trim() !== '')) ? this_observationCode : reactData.selectedObservation.observation_code,\n characteristic: 'observation_name',\n }\n })\n .promise()\n .catch(error => {\n console.log(`Bad put to Observation_Items (Name) - caught error is: ${error}`);\n });\n }\n\n // newDataList[1] is item description\n let this_itemDescription = newDataList.shift();\n // all other entries in newDataList map to the oiCharacteristics array\n let new_MoreInfo = {};\n let OIwritten = 0;\n for (let n = 0; n < reactData.oiCharacteristics.length; n++) {\n if (newDataList[n] && (newDataList[n].toString().length > 0)) {\n let oIRec = {\n observation_key: oKey,\n characteristic: reactData.oiCharacteristics[n].code,\n };\n new_MoreInfo[reactData.oiCharacteristics[n].code] = newDataList[n];\n let checkN = parseNumeric(newDataList[n]);\n if (!checkN.isNumeric) {\n oIRec.display_value = newDataList[n];\n }\n else {\n oIRec.value = checkN.value;\n if (checkN.hasText) {\n oIRec.uom = checkN.textValue;\n }\n else if (reactData.oiCharacteristics[n].uom) {\n oIRec.uom = reactData.oiCharacteristics[n].uom;\n }\n }\n cl({ 'Put to Observation_Items': oIRec });\n OIwritten++;\n await dbClient\n .put({\n TableName: 'Observation_Items',\n Item: oIRec\n })\n .promise()\n .catch(error => {\n cl(`Bad put to Observation_Items - caught error is: ${error}`);\n });\n }\n }\n // deal with attachments (images); use the first one only\n if (newAttachmentList && newAttachmentList.length > 0) {\n OIwritten++;\n await dbClient\n .put({\n TableName: 'Observation_Items',\n Item: {\n observation_key: oKey,\n characteristic: 'image',\n display_value: newAttachmentList[0]\n }\n })\n .promise()\n .catch(error => {\n cl(`Bad put to Observation_Items - caught error is: ${error}`);\n });\n new_MoreInfo['image'] = newAttachmentList[0];\n }\n else if (reactData.oIImage) { // there was an image, but there isn't now\n await dbClient\n .delete({\n TableName: 'Observation_Items',\n Key: {\n observation_key: oKey,\n characteristic: 'image',\n }\n })\n .promise()\n .catch(error => {\n cl(`Bad delete on Observation_Items image for key ${oKey} - caught error is: ${error}`);\n });\n }\n // now update the Observation itself, adding the oKey and updating the description\n let this_observation = Object.assign(\n {},\n reactData.selectedObservation,\n {\n description: this_itemDescription,\n }\n );\n if (reactData.selectedObservation.observation_code !== this_observationCode) {\n this_observation.observation_code = this_observationCode;\n }\n if (OIwritten === 0) {\n delete this_observation.observation_key;\n }\n else {\n this_observation.observation_key = oKey;\n }\n if (this_observation.listIndex > -1) {\n Object.assign(observationList[this_observation.listIndex],\n this_observation,\n );\n observationList[this_observation.listIndex].moreInfo = new_MoreInfo;\n }\n delete this_observation.listIndex;\n delete this_observation.moreInfo;\n updateDb([{\n table: 'Observations',\n key: {\n composite_key: reactData.selectedObservation.composite_key,\n observation_code: reactData.selectedObservation.observation_code\n },\n data: this_observation\n }]);\n if (reactData.addMode) {\n // new style observations are composite_key as ~___\n observationList.unshift(this_observation);\n }\n return oKey;\n }\n\n function filterRecipeList(menu_category) {\n let response = recipeList.filter(this_recipe => {\n return (this_recipe.type && this_recipe.type.includes(menu_category));\n });\n return response;\n }\n\n function menuTypeList() {\n let dining_area = state.session.dining_structure.dining_area;\n /*\n let dining_area = {\n 'Evergreen Room': {\n value: 'main',\n display_value: ['Evergreen', 'Room'],\n meal_service: {\n \"lunch\": {\n value: 'lunch',\n categories: ['entree', 'side', 'soup', 'salad', 'bread', 'dessert'],\n display_value: ['Lunch']\n },\n \"dinner\": {\n value: 'dinner',\n categories: ['entree', 'side', 'soup', 'salad', 'bread', 'dessert'],\n display_value: ['Dinner']\n },\n \"all_day\": {\n value: 'all-day',\n categories: ['entree', 'side', 'soup', 'salad', 'bread', 'dessert'],\n display_value: ['All', 'Day'],\n format: 'category_date'\n },\n }\n },\n 'Village Square': {\n value: 'village',\n display_value: ['Village', 'Square'],\n meal_service: {\n \"breakfast\": {\n value: 'breakfast',\n categories: ['entree', 'side'],\n display_value: ['Breakfast']\n },\n \"lunch\": {\n value: 'lunch',\n categories: ['entree', 'side', 'soup', 'salad', 'bread', 'dessert'],\n display_value: ['Lunch']\n }\n }\n }\n };\n */\n let dates = {};\n for (let d = 0; d < 7; d++) {\n let this_date = makeDate(addDays(keyDate, d));\n dates[this_date.ymd] = {\n value: this_date.obs,\n ymd: this_date.ymd,\n display_value: this_date.dateOnly,\n display_value_day: (this_date.relative === 'Today' ? 'Today' : this_date.absolute.slice(0, 3))\n };\n }\n let menus;\n if (state.session.dining_structure.hasOwnProperty('menus')) {\n menus = state.session.dining_structure.menus;\n }\n else {\n menus = {\n 'special': {\n value: '%date%',\n display_value: ['Daily', 'Specials']\n },\n 'everyday': {\n value: 'always',\n display_value: ['Everyday', 'Options']\n }\n };\n };\n local_service_details = {\n dining_area,\n dates,\n menus\n };\n return local_service_details;\n };\n\n React.useEffect(() => {\n async function initialize() {\n let updateObj = {\n service_details: menuTypeList()\n };\n if (!reactData.recipeList || (reactData.recipeList.length === 0)) {\n updateObj.recipeList = recipeList;\n }\n updateReactData(updateObj, true);\n }\n if (!reactData.parm_keyDate || (reactData.parm_keyDate !== keyDate)) {\n initialize();\n }\n }, [keyDate]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleNewObservation = async (values, menu_category) => {\n // new style observations are composite_key as Client~entree_2024.5.22_lunch_bistro (client_id!category_date_meal_room)\n let meal_type = selectedMealType('value');\n let useDate = selectedMenu('value');\n let menu_date = ((useDate === '%date%') ? selectedDate('value') : useDate);\n let newCompositeKey = `${state.session.client_id}~${menu_category}_${menu_date}_${meal_type}`;\n let room = selectedArea('value');\n if (room && (room !== '')) {\n newCompositeKey += `_${room}`;\n }\n // ***** OVERRIDE FOR AVT ONLY HERE ******* //\n newCompositeKey = `${state.session.client_id}~${menu_category}_${menu_date}`\n let selected_okey = (Array.isArray(values) ? values[0].value : values.value);\n if (!selected_okey || (selected_okey.trim() === '')) {\n selected_okey = null;\n }\n let new_okey = `OKey_${new Date().getTime()}`;\n let pObs = {\n composite_key: newCompositeKey,\n observation_code: sentenceCase((Array.isArray(values) ? values[0].label : values.label)),\n observation_key: new_okey,\n date_key: ((useDate === '%date%') ? selectedDate('ymd') : useDate),\n client_id: state.session.client_id,\n observation_type: `${menu_category}`,\n sort_order: `${menu_category}`\n };\n updateReactData({\n addMode: true,\n oIKey: null,\n oIValues: null,\n oIImage: null,\n oIogName: null,\n observationItemMode: false,\n ogSelectedObservation: pObs,\n selectedObservation: pObs,\n }, false);\n let dataList = [pObs.observation_code, ''];\n if (selected_okey) {\n let OIInfo = await loadOIValues(selected_okey);\n dataList.push(...OIInfo.values);\n }\n await handleAddOItem(\n new_okey,\n dataList,\n []\n );\n };\n\n const handleEditObservation = async (pObs, index, menu, type) => {\n let obsWords = pObs.observation_code.toLowerCase().trim().split(/\\s+/).filter(w => {\n return !((w === 'with') || (w === 'w/'));\n });\n let filteredRecipeList = recipeList.filter((r, x) => {\n return ((r.value === pObs.observation_key) || (obsWords.some(w => {\n return (r.label.toLowerCase().includes(w));\n })));\n });\n pObs.listIndex = index;\n pObs.observation_type = `${menu}_${type}`;\n let OIInfo = (pObs.observation_key ? await loadOIValues(pObs.observation_key) : {});\n updateReactData({\n addMode: (index === -1),\n oIKey: pObs.observation_key,\n oIValues: OIInfo.values,\n oIImage: OIInfo.image,\n oIogName: OIInfo.oIName,\n observationItemMode: true,\n ogSelectedObservation: pObs,\n selectedObservation: pObs,\n filteredRecipeList: filteredRecipeList\n }, true);\n };\n\n const selectedMealType = (return_type = 'key') => {\n // AKA \"meal\" - lunch, dinner, breakfast, allday, ...\n // return_type is 'key', 'display', or 'value'\n let check_key;\n if (reactData.selectedMealType\n && !reactData.service_details['dining_area'][selectedArea()]['meal_service'].hasOwnProperty(reactData.selectedMealType)) {\n check_key = Object.keys(reactData.service_details['dining_area'][selectedArea()]['meal_service'])[0];\n }\n else {\n check_key = reactData.selectedMealType || Object.keys(reactData.service_details['dining_area'][selectedArea()]['meal_service'])[0];\n }\n if (return_type === 'key') {\n return check_key;\n }\n else if (return_type === 'value') {\n return local_service_details['dining_area'][selectedArea()]['meal_service'][check_key].value;\n }\n else if (return_type === 'categories') {\n return local_service_details['dining_area'][selectedArea()]['meal_service'][check_key].categories;\n }\n else {\n let resp = local_service_details['dining_area'][selectedArea()]['meal_service'][check_key].display_value;\n if (Array.isArray(resp)) {\n return resp.join(' ');\n }\n else {\n return resp;\n }\n };\n };\n\n const selectedDate = (return_type = 'key') => {\n // AKA \"menu\" - always, weekend, tuesday, 2024.5.22, ...\n // return_type is 'key', 'display', or 'value'\n let check_key = reactData.selectedDateKey;\n if (!reactData.selectedDateKey) {\n if (return_type === 'display') {\n return 'Always Available';\n }\n else {\n check_key = Object.keys(local_service_details['dates'])[0];\n }\n }\n if (return_type === 'key') {\n return check_key;\n }\n else if (return_type === 'value') {\n if (!local_service_details['dates'].hasOwnProperty(check_key)) {\n console.log(`bad at ${check_key}`);\n return check_key;\n }\n else {\n return local_service_details['dates'][check_key].value;\n }\n }\n else if (return_type === 'ymd') {\n return local_service_details['dates'][check_key].ymd;\n }\n else {\n return local_service_details['dates'][check_key].display_value;\n };\n };\n\n const selectedMenu = (return_type = 'key') => {\n // AKA \"menu\" - always, date\n // return_type is 'key', 'display', or 'value'\n let check_key = reactData.selectedMenu || Object.keys(local_service_details['menus'])[0];\n if (return_type === 'key') {\n return check_key;\n }\n else if (return_type === 'value') {\n return local_service_details['menus'][check_key].value;\n }\n else {\n return local_service_details['menus'][check_key].display_value;\n };\n };\n\n const selectedArea = (return_type = 'key') => {\n // AKA \"room\" - main, pool, bistro, ...\n // return_type is 'key', 'display', or 'value'\n let check_key = reactData.selectedArea || Object.keys(reactData.service_details['dining_area'])[0];\n if (return_type === 'key') {\n return check_key;\n }\n else if (return_type === 'value') {\n return local_service_details['dining_area'][check_key].value;\n }\n else {\n return local_service_details['dining_area'][check_key].display_value;\n };\n };\n\n function OKtoShow(this_observation, displayed_category) {\n let useDate = (selectedMenu('value') === '%date%');\n let [, cKey] = this_observation.composite_key.split('~');\n let s = cKey.replace('all_day', '%RESTORE%').split('_');\n let p = s.map(e => {\n return (e === '%RESTORE%' ? 'all_day' : e);\n });\n if (p[0] === displayed_category) {\n if (p[1] === (useDate ? selectedDate('value') : selectedMenu('value'))) {\n // Client~entree_2024.5.22_lunch_bistro OR Client~entree_2024.5.22\n if (p.length < 3) {\n // with only 2 parts (date and category), we have to assume \"all day\" and \"main\" dining\n return ((['all-day', 'all_day', 'allDay'].includes(selectedMealType('value'))) && ((selectedArea('value')) === 'main'));\n }\n else if (p[2] !== selectedMealType('value')) { // third parm is present? it needs to match the meal\n return false;\n }\n return (((p.length < 4) && (selectedArea('value')) === 'main') || (p[3] === selectedArea('value')));\n }\n else if (p[1] === selectedMealType('value')) {\n // Client~entree_lunch_2024.5.22_bistro \n if (p.length < 3) {\n // with only 2 parts (category and meal), we have to assume \"all day\" and \"main\" dining\n return ((['all-day', 'all_day', 'allDay'].includes(selectedMealType('value'))) && ((selectedArea('value')) === 'main'));\n }\n else if (p[2] !== (useDate ? selectedDate('value') : selectedMenu('value'))) { // third parm is present? it needs to match the date\n return false;\n }\n return (((p.length < 4) && (selectedArea('value')) === 'main') || (p[3] === selectedArea('value')));\n }\n }\n else if (p[0] === (useDate ? selectedDate('value') : selectedMenu('value'))) { // check for Client~always_lunch_entree or Client~2024.5.22_lunch_entree or Client~always_entree or Client~2024.5.22_entree\n if (p[1] === selectedMealType('value')) {\n return (p[2] === displayed_category);\n }\n else {\n return (p[1] === displayed_category);\n }\n }\n else { // Client~lunch_entree_2024.5.22\n if ((p[0] === selectedMealType('value')) && (p[1] === displayed_category)) {\n return (p[2] === (useDate ? selectedDate('value') : selectedMenu('value')));\n }\n return false;\n }\n }\n\n const handleDeleteObservation = async (original_data) => {\n // pData in the form {[\"table\": , \"key\": {\"key1\": \"keydata1\", etc...}]\n deleteDbRec([{\n table: 'Observations',\n key: {\n composite_key: original_data.composite_key,\n observation_code: original_data.observation_code\n },\n }]);\n observationList.splice(original_data.listIndex, 1);\n };\n\n return (\n ((forceRedisplay || true) &&\n \n {!reactData.observationItemMode && !reactData.loadMode && !reactData.deletePending &&\n \n { /* Selection Row */}\n \n {(Object.keys(reactData.service_details).length > 1) &&\n \n { /* Dining Rooms */\n (Object.keys(reactData.service_details['dining_area']).length > 1) &&\n 5) ? 'scroll' : null}\n justifyContent='flex-start'\n alignItems='center'\n >\n \n \n {'Dining'}\n \n \n {'Room'}\n \n \n {Object.keys(reactData.service_details['dining_area']).map((areaType_key, aTNdx) => (\n \n \n {titleCase(`${local_service_details['dining_area'][areaType_key].display_value[0]} ${local_service_details['dining_area'][areaType_key].display_value[1] || ''}`)}\n \n {\n updateReactData({\n selectedArea: areaType_key\n }, true);\n }}\n disableRipple\n className={classes.radioButton}\n size='small'\n />\n \n ))}\n \n }\n\n { /* Menu - \"Daily Special\" or \"Everyday\" */\n \n \n \n {'Menu'}\n \n \n {Object.keys(local_service_details['menus']).map((menuType_key, menuNDX) => (\n \n \n {titleCase(`${local_service_details['menus'][menuType_key].display_value[0]} ${local_service_details['menus'][menuType_key].display_value[1] || ''}`)}\n \n {\n updateReactData({\n selectedMenu: menuType_key\n }, true);\n }}\n disableRipple\n className={classes.radioButton}\n size='small'\n />\n \n ))}\n \n }\n\n { /* Date */\n (selectedMenu('value') === '%date%') &&\n \n \n \n {'Date'}\n \n\n \n \n {Object.keys(local_service_details['dates']).map((menuDate_key, menuNDX) => (\n \n \n {titleCase(local_service_details['dates'][menuDate_key].display_value_day)}\n \n \n {titleCase(local_service_details['dates'][menuDate_key].display_value)}\n \n {\n updateReactData({\n selectedDateKey: menuDate_key\n }, true);\n }}\n disableRipple\n className={classes.radioButton}\n size='small'\n />\n \n ))}\n \n \n }\n\n { /* Meal - AKA \"meal\" - lunch, dinner, breakfast, allday, ... */\n (Object.keys(reactData.service_details['dining_area'][selectedArea()]['meal_service']).length > 1) &&\n 5) ? 'scroll' : null}\n justifyContent='flex-start'\n alignItems='flex-start'\n >\n \n \n {'Meal'}\n \n \n {'Type'}\n \n \n {Object.keys(reactData.service_details['dining_area'][selectedArea()]['meal_service']).map((menu_type, mtNDX) => (\n \n \n {titleCase(`${local_service_details['dining_area'][selectedArea()]['meal_service'][menu_type].display_value[0]} ${local_service_details['dining_area'][selectedArea()]['meal_service'][menu_type].display_value[1] || ''}`)}\n \n {\n updateReactData({\n selectedMealType: menu_type\n }, true);\n }}\n disableRipple\n className={classes.radioButton}\n size='small'\n />\n \n ))}\n \n }\n\n \n }\n \n\n { /* Data rows */}\n \n {reactData.service_details['dining_area'][selectedArea()]['meal_service'][selectedMealType()].categories.map((menu_category, catNdx) => (\n \n { /* Category Title - name */}\n 0) ? 1 : 0}\n paddingTop={(catNdx > 0) ? 2 : 1}\n marginTop={(catNdx > 0) ? 1 : 0}\n justifyContent='flex-start'\n alignItems='center'\n >\n \n {titleCase(menu_category.replace('_', ' ').trim())}\n \n \n { /* Add row for this category */}\n \n \n {\n if ((values.length > 0) && !reactData.addMode) {\n await handleNewObservation(values, menu_category);\n updateReactData({\n selectedObservation: {},\n addMode: false\n }, true);\n }\n }}\n onCreateNew={async (values) => {\n await handleNewObservation(values, menu_category);\n updateReactData({\n selectedObservation: {},\n addMode: false\n }, true);\n }}\n />\n { /* Existing observations in this category */}\n {\n observationList.map((this_item, this_index) => (\n OKtoShow(this_item, menu_category)\n &&\n \n \n \n {\n handleEditObservation(deepCopy(this_item), this_index, selectedMealType(), menu_category);\n }}\n edge=\"start\"\n >\n {}\n \n {\n this_item.listIndex = this_index;\n updateReactData({\n confirmMessage: `Confirm removing ${this_item.observation_code.replace(/~/g, '')} from the ${titleCase(selectedDate('display'))} ${selectedMealType('display')} menu?`,\n selectedObservation: this_item,\n deletePending: true\n }, true);\n }}\n edge=\"start\"\n >\n \n \n {\n reactData.rowOpen[this_index] = !reactData.rowOpen[this_index];\n if (this_item.observation_key) {\n let OIInfo = await loadOIValues(this_item.observation_key);\n if (OIInfo) {\n observationList[this_index].moreInfo = {\n image: OIInfo.image,\n };\n }\n reactData.oiCharacteristics.forEach((c, x) => {\n if (OIInfo.values[x]) {\n observationList[this_index].moreInfo[c.description] = OIInfo.values[x];\n }\n });\n }\n else if (!this_item.description || (this_item.description.trim() === '')) {\n observationList[this_index].moreInfo = {\n 'Additional Item info': 'None loaded. Tap the pencil icon to add.',\n };\n }\n let qualResponse = await buildQualifiers(this_item.observation_key);\n if (qualResponse.data && (Object.keys(qualResponse.data).length > 0)) {\n observationList[this_index].qualData = deepCopy(qualResponse.data);\n }\n updateReactData({\n rowOpen: reactData.rowOpen\n }, true);\n }}\n onContextMenu={async (e) => {\n e.preventDefault();\n enqueueSnackbar(
    \n Composite_Key={this_item.composite_key}
    \n Observation_key={this_item.observation_key}
    \n Date_Key={this_item.date_key}\n
    , { variant: 'info', persist: true });\n }}\n >\n \n {this_item.observation_code.replace(/~/g, '')}\n \n {(!!this_item.observation_key\n || !!(this_item.description && (this_item.description.trim() !== ''))\n || !!(this_item.fee && (Number(this_item.fee) > 0))\n ) &&\n (!reactData.rowOpen[this_index] ? : )\n }\n
    \n
    \n \n \n \n \n {this_item.description &&\n \n {`Description: ${this_item.description}`}\n \n }\n {this_item.fee && (Number(this_item.fee) > 0) &&\n \n {`${new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n }).format(this_item.fee)}`}\n \n }\n {this_item.moreInfo &&\n Object.keys(this_item.moreInfo).map((opt, oX) => (\n \n {(opt !== 'image') && (opt !== 'restriction') &&\n \n \n {`${sentenceCase(opt.replace('_', ' '))}${this_item.moreInfo[opt].trim() ? (': ' + this_item.moreInfo[opt]) : ''}`}\n \n \n }\n {(opt === 'restriction')\n && (state?.groups?.belongsTo?.[this_item.moreInfo[opt].trim()].group_name)\n &&\n \n \n {`Show warning for ${state?.groups?.belongsTo?.[this_item.moreInfo[opt].trim()].group_name}`}\n \n \n }\n
    \n ))}\n {this_item.qualData\n && makeArray(this_item.qualData).map((qR, qRndx) => (\n \n \n {((qR.max_allowed === 1) || (qR.option.length === 1)) ?\n (`You ${(qR.min_required > 0) ? 'must' : 'may'} select one ${qR.title} option`)\n :\n (`${(qR.min_required > 0) ? 'You must select from' + qR.min_required : 'You may choose up'} to ${(qR.max_allowed > 20) ? qR.option.length : qR.max_allowed} ${qR.title} options`)\n }\n \n {qR.option.map((qROpt, qROx) => (\n \n {qROpt.display}\n \n ))}\n \n ))\n }\n \n {this_item.moreInfo &&\n this_item.moreInfo.image &&\n \n }\n \n \n \n \n \n ))\n }\n \n \n \n ))}\n \n \n }\n {\n reactData.observationItemMode &&\n { return `${c.description} ${c.uom ? '(' + c.uom + ')' : ''}`; }))}\n valueText={[reactData.selectedObservation.observation_code, reactData.selectedObservation.description].concat(reactData.oIValues)}\n buttonText={[(reactData.addMode ? 'Add' : 'Update'), 'Cancel']}\n options={{\n allowAttach: 'Image',\n attachmentList: (reactData.oIImage ? [{\n Key: 'Current Image',\n Location: reactData.oIImage,\n }] : false)\n }}\n onCancel={() => {\n updateReactData({\n selectedObservation: {},\n observationItemMode: false,\n addMode: false\n }, true);\n }}\n onSave={async (newOItemData, buttonPressed, newAttachmentList) => {\n if (buttonPressed === 0) { // add/update/save\n await handleAddOItem(\n ((reactData.addMode || !reactData.selectedObservation.observation_key) ? `OKey_${new Date().getTime()}` : reactData.selectedObservation.observation_key),\n newOItemData,\n newAttachmentList\n );\n updateReactData({\n selectedObservation: {},\n observationItemMode: false,\n addMode: false\n }, true);\n }\n else if (buttonPressed === 2) { // edit options\n\n }\n }}\n />\n }\n {\n reactData.loadMode &&\n {\n updateReactData({\n loadMode: false\n }, true);\n onReset();\n }}\n />\n }\n {\n reactData.deletePending &&\n {\n updateReactData({\n deletePending: false\n }, true);\n }}\n onConfirm={() => {\n handleDeleteObservation(reactData.selectedObservation);\n updateReactData({\n deletePending: false\n }, true);\n }}\n >\n \n }\n \n ));\n};","import React from 'react';\nimport { getObservations } from '../../util/AVAObservations';\nimport { sentenceCase, dbClient, cl, recordExists } from '../../util/AVAUtilities';\nimport { makeDate } from '../../util/AVADateTime';\n\nimport TextField from '@material-ui/core/TextField';\n\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport Button from '@material-ui/core/Button';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport LoadIcon from '@material-ui/icons/GetApp';\nimport PlaylistAddCheckIcon from '@material-ui/icons/PlaylistAddCheck';\nimport FileCopyIcon from '@material-ui/icons/FileCopy';\n\nimport CopyMenu from '../forms/CopyMenu';\n\nimport MenuForm from '../forms/MenuFormB';\nimport LoadMenuSpreadsheet from '../forms/LoadMenuSpreadsheet';\n\nimport { AVAclasses } from '../../util/AVAStyles';\nimport { addDays } from '../../util/AVADateTime';\n\nconst useStyles = makeStyles(theme => ({\n pageHead: {\n paddingTop: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n fontWeight: 'bold'\n },\n subDescriptionText: {\n marginLeft: theme.spacing(3),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n },\n freeInput: {\n marginLeft: 0,\n marginBottom: '10px',\n marginRight: '2px',\n paddingLeft: 0,\n paddingRight: 0,\n verticalAlign: 'middle',\n minHeight: theme.typography.fontSize * 2.8,\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.reject[theme.palette.type],\n },\n rowButtonGreen: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.confirm[theme.palette.type],\n },\n dialogBox: {\n paddingTop: 0,\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n overflowX: 'auto',\n // overflowY: 'hidden'\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n load: {\n backgroundColor: theme.palette.warning[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n}));\n\nexport default ({ pClient, showMenu, onClose }) => {\n const [observationList, setObservationList] = React.useState();\n const [alwaysList, setAlwaysList] = React.useState();\n const [recipeList, setRecipeList] = React.useState();\n const [selectedDate, setSelectedDate] = React.useState(new Date().toDateString());\n const [displayedDate, setDisplayedDate] = React.useState(new Date().toDateString());\n const [loadMode, setLoadMode] = React.useState(false);\n const [copyMode, setCopyMode] = React.useState(false);\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const [changes, setChanges] = React.useState(false);\n if (changes) { }\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n async function buildObservationList(pDate) {\n let obsList = [];\n for (let d = 0; d < 7; d++) {\n let this_date = addDays(pDate, d);\n let [todayList,] = await getObservations(pClient, '', { date: this_date, sort: true, return: 'records' });\n /*\n todayList.forEach((this_observation, this_index) => {\n let [, cKey] = this_observation.composite_key.split('~');\n let s = cKey.replace('all_day', '%RESTORE%').split('_');\n let p = s.map(e => {\n return (e === '%RESTORE%' ? 'all_day' : e);\n });\n // now p has up to 4 parts; figure out what each part means\n todayList[this_index].encoding = {};\n p.forEach(this_part => {\n if (this_part)\n })\n })\n */\n obsList.push(...todayList);\n }\n let buildAlways;\n if (!alwaysList) {\n buildAlways = await getObservations(pClient, '', { always: true, sort: true, return: 'records' });\n setAlwaysList(buildAlways[0])\n }\n if (!recipeList || (recipeList.length === 0)) { \n setRecipeList(await buildRecipeList());\n }\n let concatList = obsList.concat(alwaysList || buildAlways[0]);\n setObservationList(concatList);\n return concatList;\n };\n\n async function buildRecipeList() {\n if (!recipeList || (recipeList.length === 0)) { \n let oDate = makeDate(addDays(new Date(), -120)).ymd;\n let oldObservations = await dbClient\n .query({\n KeyConditionExpression: 'client_id = :c and date_key > :d',\n ExpressionAttributeValues: { ':c': pClient, ':d': oDate },\n TableName: \"Observations\",\n IndexName: \"date_key-index\"\n })\n .promise()\n .catch(error => { cl(`ERROR reading Observations by date *** caught error is: ${error}`); });\n let unsortedObservations = [];\n if (recordExists(oldObservations)) {\n unsortedObservations = oldObservations.Items.map((r, x) => {\n return {\n label: `${sentenceCase(r.observation_code)}`.trim(),\n value: r.observation_key || `*noKey~${x}`,\n type: (`${r.composite_key}_${r.sort_order}`).toLowerCase()\n };\n });\n }\n let response = (unsortedObservations).sort((a, b) => {\n return ((a.label < b.label) ? -1 : 1);\n });\n var seenLabel = {};\n let seenValue = {};\n let seenType = {};\n response.forEach((item, x) => {\n if (seenLabel.hasOwnProperty(item.label)) {\n // label already exists; do we need to put a better value in? (we shuold if the value is missing or '*nokey...')\n if (!seenLabel[item.label]\n || (seenLabel[item.label].startsWith('*noKey') && (item.value && !item.value.startsWith('*noKey')))\n ) {\n if (!item.value) {\n item.value = `*noKey~${x}`;\n }\n if (seenValue.hasOwnProperty(item.value)) {\n item.value += `_${x}`\n }\n seenLabel[item.label] = item.value;\n seenValue[item.value] = true;\n }\n if (!seenType[item.label] && item.type) {\n seenType[item.label] = item.type;\n }\n }\n else {\n if (!item.value) {\n item.value = `*noKey~${x}`\n }\n if (seenValue.hasOwnProperty(item.value)) {\n item.value += `_${x}`;\n }\n seenLabel[item.label] = item.value;\n seenValue[item.value] = true;\n seenType[item.label] = item.type;\n }\n });\n let finalAnswer = [];\n for (let label in seenLabel) {\n finalAnswer.push({\n label: label,\n value: seenLabel[label],\n type: seenType[label]\n })\n }\n return finalAnswer;\n }\n }\n\n const handleLoad = async () => {\n setLoadMode(true);\n };\n\n const handleCopy = async () => {\n setCopyMode(true);\n };\n\n const handleDateExit = dateValue => {\n let goodDate = makeDate(dateValue, { validation: 'noPast' });\n if (goodDate.error) {\n setObservationList([]);\n return;\n }\n setSelectedDate(goodDate.numeric$);\n buildObservationList(goodDate.date);\n };\n\n let filterTimeOut;\n const handleChangeDate = vCheck => {\n clearTimeout(filterTimeOut);\n filterTimeOut = setTimeout(() => {\n if (vCheck.length === 0) {\n setDisplayedDate('');\n }\n else if (vCheck.length >= 3) {\n let goodDate = makeDate(vCheck, { validation: 'noPast' });\n if (!goodDate.error) {\n handleDateExit(vCheck);\n }\n }\n }, 500);\n };\n\n\n const handleAbort = () => {\n setChanges(false);\n onClose();\n };\n\n // **************************\n\n React.useEffect(() => {\n async function initialize() {\n await buildObservationList(new Date().toDateString());\n }\n if (!observationList) { initialize(); }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n (showMenu &&\n \n \n \n \n {`Dining Menu Maintenance`}\n \n \n \n (handleChangeDate(event.target.value))}\n />\n \n \n \n {observationList &&\n \n {\n buildObservationList(selectedDate);\n }}\n handleAbort={handleAbort}\n handleLoad={handleLoad}\n />\n \n }\n \n }\n >\n {'Done'}\n \n }\n >\n {'Upload from Template'}\n \n {false && { handleCopy(); }}\n startIcon={}\n >\n {'Copy'}\n }\n \n {loadMode &&\n {\n setLoadMode(false);\n buildObservationList(selectedDate);\n }}\n />\n }\n {copyMode && false &&\n {\n setCopyMode(false);\n }}\n />\n }\n \n )\n );\n};\n","import React from 'react';\nimport { titleCase, sentenceCase, dbClient, cl } from '../../util/AVAUtilities';\nimport { getBulletinBoard } from '../../util/AVAObservations';\nimport AVATextInput from '../forms/AVATextInput';\n\nimport { Typography } from '@material-ui/core';\nimport TextField from '@material-ui/core/TextField';\n\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport Button from '@material-ui/core/Button';\nimport EditIcon from '@material-ui/icons/Edit';\nimport CloudUploadIcon from '@material-ui/icons/CloudUpload';\nimport LinkIcon from '@material-ui/icons/Link';\nimport SaveIcon from '@material-ui/icons/Save';\nimport CancelIcon from '@material-ui/icons/Cancel';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport PlaylistAddCheckIcon from '@material-ui/icons/PlaylistAddCheck';\nimport ExpandMoreIcon from '@material-ui/icons/Visibility';\nimport AVAConfirm from '../forms/AVAConfirm';\n\nimport { AVAclasses, AVATextStyle } from '../../util/AVAStyles';\nimport AVAUploadFile from '../../util/AVAUploadFile';\n\nconst useStyles = makeStyles(theme => ({\n pageHead: {\n paddingTop: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n fontWeight: 'bold'\n },\n subDescriptionText: {\n marginLeft: theme.spacing(3),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n },\n freeInput: {\n width: '100%',\n marginLeft: 0,\n marginBottom: '10px',\n marginRight: '32px',\n paddingLeft: 0,\n paddingRight: 0,\n verticalAlign: 'middle',\n minHeight: theme.typography.fontSize * 2.8,\n },\n editInput: {\n width: '100%',\n color: 'black',\n marginLeft: 0,\n marginRight: '8px',\n paddingLeft: 0,\n paddingRight: 0,\n minHeight: theme.typography.fontSize * 2.8,\n },\n rowButton: {\n marginRight: theme.spacing(1),\n fontSize: '1rem',\n marginBottom: theme.spacing(1),\n },\n rowButtonGreen: {\n marginRight: theme.spacing(1),\n fontSize: '1rem',\n marginBottom: theme.spacing(1),\n color: 'green'\n },\n inputDisplay: {\n '&.Mui-disabled': {\n color: 'black'\n },\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n // color: theme.palette.reject[theme.palette.type],\n },\n dialogBox: {\n paddingTop: 0,\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n overflowX: 'auto',\n // overflowY: 'hidden'\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n load: {\n backgroundColor: theme.palette.warning[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n}));\n\nexport default ({ pClient, pGroup = 'ALL', onClose }) => {\n\n var rowsWritten;\n\n const isMounted = React.useRef(false);\n const [reactData, setReactData] = React.useState({\n group_id: (Array.isArray(pGroup) ? ((pGroup.length > 0) ? pGroup[0] : 'ALL') : pGroup),\n initialized: false,\n bBoardList: {},\n deletePending: false,\n spliceAt: -1,\n confirmMessage: '',\n textInput: {},\n editMode: {},\n addAttachment: false,\n isError: false,\n addLink: false,\n needsHeader: false,\n changesMade: false\n });\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const AWS = require('aws-sdk');\n AWS.config.update({ region: 'us-east-1' });\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n if (isMounted.current) {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n }\n };\n\n\n async function onCheckEnter(event, section_name, ndx = 'new') {\n if (event.key === 'Enter') {\n await saveNewTitle(section_name, ndx);\n }\n };\n\n const handleDragStart = (ev, id) => {\n ev.dataTransfer.setData('id', JSON.stringify(id));\n };\n\n const handleDragOver = (ev) => {\n ev.preventDefault();\n };\n\n const handleDrop = async (ev, { droppedOn }) => {\n ev.preventDefault();\n let dragged_id = JSON.parse(ev.dataTransfer.getData('id'));\n let draggedFromIndex = (reactData.bBoardList[dragged_id.group][dragged_id.section_name].generic_activities_list[dragged_id.aNdx]).group_list_index;\n let droppedOnIndex = (reactData.bBoardList[droppedOn.group][droppedOn.section_name].generic_activities_list[droppedOn.aNdx]).group_list_index;\n // add draggedfrom from before droppedon\n // - this will change the position of everything after droppedon\n // - to remove the dragged from: \n // if it's position was LESS THAN droppedon, remove it in place\n // if it's position was GREATER THAN droppedon, add one and then remove it\n let entryToAdd = reactData.bBoardList[dragged_id.group].groupRec.common_activities[draggedFromIndex];\n reactData.bBoardList[dragged_id.group].groupRec.common_activities.splice(droppedOnIndex, 0, entryToAdd);\n if (draggedFromIndex > droppedOnIndex) {\n draggedFromIndex++;\n }\n reactData.bBoardList[dragged_id.group].groupRec.common_activities.splice(draggedFromIndex, 1);\n await dbClient\n .update({\n Key: {\n client_id: pClient,\n group_id: reactData.group_id\n },\n UpdateExpression: 'set #c = :c',\n ExpressionAttributeValues: {\n ':c': reactData.bBoardList[reactData.group_id].groupRec.common_activities\n },\n ExpressionAttributeNames: {\n '#c': 'common_activities'\n },\n TableName: \"Groups\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Group; error is: `, error);\n });\n let response = await setBBoard();\n updateReactData({\n bBoardList: response,\n changesMade: true\n }, true);\n };\n\n\n const handleChangeTextInput = (inputValue, section_name, ndx = 'new') => {\n if (!reactData.textInput.hasOwnProperty(section_name)) {\n reactData.textInput[section_name] = [];\n }\n if (inputValue.length === 1) {\n inputValue = inputValue.toUpperCase();\n }\n reactData.textInput[section_name][ndx] = inputValue;\n updateReactData({\n isError: false,\n textInput: reactData.textInput\n }, true);\n };\n\n async function saveNewTitle(section_name, ndx = 'new') {\n if (ndx !== 'new') {\n let rowObj = reactData.bBoardList[reactData.group_id][section_name].generic_activities_list[ndx];\n reactData.bBoardList[reactData.group_id][section_name].generic_activities_list[ndx].link_title = reactData.textInput[section_name][ndx];\n let updatedLine = `render.generic~[default=${rowObj.link_address}]~[title=${sentenceCase(reactData.textInput[section_name][ndx])}]`;\n reactData.bBoardList[reactData.group_id].groupRec.common_activities[rowObj.group_list_index] = updatedLine;\n await dbClient\n .update({\n Key: {\n client_id: pClient,\n group_id: reactData.group_id\n },\n UpdateExpression: 'set #c = :c',\n ExpressionAttributeValues: {\n ':c': reactData.bBoardList[reactData.group_id].groupRec.common_activities\n },\n ExpressionAttributeNames: {\n '#c': 'common_activities'\n },\n TableName: \"Groups\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Group; error is: `, error);\n });\n reactData.editMode[section_name][ndx] = false;\n updateReactData({\n bBoardList: reactData.bBoardList,\n editMode: reactData.editMode,\n changesMade: true\n }, true);\n }\n }\n\n async function setBBoard() {\n let response = await getBulletinBoard(pClient, reactData.group_id);\n if (!response || (!response.hasOwnProperty(reactData.group_id))) {\n response[reactData.group_id] = {\n groupRec: {\n group_id: reactData.group_id,\n common_activities: []\n }\n };\n }\n if (Object.keys(response[reactData.group_id]).length === 1) {\n if (!response[reactData.group_id].groupRec.hasOwnProperty('common_activities')) {\n reactData.needsHeader = true;\n response[reactData.group_id].groupRec.common_activities = [];\n }\n if (!response[reactData.group_id].groupRec.common_activities.some(l => {\n return (l.startsWith('~~Community Information'));\n })) {\n reactData.needsHeader = true;\n }\n response[reactData.group_id]['Community Information'] = {\n section_sort: '',\n generic_activities_list: [{\n group_list_index: 0,\n link_address: 'https://www.avaseniorconnect.com',\n link_title: 'Sample - AVA Senior Connect Web Site'\n }]\n };\n }\n return response;\n }\n\n\n // **************************\n\n React.useEffect(() => {\n async function initialize() {\n let response = await setBBoard();\n updateReactData({\n bBoardList: response,\n initialized: true\n }, true);\n }\n isMounted.current = true;\n if (!reactData.initialized) {\n initialize();\n }\n return () => { isMounted.current = false; };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n return (\n (reactData.initialized &&\n {\n if (reactData.changesMade) {\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n else {\n onClose();\n }\n }}\n className={classes.pageHead}\n fullScreen\n >\n \n \n \n {`Update/Add Links`}\n \n \n \n\n \n \n { /* Data rows */}\n \n \n {rowsWritten = 0}\n \n {Object.keys(reactData.bBoardList[reactData.group_id]).map((section_name, groupNdx) => (\n (section_name !== 'groupRec') &&\n \n { /* Group Title - name */}\n 0) ? 8 : 0}\n justifyContent='flex-start'\n alignItems='center'\n >\n \n {section_name.toLowerCase().startsWith('submenu') ? titleCase(section_name.slice(8)) : titleCase(section_name)}\n \n \n {rowsWritten++}\n \n\n \n \n \n { /* Add row for this Section */}\n \n {\n handleChangeTextInput(event.target.value, section_name);\n }}\n onKeyPress={async (event) => {\n await onCheckEnter(event, section_name);\n }}\n autoComplete='off'\n value={(reactData.textInput.hasOwnProperty(section_name) && reactData.textInput[section_name]['new'])\n ? reactData.textInput[section_name]['new']\n : ''\n }\n />\n \n {\n let reactUpdObj = {\n selectedSection: section_name\n };\n if (!reactData.textInput.hasOwnProperty(section_name)\n || !reactData.textInput[section_name].hasOwnProperty('new')\n || reactData.textInput[section_name].new.length < 1) {\n reactUpdObj.isError = true;\n }\n else {\n reactUpdObj.isError = false;\n reactUpdObj.addAttachment = true;\n }\n updateReactData(reactUpdObj, true);\n }}\n edge=\"start\"\n />\n {\n let reactUpdObj = {\n selectedSection: section_name\n };\n if (!reactData.textInput.hasOwnProperty(section_name)\n || !reactData.textInput[section_name].hasOwnProperty('new')\n || reactData.textInput[section_name].new.length < 1) {\n reactUpdObj.isError = true;\n }\n else {\n reactUpdObj.isError = false;\n reactUpdObj.addLink = true;\n }\n updateReactData(reactUpdObj, true);\n }}\n edge=\"start\"\n /> \n \n \n { /* Existing items in this Section */}\n {reactData.bBoardList[reactData.group_id][section_name].generic_activities_list.map((aData, aNdx) => (\n handleDragStart(e, { group: reactData.group_id, section_name, aData, aNdx })}\n onDragOver={(e) => handleDragOver(e)}\n onDrop={async (e) => {\n await handleDrop(e, { droppedOn: { group: reactData.group_id, section_name, aData, aNdx } });\n }}\n key={`row_box_grandparent-${aNdx}`}\n >\n \n\n {(reactData.editMode.hasOwnProperty(section_name) && reactData.editMode[section_name][aNdx])\n ?\n \n {\n reactData.editMode[section_name][aNdx] = false;\n updateReactData({\n editMode: reactData.editMode\n }, true);\n }}\n edge=\"start\"\n />\n {\n await saveNewTitle(section_name, aNdx);\n }}\n edge=\"start\"\n />\n {\n handleChangeTextInput(event.target.value, section_name, aNdx);\n }}\n onKeyPress={async (event) => {\n await onCheckEnter(event, section_name, aNdx);\n }}\n autoComplete='off'\n />\n \n :\n \n {\n if (!reactData.editMode.hasOwnProperty(section_name)) {\n reactData.editMode[section_name] = [];\n reactData.textInput[section_name] = [];\n }\n reactData.editMode[section_name][aNdx] = true;\n reactData.textInput[section_name][aNdx] = aData.link_title;\n updateReactData({\n editMode: reactData.editMode\n }, true);\n }}\n edge=\"start\"\n />\n {\n updateReactData({\n confirmMessage: `Are you sure you want to remove ${aData.link_title}?`,\n selectedObservation: aNdx,\n selectedSection: section_name,\n deletePending: true,\n spliceAt: aData.group_list_index\n }, true);\n }}\n edge=\"start\"\n />\n \n \n {\n let nowJ = new Date().getTime();\n window.open(`${aData.link_address}?qt=${nowJ.toString()}`, aData.link_title); // intentionally fall through to the message case\n }}\n />\n \n \n }\n \n \n ))\n }\n \n \n \n ))}\n \n {reactData.deletePending &&\n {\n updateReactData({\n deletePending: false\n }, true);\n }}\n onConfirm={async () => {\n reactData.bBoardList[reactData.group_id][reactData.selectedSection].generic_activities_list.splice(reactData.selectedObservation, 1);\n reactData.bBoardList[reactData.group_id].groupRec.common_activities.splice(reactData.spliceAt, 1);\n await dbClient\n .update({\n Key: {\n client_id: pClient,\n group_id: reactData.group_id\n },\n UpdateExpression: 'set #c = :c',\n ExpressionAttributeValues: {\n ':c': reactData.bBoardList[reactData.group_id].groupRec.common_activities\n },\n ExpressionAttributeNames: {\n '#c': 'common_activities'\n },\n TableName: \"Groups\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Group; error is: `, error);\n });\n let bbResponse = await setBBoard();\n updateReactData({\n bBoardList: bbResponse,\n deletePending: false,\n changesMade: true,\n spliceAt: -1\n }, true);\n }}\n >\n \n }\n {reactData.addAttachment &&\n {\n updateReactData({\n addAttachment: false\n }, true);\n }}\n onLoad={async (response) => {\n // where is the first entry on this section?\n let first_entry = reactData.bBoardList[reactData.group_id][reactData.selectedSection].generic_activities_list[0].group_list_index;\n let updatedLine = [`render.generic~[default=${response[0].fLoc}]~[title=${reactData.textInput[reactData.selectedSection]['new']}]`];\n if (reactData.needsHeader) {\n updatedLine.unshift(`~~${reactData.selectedSection}`);\n }\n reactData.bBoardList[reactData.group_id].groupRec.common_activities.splice(first_entry, 0, ...updatedLine);\n await dbClient\n .update({\n Key: {\n client_id: pClient,\n group_id: reactData.group_id\n },\n UpdateExpression: 'set #c = :c',\n ExpressionAttributeValues: {\n ':c': reactData.bBoardList[reactData.group_id].groupRec.common_activities\n },\n ExpressionAttributeNames: {\n '#c': 'common_activities'\n },\n TableName: \"Groups\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Group; error is: `, error);\n });\n let bbResponse = await setBBoard();\n reactData.textInput[reactData.selectedSection]['new'] = '';\n updateReactData({\n bBoardList: bbResponse,\n textInput: reactData.textInput,\n addAttachment: false,\n needsHeader: false,\n changesMade: true\n }, true);\n }}\n />\n }\n {reactData.addLink &&\n {\n updateReactData({\n addLink: false\n }, true);\n }}\n onSave={async (response) => {\n // where is the first entry on this section?\n if (!response[0].startsWith('http')) {\n response[0] = `https://${response[0]}`;\n }\n let first_entry = reactData.bBoardList[reactData.group_id][reactData.selectedSection].generic_activities_list[0].group_list_index;\n let updatedLine = [`render.generic~[default=${response[0]}]~[title=${reactData.textInput[reactData.selectedSection]['new']}]`];\n if (reactData.needsHeader) {\n updatedLine.unshift(`~~${reactData.selectedSection}`);\n }\n reactData.bBoardList[reactData.group_id].groupRec.common_activities.splice(first_entry, 0, ...updatedLine);\n await dbClient\n .update({\n Key: {\n client_id: pClient,\n group_id: reactData.group_id\n },\n UpdateExpression: 'set #c = :c',\n ExpressionAttributeValues: {\n ':c': reactData.bBoardList[reactData.group_id].groupRec.common_activities\n },\n ExpressionAttributeNames: {\n '#c': 'common_activities'\n },\n TableName: \"Groups\",\n })\n .promise()\n .catch(error => {\n cl(`caught error updating Group; error is: `, error);\n });\n let bbResponse = await setBBoard();\n reactData.textInput[reactData.selectedSection]['new'] = '';\n updateReactData({\n bBoardList: bbResponse,\n textInput: reactData.textInput,\n addLink: false,\n needsHeader: false,\n changesMade: true\n }, true);\n }}\n />\n }\n \n \n\n \n {\n if (reactData.changesMade) {\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n else {\n onClose();\n }\n }}\n startIcon={}\n >\n {'Done'}\n \n \n\n \n )\n );\n};\n","import React from 'react';\nimport { API, graphqlOperation } from 'aws-amplify';\nimport { Box, FormGroup, FormControl } from '@material-ui/core';\n\n\nimport NewCalendarEvent from '../dialogs/NewCalendarEvent';\nimport MessageForm from '../forms/MessageForm';\nimport MessageMonitor from './MessageMonitor';\nimport MessageFormLegacy from './MessageFormLegacy';\nimport MakeMessage from './MakeMessage';\nimport FileUpload from '../forms/FileUpload';\nimport ObservationForm from '../forms/ObservationForm';\nimport FamilyMaintenance from './FamilyMaintenance';\nimport FormFill from './FormFill';\nimport DocumentDashboardB from '../dialogs/DocumentDashboardB';\nimport MarqueeMaintenance from '../dialogs/MarqueeMaintenance';\nimport MultiObservationFormC from '../forms/MultiObservationFormC';\nimport MultiObservationFormD from '../forms/MultiObservationFormD';\nimport CheckInCheckOut from '../forms/CheckInCheckOut';\nimport RequestDashboard from '../dialogs/RequestDashboard';\nimport ReportRequest from './ReportRequest';\nimport CalendarDashboard from '../dialogs/CalendarDashboard';\nimport ShowCalendar from '../dialogs/ShowCalendar';\nimport ShowMenu from '../dialogs/ShowMenu';\nimport ShowEventActivity from '../dialogs/ShowEventActivity';\nimport LoadWorkOrderSpreadsheet from '../forms/LoadWorkOrderSpreadsheet';\nimport LoadNamesFromFile from '../forms/LoadNamesFromFile';\nimport ShowGroup from '../dialogs/ShowGroup';\nimport GroupForm from '../forms/GroupForm';\nimport AVASubscription from '../forms/AVASubscription';\nimport NumberForm from './NumberForm';\nimport Number2Form from './Number2Form';\nimport FreeTextForm from './FreeTextForm';\nimport PeopleMaintenance from '../dialogs/PeopleMaintenance';\nimport ClientMaintenance from '../dialogs/ClientMaintenance';\nimport FormManagement from '../dialogs/FormManagement';\n\nimport { createPutFact } from '../../graphql/mutations';\nimport { useSnackbar } from 'notistack';\nimport useSession from '../../hooks/useSession';\n\nimport VideoRecorder from 'react-video-recorder';\nimport ReactPlayer from 'react-player';\nimport AVAInHome from '../sections/AVAInHome';\nimport ShowMenuB from '../dialogs/ShowMenuB';\nimport BulletinBoard from '../dialogs/BulletinBoard';\n\nimport ImageGallery from 'react-image-gallery';\nimport \"react-image-gallery/styles/css/image-gallery.css\";\n\nexport default ({\n open,\n newFact,\n setNewFact,\n type,\n factName,\n session,\n message,\n values,\n qualifierTable,\n defaultValue,\n defaultObject,\n observationKey,\n onError,\n onSave,\n onClose,\n}) => {\n\n const { state } = useSession();\n\n const gallery = React.useRef(null);\n\n const [value, setValue] = React.useState(defaultValue || '');\n const [nums, setNums] = React.useState(['', '']);\n const [mOut, setMOut] = React.useState(message || 'enter something here');\n const { enqueueSnackbar } = useSnackbar();\n\n const [formState, setFormState] = React.useState(1);\n\n const [OGmessage, setOGmessage] = React.useState('');\n const [OGvalue, setOGvalue] = React.useState('');\n\n const [freeText, setFreeText] = React.useState('');\n\n if (OGmessage === '') {\n setOGmessage(message);\n }\n\n if (OGvalue === '' && type === 'document') {\n setOGvalue(value);\n }\n\n const onChangeQualText = event => {\n setFreeText(event.target.value);\n };\n\n const onChangeValue = event => {\n setValue(event.target.value);\n newFact.value = observationKey + '.' + event.target.value;\n setNewFact(newFact);\n };\n\n const onChangeNums = index => event => {\n const newNums = [...nums];\n newNums[index] = event.target.value;\n setNums(newNums);\n if (newNums[0] && newNums[1]) {\n newFact.value = observationKey + '.' + newNums.join(' over ');\n } else {\n newFact.value = 'number.partial';\n }\n setNewFact(newFact);\n };\n\n React.useEffect(() => {\n if (open) {\n setMOut(message);\n setFormState(1);\n } else {\n setValue(defaultValue || '');\n setNums(['', '']);\n setMOut(message || 'Enter something here');\n }\n }, [message]); // eslint-disable-line react-hooks/exhaustive-deps\n\n switch (type) {\n case 'characteristic_num':\n return (\n \n );\n case 'upload_file_legacy':\n return (\n \n 0}>\n
    \n \n
    \n {\n let fObj = target.target.files[0];\n let oName = fObj.name.toLowerCase().split('.');\n let oType = oName.pop();\n let fName = freeText ? (freeText + '.' + oType) : fObj.name;\n const pFile = {\n Bucket: 'theseus-medical-storage',\n Key: fName,\n Body: fObj,\n ACL: 'public-read-write',\n ContentType: fObj.type,\n Metadata: { 'Content-Type': fObj.type }\n };\n newFact.value.tag = freeText || oName;\n newFact.value.mediaData = pFile;\n }\n }\n />\n
    \n
    \n );\n // resync and re-post\n case 'people_maintenance':\n case 'person_maintenance': {\n let defaultValueObj = {};\n if (!defaultValue) { }\n else {\n if (Array.isArray(defaultValue)) {\n defaultValue.forEach(d => {\n if (typeof d === 'string') {\n let [dKey, dVal] = d.split('=');\n defaultValueObj[dKey] = dVal;\n }\n else {\n for (let dKey in d) {\n defaultValueObj[dKey] = d[dKey];\n }\n }\n });\n }\n else {\n try { defaultValueObj = JSON.parse(defaultValue); }\n catch { console.log(defaultValue); }\n }\n }\n return (\n {\n if (updatedPerson && updatedPerson.saveCompleted) {\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n else {\n onClose();\n }\n }}\n />\n );\n }\n case 'client_maintenance': {\n return (\n {\n if (updatedPerson) {\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n else {\n onClose();\n }\n }}\n />\n );\n }\n case 'form_management': {\n return (\n {\n onClose();\n }}\n />\n );\n }\n case 'make_payment': {\n window.open('https://buy.stripe.com/3cs5lzbSS9RXecwcMN');\n onClose();\n break;\n }\n case 'record_video':\n var dateOptions = { month: 'short', day: 'numeric' };\n return (\n \n 0}>\n
    \n {!freeText ?\n (defaultValue ?\n setFreeText(defaultValue + \" - \" + new Date().toLocaleDateString('en-US', dateOptions))\n :\n setFreeText((session.patient_display_name.split(',')[1] || session.patient_display_name.split(' ')[0]) + \"'s video - \"\n + new Date().toLocaleDateString('en-US', dateOptions)))\n : null}\n \n
    \n {\n const pVideo = {\n Bucket: 'theseus-medical-storage',\n Key: freeText.replace('.', '_') + '.webm',\n Body: videoBlob,\n ACL: 'public-read-write',\n ContentType: 'video/webm'\n };\n newFact.value.tag = freeText;\n newFact.value.mediaData = pVideo;\n newFact.value.recordingStatus = 'stopped';\n }}\n onStartRecording={() => {\n newFact.value.recordingStatus = 'started';\n }}\n />\n
    \n
    \n );\n case 'play_video':\n return (\n {\n console.log(err);\n let eValue = `error_value.Video error (user not notified) - err is ${JSON.stringify(err)}`;\n if (err?.target?.error?.message) {\n enqueueSnackbar(`I'm sorry... AVA can't play that video. (${err?.target?.error?.message || 'Details not provided'})`, { variant: 'error' });\n eValue = `error_value.File=${defaultValue} Code=${err?.target?.error?.code} Message=${err?.target?.error?.message}`;\n await API\n .graphql(graphqlOperation(createPutFact, {\n input: {\n patient_id: session.patient_id,\n activity_key: 'error.videoPlayer',\n status: new Date().toString(),\n value: eValue,\n qualifier: null,\n session: {\n user_id: session.user_id,\n session_id: session.session_id\n },\n }\n }))\n .catch(error => { console.log(error); });\n }\n }}\n />\n );\n case 'show_image': {\n let defaultValueObj = {};\n if (!defaultValue) {\n defaultValueObj = { images: [] };\n }\n else {\n if (Array.isArray(defaultValue)) {\n defaultValue.forEach(d => {\n if (typeof d === 'string') {\n let [dKey, dVal] = d.split('=');\n defaultValueObj[dKey] = dVal;\n }\n else {\n for (let dKey in d) {\n defaultValueObj[dKey] = d[dKey];\n }\n }\n });\n }\n else {\n try { defaultValueObj = JSON.parse(defaultValue); }\n catch { console.log(defaultValue); }\n }\n }\n return (\n {\n e.preventDefault();\n }}\n >\n {\n }}\n />\n \n );\n };\n case 'characteristic_num2':\n return (\n \n );\n /* Candidate for retirement\n case 'document':\n let nowJ = new Date().getTime();\n window.open(`${defaultValue}?qt=${nowJ.toString()}`, message); // intentionally fall through to the message case\n return;\n */\n /* Candidate for retirement\n case 'message':\n return (\n \n );\n */\n case 'message_list':\n if ((session.client_style.allow_old_messaging) && !state.patient.useNewMessaging) {\n return (\n {\n if (instruction !== 'restart') {\n onSave();\n }\n else {\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n }}\n defaultValue={defaultValue}\n />\n );\n }\n else {\n return (\n \n );\n }\n case 'message_monitor': {\n let defaultValueObj = {};\n if (!defaultValue) { defaultValueObj = { recipientID: '*select' }; }\n else {\n if (Array.isArray(defaultValue)) {\n defaultValue.forEach(d => {\n if (typeof d === 'string') {\n let [dKey, dVal] = d.split('=');\n defaultValueObj[dKey] = dVal;\n }\n else {\n for (let dKey in d) {\n defaultValueObj[dKey] = d[dKey];\n }\n }\n });\n }\n else {\n try { defaultValueObj = JSON.parse(defaultValue); }\n catch { console.log(defaultValue); }\n }\n }\n return (\n {\n onClose();\n }}\n />\n );\n }\n case 'make_message': {\n let defaultValueObj = {};\n if (!defaultValue) { defaultValueObj = { recipientID: '*select' }; }\n else {\n if (Array.isArray(defaultValue)) {\n defaultValue.forEach(d => {\n if (typeof d === 'string') {\n let [dKey, dVal] = d.split('=');\n defaultValueObj[dKey] = dVal;\n }\n else {\n for (let dKey in d) {\n defaultValueObj[dKey] = d[dKey];\n }\n }\n });\n }\n else {\n try { defaultValueObj = JSON.parse(defaultValue); }\n catch { console.log(defaultValue); }\n }\n }\n let recipients = [];\n if ((defaultValueObj.hasOwnProperty('recipientID')) && (Object.keys(defaultValueObj.recipientID).length > 0)) {\n for (const [i, person_id] of [defaultValueObj.recipientID].flat().entries()) {\n recipients.push({\n person_id,\n person_name: ([defaultValueObj.recipientName].flat()[i] || `user ${person_id}`)\n });\n }\n }\n if ((session.client_style.allow_old_messaging) && !state.patient.useNewMessaging) {\n return (\n \n );\n }\n else {\n return (\n );\n }\n };\n case 'bulletin_board':\n return (\n \n );\n case 'submit_report':\n let requestor = [];\n if (defaultObject.hasOwnProperty('requestor') && ([defaultObject.requestor].flat().length > 0)) {\n requestor = [defaultObject.requestor].flat();\n }\n if (!requestor.includes(session.user_id)) {\n requestor.push(session.user_id);\n }\n return (\n {\n onClose(response);\n }}\n />\n );\n case 'upload_file':\n return (\n \n );\n case 'observation_form':\n return (\n {\n newFact.commonKey = requestNumber;\n newFact.value.selected = oSelected;\n newFact.value.freeText = fText;\n newFact.value.qualifiers = fQualifiers;\n newFact.status = 'confirmed';\n setNewFact(newFact);\n onSave();\n }}\n onClose={onClose}\n />\n );\n case 'subscription_management':\n return (\n \n );\n case 'multi_observation':\n case 'multi_observation_type2':\n case 'multi_observation_type3':\n return (\n \n );\n case 'multi_observation_type4':\n case 'multi_observation_image_based':\n return (\n \n );\n case 'checkout':\n return (\n \n );\n case 'request_dashboard': {\n let filter = {};\n if (defaultObject.hasOwnProperty('request_type')) { }\n else if (newFact?.value?.freeText?.requestType) {\n filter = { request_type: newFact.value.freeText.requestType };\n }\n else {\n filter = { person_id: session.patient_id };\n };\n return (\n {\n onClose(response);\n }}\n />\n );\n }\n case 'calendar_dashboard': {\n let filter = { person_id: session.patient_id };\n if (newFact?.value?.freeText?.requestType) {\n filter = { request_type: newFact.value.freeText.requestType };\n }\n return (\n \n );\n }\n case 'new_event':\n let isAppointment = false;\n let personalEvent = false;\n let defaultObj = {};\n if (Array.isArray(defaultValue)) {\n defaultValue.forEach(dV => {\n if (typeof (dV) === 'string') {\n let [dVKey, dVValue] = dV.split('=');\n if (dVValue) {\n dV = { [dVKey]: dVValue };\n }\n }\n if (dV.hasOwnProperty('isAppointment')) {\n isAppointment = true;\n personalEvent = true;\n }\n else if (dV.hasOwnProperty('personalEvent')) {\n personalEvent = true;\n }\n Object.assign(defaultObj, dV);\n });\n }\n return (\n \n );\n case 'edit_marquee':\n return (\n \n );\n case 'show_calendar':\n case 'calendar_history':\n case 'add_calendar':\n let OGsession = {};\n Object.assign(OGsession, session);\n return (\n \n );\n case 'show_menu':\n return (\n \n );\n case 'show_menuB':\n return (\n \n );\n case 'load_names':\n return (\n \n );\n case 'family_maintenance':\n return (\n \n );\n case 'form_fill':\n return (\n \n );\n case 'document_dashboard':\n return (\n \n );\n case 'load_workorder_sheet':\n return (\n \n );\n case 'show_event':\n return (\n \n );\n case 'show_groups':\n return (\n {\n if (updatesMade) {\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n else {\n onSave();\n }\n }}\n onAbort={onClose}\n />\n );\n case 'manage_groups':\n return (\n {\n if (updatesMade) {\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n else {\n onSave();\n }\n }}\n onAbort={onClose}\n />\n );\n case 'manage_forms':\n return (\n // defaults, focusAt, onCancel, onSelect, onRefresh \n \n );\n case 'carousel':\n case 'in_home':\n return (\n \n );\n case 'group_form':\n return (\n {\n if (updatesMade) {\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n else {\n onSave();\n }\n }}\n />\n );\n default:\n enqueueSnackbar(`AVA needs to update this function. Please try again later.`, { variant: 'error' });\n }\n};\n","import React from 'react';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\n// import useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport { useSnackbar } from 'notistack';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\n\nimport DynamicForm from '../forms/DynamicForm';\n\nimport { AVAclasses, AVADefaults } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n appBar: {\n position: 'relative',\n alignItems: 'center',\n justifyContent: 'center',\n },\n margin: {\n margin: theme.spacing(1),\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n fontWeight: 'bold',\n },\n dialogBox: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n minWidth: '100%',\n backgroundColor: AVADefaults({ client_style: 'get' }) ? AVADefaults({ client_style: 'get' }).backgroundColor : null,\n },\n formControl: {\n marginLeft: theme.spacing(3),\n minWidth: '100%',\n },\n reject: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(3),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n color: theme.palette.reject[theme.palette.type],\n },\n confirm: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(3),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n color: theme.palette.confirm[theme.palette.type],\n },\n descriptionText: {\n marginLeft: theme.spacing(3),\n marginTop: 0,\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n },\n warningText: {\n marginLeft: theme.spacing(3),\n marginTop: 0,\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontSize: '0.8rem',\n fontWeight: 'bold',\n color: 'red'\n },\n subDescriptionText: {\n marginLeft: theme.spacing(3),\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(5),\n fontColor: 'red',\n fontSize: '0.8rem',\n },\n searchLine: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(4),\n marginTop: 0,\n marginBottom: theme.spacing(1),\n padding: 0,\n minWidth: '100%',\n fontSize: '0.8rem',\n },\n searchBox: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(4),\n marginTop: 0,\n marginBottom: theme.spacing(1),\n padding: 0,\n minWidth: '100%',\n fontSize: '0.8rem',\n },\n}));\n\nexport default ({ fact, session, open, fromHome, onClose, onSave, onNext, onSelected }) => {\n const [newFact, setNewFact] = React.useState(null);\n const [message, setMessage] = React.useState('enter an initial value');\n const [statusMessage, setStatusMessage] = React.useState('');\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n const { enqueueSnackbar } = useSnackbar();\n const [factImageClass, setFactImageClass] = React.useState(false);\n const [factIOClass, setFactIOClass] = React.useState(false);\n const [factEventClass, setFactEventClass] = React.useState(false);\n const [factMessageClass, setFactMessageClass] = React.useState(false);\n\n const [executionDefaultValue, setExecutionDefaultValue] = React.useState('');\n const [qualifierTable, setQualifierTable] = React.useState({});\n const [associationsTable, setAssociationsTable] = React.useState({});\n\n var withNext;\n var oopsie;\n\n const handleNext = () => {\n withNext = true;\n handleExit();\n };\n\n const handleSkip = () => {\n withNext = true;\n newFact.value = 'value.SKIPPED';\n setNewFact(newFact);\n onNext(newFact);\n };\n\n const handleSave = () => {\n if (newFact.value.recordingStatus === 'started') {\n enqueueSnackbar(`AVA is still recording! Tap the square button to stop recording before tapping Save.`, { variant: 'warning', persist: true });\n }\n else {\n withNext = false;\n handleExit();\n }\n };\n\n /*\n const onSearchInput = event => {\n setSearchText(event.target.value.toLowerCase());\n };\n */\n\n const handleExit = () => {\n let badData = false;\n if (typeof newFact.value !== 'object') {\n let xVal = newFact.value.replace('.', '~').split('~')[1];\n if (xVal === 'null' || xVal === '') {\n badData = true;\n } else if (fact.numeric_minimum || fact.numeric_maximum) {\n let fVal = parseFloat(xVal);\n if (\n !fVal ||\n fVal === '' ||\n fVal < 0 ||\n (fact.numeric_minimum && fVal < parseFloat(fact.numeric_minimum)) ||\n (fact.numeric_maximum && fVal > parseFloat(fact.numeric_maximum))\n ) {\n badData = true;\n setStatusMessage(`${fVal} is not an allowed value`);\n }\n } else if (fact.type === 'characteristic_num2' && !xVal.includes('over')) {\n badData = true;\n setStatusMessage(`We expected two numbers here`);\n }\n } else {\n if (fact.numeric_minimum\n && (!fact.type.startsWith('characteristic_num'))\n && newFact.value.selected\n && newFact.value.selected.length < parseInt(fact.numeric_minimum, 10)) {\n badData = true;\n if (newFact.value.selected.length === 0) {\n oopsie = `Ooops! I don't see that you made any selections before pressing SAVE.\n You need to make at least ${fact.numeric_minimum} selection${fact.numerica_minimum === '1' ? '' : 's'}, please.`;\n }\n else if (newFact.value.selected.length === 1) {\n oopsie = `Ooops! Did you forget something? We expected at least ${fact.numeric_minimum} selections, \n but I only see 1... ${newFact.value.selected.join(', ')}`;\n }\n else {\n oopsie = `Ooops! Did you forget something? We expected at least ${fact.numeric_minimum} selections, \n but I only see ${newFact.value.selected.length}. They are: ${newFact.value.selected.join(', ')}`;\n }\n enqueueSnackbar(oopsie, { variant: 'error', persist: true });\n setMessage('!!!!! ' + oopsie + ' !!!!!');\n }\n else if (factMessageClass) {\n let goodMessage = false;\n for (let e in newFact.value.freeText) {\n goodMessage = (e.slice(0, 1) !== '%') || goodMessage;\n }\n if (!goodMessage) {\n badData = true;\n oopsie = 'Enter your message text before pressing SEND';\n enqueueSnackbar(oopsie, { variant: 'error', persist: true });\n setMessage('!!!!! ' + oopsie + ' !!!!!');\n }\n }\n else {\n if (fact.type === 'upload_file' && !newFact.value.mediaData) {\n badData = true;\n oopsie = 'You must choose a file to upload before pressing SAVE';\n enqueueSnackbar(oopsie, { variant: 'error', persist: true });\n setMessage('!!!!! ' + oopsie + ' !!!!!');\n }\n }\n }\n if (!badData) {\n // setMessage('');\n // setStatusMessage('');\n if (!factIOClass) { handleClose(); }\n else if (withNext) { onNext(newFact); }\n else { onSave(newFact); }\n }\n return badData;\n };\n\n function handleClose(response) {\n if (newFact.value.recordingStatus === 'started') {\n enqueueSnackbar(`Warning! You'll lose everything! AVA is still recording. Press the square button to stop recording, then Cancel or Save.`, { variant: 'warning', persist: true });\n }\n else {\n onClose(response);\n }\n };\n\n const disableSave = value => {\n // setDisable(value);\n };\n\n React.useEffect(() => {\n if (fact && session) {\n let factCode = (fact.code || fact.activity_code).split('.')[0];\n setFactEventClass(false);\n switch (factCode) {\n case 'document':\n case 'render':\n case 'query':\n case 'action':\n case 'list': { break; }\n case 'images':\n case 'promo': { setFactImageClass(true); break; }\n case 'media': { setFactIOClass(true); break; }\n case 'message': { setFactMessageClass(true); setFactIOClass(true); break; }\n case 'search': { setFactEventClass(true); break; }\n default: {\n setFactIOClass(true);\n if (fromHome === 'event') {\n setFactEventClass(true);\n }\n }\n }\n let eString;\n switch (fact.type) {\n case 'characteristic_num2': {\n if (fact.prompt) {\n eString = fact.prompt;\n } else {\n eString = 'Enter numbers in both boxes';\n }\n break;\n }\n case 'characteristic_num': {\n if (fact.prompt) {\n eString = fact.prompt;\n } else {\n eString = 'Enter a number';\n if (fact.numeric_minimum) {\n if (fact.numeric_maximum) {\n eString += ' between ' + fact.numeric_minimum + ' and ' + fact.numeric_maximum;\n } else {\n eString += ', no less than ' + fact.numeric_minimum;\n }\n } else {\n if (fact.numeric_maximum) {\n eString += ', no greater than ' + fact.numeric_maximum;\n }\n }\n }\n break;\n }\n case 'make_message': {\n setFactIOClass(false);\n break;\n }\n case 'message': {\n if (fact.prompt) {\n eString = fact.prompt;\n } else {\n eString = 'Enter a message';\n }\n fact.default_value = '';\n break;\n }\n case 'document': {\n if (fact.prompt) {\n eString = fact.prompt;\n } else {\n eString = fact.name;\n }\n break;\n }\n case 'list_multiple': {\n if (fact.prompt) {\n eString = fact.prompt;\n } else {\n eString = 'Select from this list';\n }\n break;\n }\n case 'reservation':\n case 'form': {\n setFactEventClass(false);\n if (fact.prompt) {\n eString = fact.prompt;\n } else {\n eString = ' ';\n }\n break;\n }\n default: {\n if (fact.prompt) {\n eString = fact.prompt;\n } else {\n eString = ' ';\n }\n }\n }\n setMessage(eString);\n }\n\n if (!fact) {\n // eslint-disable-next-line\n fact = { \"noData\": true };\n };\n\n let defaultValue = '';\n let lQ = [];\n try {\n if (fact.fact_history &&\n fact.fact_history[0].value &&\n !fact.observation_status.includes('(exp)') &&\n !fact.code.startsWith('form.') &&\n !fact.code.startsWith('media.')\n ) { defaultValue = fact.fact_history[0].value; }\n else { defaultValue = fact.default_value; };\n if (\n fact.fact_history &&\n fact.fact_history[0].qualifier &&\n fact.fact_history[0].qualifier.length > 0 &&\n !fact.code.startsWith('form.')) {\n lQ = fact.fact_history[0].qualifier;\n };\n }\n catch (e) {\n console.error(e);\n }\n setExecutionDefaultValue(defaultValue);\n setQualifierTable(fact.value_qualifiers);\n setAssociationsTable(associationsTable);\n\n var mF = '';\n let vL = Array.isArray(fact.valid_values_list) ? fact.valid_values_list.length : 0;\n if (vL > 0) {\n let v = 0;\n do {\n if (fact.valid_values_list[v].includes('~^')) { // ~^ indicates free form text box \n [, mF] = fact.valid_values_list[v].split(':'); // prompt with the string after the \":\"\n }\n v++;\n } while (v < vL && !mF);\n }\n\n let nF = {\n client_id: fact.client_id || session.client_id,\n patient_id: session.patient_id || session.user_id,\n activity_key: fact.code || fact.activity_code,\n value: (fact.type === 'reservation')\n ? fact.default_value\n : {\n selected: [],\n associations: associationsTable,\n freeText: {},\n },\n session: {\n user_id: session.user_id,\n session_id: session.session_id,\n },\n };\n\n if ('messaging' in fact) { nF.messaging = fact.messaging; }\n\n if (defaultValue\n && fact.type !== 'reservation'\n && fact.type !== 'play_video'\n && fact.type !== 'make_message'\n ) {\n if (defaultValue.length > 0) {\n defaultValue.forEach(nfValue => {\n if (typeof nfValue === 'string') {\n let [value, freeText] = nfValue.trim().split(\"=\");\n value = value.trim();\n if (freeText) {\n freeText = freeText.trim();\n nF.value.freeText[value] = freeText;\n if (value === mF) {\n setMessage(freeText);\n }\n } else {\n nF.value.selected.push(value);\n }\n }\n });\n }\n\n if (lQ.length > 0) {\n nF.value.qualifiers = {};\n lQ.forEach(qStr => {\n let [value, qArr] = qStr.split(':');\n nF.value.qualifiers[value] = [...qArr.split(',')];\n });\n }\n }\n\n setNewFact(nF);\n\n }, [fact]); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n \n {fact?.name}\n \n {message?.startsWith('!!!')\n ? {message}\n : {message}\n }\n {statusMessage &&\n {statusMessage}\n }\n \n {fact ? (\n {\n handleClose(response);\n }}\n />\n ) : null}\n \n \n {!fact &&\n {\n handleClose(response);\n }}\n >\n {!factIOClass ? 'Done' : 'Cancel'}\n \n }\n {factImageClass &&\n {\n handleClose(response);\n }}\n >\n Done\n \n }\n {factIOClass\n ? (\n {factMessageClass ? 'Send' : 'Save'}\n \n )\n : null\n }\n {factEventClass\n ? (\n \n \n {'Next'}\n \n \n Skip\n \n \n ) : null}\n \n \n );\n};","import React from 'react';\nimport { Auth } from '@aws-amplify/auth';\nimport { recordExists, isObject, cl, switchActiveAccount, makeArray, dbClient, lambda, deepCopy, getMarqueeMessage } from '../../util/AVAUtilities';\nimport { makeDate, makeTime } from '../../util/AVADateTime';\nimport { getImage } from '../../util/AVAPeople';\nimport { getActivity } from '../../util/AVAObservations';\nimport { getActivityDetail } from '../../util/AVAActivityLoader';\nimport { AVATextStyle, AVADefaults, hexToRgb, isDark } from '../../util/AVAStyles';\n\nimport { Snackbar } from '@material-ui/core';\nimport Alert from '@material-ui/lab/Alert';\nimport AlertTitle from '@material-ui/lab/AlertTitle';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n// import useMediaQuery from '@material-ui/core/useMediaQuery';\nimport Marquee from \"react-fast-marquee\";\n\nimport { useCookies } from 'react-cookie';\nimport { useIdleTimer } from 'react-idle-timer';\nimport useSession from '../../hooks/useSession';\nimport SwitchPatientDialog from '../dialogs/SwitchPatientDialog';\nimport PatientDialog from '../dialogs/PatientDialog';\nimport PeopleMaintenance from '../dialogs/PeopleMaintenance';\nimport NewFactDialog from '../dialogs/NewFactDialog';\nimport MakeAVAMenu from '../../util/MakeAVAMenu';\n\nimport List from '@material-ui/core/List';\nimport Box from '@material-ui/core/Box';\nimport Avatar from '@material-ui/core/Avatar';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport IconButton from '@material-ui/core/IconButton';\nimport Dialog from '@material-ui/core/Dialog';\n\nimport Menu from '@material-ui/core/Menu';\nimport MenuList from '@material-ui/core/MenuList';\nimport MenuItem from '@material-ui/core/MenuItem';\n\nimport EditIcon from '@material-ui/icons/PersonOutlineOutlined';\nimport FavoriteIcon from '@material-ui/icons/FavoriteBorder';\nimport NotFavorite from '@material-ui/icons/DeleteForever';\nimport ExitToAppIcon from '@material-ui/icons/ExitToApp';\nimport SwapHorizIcon from '@material-ui/icons/SwapHoriz';\nimport SubscriptionIcon from '@material-ui/icons/CardMembership';\nimport HomeIcon from '@material-ui/icons/Home';\nimport AutorenewIcon from '@material-ui/icons/Autorenew';\nimport NewReleasesOutlinedIcon from '@material-ui/icons/NewReleasesOutlined';\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport PersonAddIcon from '@material-ui/icons/PersonAdd';\nimport SearchIcon from '@material-ui/icons/Search';\n\nimport Tooltip from '@material-ui/core/Tooltip';\nimport QuickSearch from './QuickSearch';\n\nconst useStyles = makeStyles(theme => ({\n page: {\n height: 950,\n maxWidth: 1000\n },\n progressBar: {\n marginBottom: theme.spacing(3),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px'\n },\n pendingBar: {\n marginRight: theme.spacing(2.2),\n marginTop: theme.spacing(1),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px',\n alignSelf: 'flex-end'\n },\n freeInput: {\n marginLeft: '25px',\n marginRight: 2,\n marginBottom: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: theme.spacing(1),\n width: '60%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n },\n avatar: {\n marginTop: 0,\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: 0,\n height: 60,\n width: 60,\n paddingTop: 0,\n fontSize: '1.3rem',\n },\n logoSmall: {\n maxWidth: '100px',\n marginBottom: '15px'\n },\n popUpMenuButton: {\n alignContent: 'center',\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n paddingTop: 0,\n fontSize: '1.3rem',\n },\n popUpMenu: {\n marginRight: theme.spacing(3),\n paddingRight: 2,\n },\n title: {\n marginTop: 0,\n marginLeft: 0,\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n hello: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: 0,\n fontSize: theme.typography.fontSize * 1.5,\n },\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n rowButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'contained',\n size: 'small'\n },\n rowButtonDefault: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n color: theme.palette.reject[theme.palette.type],\n },\n rowButtonGreen: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n },\n rowButtonBlue: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n },\n listItem: {\n justifyContent: 'space-between',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(1),\n },\n sectionHeader: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n },\n messageArea: {\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n clientBackground: {\n backgroundColor: AVADefaults({ client_style: 'get' }) ? AVADefaults({ client_style: 'get' }).backgroundColor : null\n },\n clientPopUp: {\n borderRadius: '30px 30px 30px 30px',\n },\n\n profileArea: {\n alignItems: 'center'\n },\n popUpMenuRow: {\n marginLeft: theme.spacing(1),\n fontSize: theme.typography.fontSize * 1.0,\n },\n popUpFooter: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n logoDisplay: {\n maxWidth: '600px',\n },\n\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n makeIconStyle: {\n marginRight: theme.spacing(1),\n },\n locationLine: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n preferenceLine: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n techInfoLine: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(2),\n },\n techInfoLine2: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(4),\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n lastName: {\n fontWeight: 'bold',\n marginRight: theme.spacing(1),\n },\n boldCenter: {\n fontWeight: 'bold',\n textAlign: 'center'\n }\n}));\n\nexport default ({ pPerson, patient, defaultClient, onReset }) => {\n\n const classes = useStyles();\n const subMenuHead = React.useRef(null);\n const { state } = useSession();\n const { roles, session } = state;\n\n const [, , removeCookie] = useCookies(['AVAuser']);\n\n const [reactData, setReactData] = React.useState({\n mainMenu: [],\n greetingName: '',\n greetingWords: '',\n loading: 'Initializing',\n progress: 100,\n pWidth: 60,\n currentMenu: 'main',\n menuArray: ['main'],\n menuNames: [],\n selected: null,\n sectionOpen: {},\n current_time: new Date(),\n showPersonSelect: false,\n popupMenuOpen: false,\n showProfileEdit: false,\n showNewFactDialog: -1,\n showAddAccount: false,\n showQuickSearch: false,\n accessList: false,\n showProfileEdit_id: false,\n linkedPersonFilter: '',\n showPasswordEdit: false,\n groupData: {},\n anchorEl: null,\n lastActiveTime: new Date(),\n idleState: true,\n enteredIdleStateTime: new Date(),\n menu_reloaded: false,\n loadedMenuVersion: 1,\n marqueeData: [],\n marqueeVersion: 0,\n alert: false\n });\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n newData.current_time = new Date();\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n let currentSection = '';\n\n const oneMinute = 1000 * 60;\n const oneHour = 60 * oneMinute;\n const msBeforeSleeping = 1 * oneMinute;\n\n let user_fontSize = AVADefaults({ fontSize: 'get' });\n\n const avatarStyle = background_color => {\n if (isDark(background_color)) {\n return {\n width: `${(50 * user_fontSize)}px`,\n height: `${(50 * user_fontSize)}px`,\n padding: '10px',\n borderRadius: '30px',\n backgroundColor: 'cornsilk'\n };\n }\n else {\n return {\n width: `${(50 * user_fontSize)}px`,\n height: `${(50 * user_fontSize)}px`,\n padding: '10px',\n borderRadius: '30px',\n backgroundColor: `${background_color}b2`\n };\n }\n };\n\n const onIdle = async () => {\n let now = new Date();\n let minutesSinceActive = 0;\n if (!reactData.idleState) {\n cl(`Entering idle state at ${now.toLocaleString()}.`);\n updateReactData({\n idleState: true,\n enteredIdleStateTime: now,\n }, true);\n }\n else {\n minutesSinceActive = Math.floor((now.getTime() - reactData.enteredIdleStateTime.getTime()) / oneMinute);\n cl(`Still idle at ${new Date().toLocaleString()}. Idle for ${minutesSinceActive} minutes.`);\n }\n if ((minutesSinceActive > 60) || (state.session?.kiosk_mode && state.profile?.kiosk_mode)) {\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${now.getTime()}`);\n }\n else if (!reactData.menu_reloaded) {\n await checkReload();\n }\n else if ((now.getTime() - reactData.lastActiveTime.getTime()) > (5 * oneMinute)) {\n cl(`Update while idle at ${now.toLocaleString()}.`);\n let options = {\n belongsTo: (state.groups ? state.groups.belongsTo : {}),\n client_weather: state.session.client_weather\n };\n let marqueeData = [\n { message: `${reactData.greetingWords}, ${reactData.greetingName}!` },\n { message: `AVA for ${state.session.client_name}` }\n ];\n marqueeData.push(...(await getMarqueeMessage(session.client_id, options)));\n let urgentMessage = marqueeData.find(m => {\n return (m.criticalMessage || m.priorityMessage);\n });\n if (urgentMessage) {\n marqueeData = [urgentMessage];\n }\n updateReactData({\n lastActiveTime: now,\n marqueeData: marqueeData,\n marqueeVersion: reactData.marqueeVersion++\n }, true);\n }\n reset();\n };\n\n const checkReload = async () => {\n let menuRec = await dbClient\n .get({\n Key: { person_id: `${state.session.patient_id}%%${state.session.user_id}` },\n TableName: \"AVAMenu\"\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'No internet',\n message: `There is no internet connection.`\n }\n }, true);\n }\n cl(`caught error getting People record; error is:`, error);\n });\n if (recordExists(menuRec) && (menuRec.Item.menu_version !== reactData.loadedMenuVersion)) {\n let reactUpdObj = {\n menu_reloaded: true,\n loadedMenuVersion: menuRec.Item.menu_version\n };\n if ((menuRec.Item.AVA_main_menu.length > 0)) {\n reactUpdObj.mainMenu = menuRec.Item.AVA_main_menu;\n }\n updateReactData(reactUpdObj, true);\n }\n };\n\n async function onAction() {\n let now = new Date();\n if ((reactData.idleState) || ((now.getTime() - reactData.lastActiveTime.getTime()) > oneMinute)) {\n cl(`Action/Update at ${now.toLocaleString()}. Last active at ${reactData.lastActiveTime.toLocaleString()}`);\n let options = {\n belongsTo: (state.groups ? state.groups.belongsTo : {}),\n client_weather: state.session.client_weather\n };\n let marqueeData = [\n { message: `${reactData.greetingWords}, ${reactData.greetingName}!` },\n { message: `AVA for ${state.session.client_name}` }\n ];\n marqueeData.push(...(await getMarqueeMessage(session.client_id, options)));\n let urgentMessage = marqueeData.find(m => {\n return (m.criticalMessage || m.priorityMessage);\n });\n if (urgentMessage) {\n marqueeData = [urgentMessage];\n }\n updateReactData({\n lastActiveTime: now,\n idleState: false,\n marqueeData: marqueeData,\n marqueeVersion: reactData.marqueeVersion++\n }, true);\n }\n if (!reactData.menu_reloaded) {\n await checkReload();\n }\n reset();\n };\n\n const { start, reset, pause } = useIdleTimer({\n onIdle,\n onAction,\n timeout: msBeforeSleeping,\n throttle: 500\n });\n\n let nowTime = new Date().getTime();\n\n const buildMenu = async (reload = false, beQuiet = null) => {\n let reactUpdObj = {\n sectionOpen: {}\n };\n // AVA_section_open in People record, or (legacy code) current_event in SessionV2 record\n // is used to save what the screen looked like last time the user was in AVA\n let menuRec = await dbClient\n .get({\n Key: {\n person_id: `${state.session.patient_id}%%${state.session.user_id}`\n },\n TableName: \"AVAMenu\"\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n reactUpdObj.alert = {\n severity: 'error',\n title: 'No internet',\n message: `There is no internet connection.`\n };\n }\n else {\n reactUpdObj.alert = {\n severity: 'error',\n title: 'Unusual error',\n message: `When getting your menu history, an error occurred. The error is ${error}`\n };\n }\n });\n if (recordExists(menuRec)) {\n reactUpdObj.loadedMenuVersion = menuRec.Item.menu_version;\n reactUpdObj.sectionOpen = menuRec.Item.AVA_section_open || {};\n if ((menuRec.Item.AVA_main_menu && (menuRec.Item.AVA_main_menu.length > 0)) && !reload) {\n reactUpdObj.mainMenu = menuRec.Item.AVA_main_menu;\n updateReactData(reactUpdObj, true);\n return menuRec.Item.AVA_main_menu;\n }\n }\n\n // we are going to have to build their menu for the first time...\n let forceRefresh = true;\n let wholeMenu = await MakeAVAMenu(patient, defaultClient, (beQuiet ? screenQuiet : screenStatus), null, forceRefresh, state);\n\n if (wholeMenu.length > 0) {\n await updateAVA(reactData.sectionOpen, wholeMenu);\n reactUpdObj.mainMenu = wholeMenu;\n updateReactData(reactUpdObj, true);\n return wholeMenu;\n }\n else {\n reactUpdObj.alert = {\n severity: 'info',\n title: 'Warning',\n message: `AVA didn't find any options for you. Ask AVA Support to check on this.`\n };\n let helpRow = {\n activity_code: 'message.chubbie_request',\n activity_name: 'Send a message to AVA Support',\n child_menu: null,\n default_value: null,\n menu_name: 'help',\n parent_menu: null,\n row_color: '#a1adb8',\n row_type: 'message',\n section_color: '#a1adb8',\n section_icon: 'https://ava-icons.s3.amazonaws.com/icons8-new-message-50.png',\n section_name: 'Get AVA Help',\n sort_key: 'Messages, Comments, and Feedback'\n };\n reactUpdObj.sectionOpen = { 'Get AVA Help': true };\n reactUpdObj.mainMenu = [helpRow];\n updateReactData(reactUpdObj, true);\n }\n // end\n return reactUpdObj.mainMenu;\n };\n\n const updateAVA = async (pOpen, pMenu) => {\n if (pOpen) {\n dbClient\n .update({\n Key: { person_id: `${state.session.patient_id}%%${state.session.user_id}` },\n UpdateExpression: 'set AVA_section_open = :o',\n ExpressionAttributeValues: {\n ':o': pOpen\n },\n TableName: \"AVAMenu\",\n })\n .promise()\n .catch(error => {\n cl(`AVA couldn't update your Menu settings. Error is ${error}`);\n });\n dbClient\n .update({\n Key: { session_id: session.user_id },\n UpdateExpression: 'set current_event = :e',\n ExpressionAttributeValues: {\n ':e': JSON.stringify(pOpen)\n },\n TableName: \"SessionsV2\",\n })\n .promise()\n .catch(error => { cl(`caught error updating SessionsV2; error is:`, error); });\n }\n start();\n };\n\n const screenQuiet = (statusMessage) => {\n return;\n };\n\n const screenStatus = (statusMessage, progressPct, progressWidth, interimMenu) => {\n let reactUpdObj = {\n loading: statusMessage,\n progress: progressPct,\n pWidth: progressWidth * 100\n };\n if (interimMenu) {\n reactUpdObj.mainMenu = interimMenu;\n }\n updateReactData(reactUpdObj, true);\n };\n\n const updateFavorites = async (pType, activityRowIndex) => {\n let activityRow = reactData.mainMenu[activityRowIndex];\n let activityLine = activityRow.raw_data;\n let changeMade = false;\n let personRec = await dbClient\n .get({\n Key: { person_id: pPerson },\n TableName: \"People\"\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'No internet',\n message: `There is no internet connection. AVA cannot update your Favorites.`\n }\n }, true);\n }\n cl(`caught error getting People record; error is:`, error);\n });\n if (recordExists(personRec)) {\n // add or remove from the favoriteList as appropriate\n let favoriteList = [];\n if ('favorite_activities' in personRec.Item) {\n favoriteList = personRec.Item.favorite_activities;\n }\n let indexAt = favoriteList.findIndex(r => {\n if (typeof (r) === 'string') {\n return (r.split('~')[0] === activityRow.activity_code);\n }\n else {\n return (r.activity_code === activityRow.activity_code);\n }\n });\n if ((indexAt === -1) && (pType === 'add')) {\n favoriteList.unshift(activityLine);\n changeMade = true;\n }\n else if (pType === 'remove') {\n favoriteList.splice(indexAt, 1);\n changeMade = true;\n }\n // remove from the blockedList if it is in there\n let favoriteBlocked = [];\n if ('favorite_blocked' in personRec.Item) {\n favoriteBlocked = personRec.Item.favorite_blocked;\n }\n indexAt = favoriteBlocked.findIndex(r => {\n if (typeof (r) === 'string') {\n return (r.split('~')[0] === activityRow.activity_code);\n }\n else {\n return (r.activity_code === activityRow.activity_code);\n }\n });\n if ((indexAt === -1) && (pType === 'remove')) {\n favoriteBlocked.push(activityLine);\n changeMade = true;\n }\n else if (pType === 'add') {\n favoriteBlocked.splice(indexAt, 1);\n changeMade = true;\n }\n // rewrite the People record with the new favorite and blocked lists\n if (changeMade) {\n await dbClient\n .update({\n Key: { person_id: pPerson },\n UpdateExpression: 'set favorite_activities = :f, favorite_blocked = :b',\n ExpressionAttributeValues: {\n ':f': favoriteList,\n ':b': favoriteBlocked\n },\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'No internet',\n message: `AVA couldn't update your Favorites.`\n }\n }, true);\n return;\n });\n if (pType === 'add') {\n reactData.mainMenu[activityRowIndex].is_favorite = true;\n reactData.mainMenu.unshift({\n menu_name: 'main',\n sort_key: `**2-0000`,\n section_name: (reactData.mainMenu[0].section_name.includes('favorites')\n ? reactData.mainMenu[0].section_name\n : `My Favorites`\n ),\n section_color: '#6bb44b',\n section_icon: 'https://ava-icons.s3.amazonaws.com/icons8-favorite-50.png',\n row_color: '#6bb44b',\n activity_code: activityRow.activity_code,\n activity_name: activityRow.activity_name,\n activity_class: activityRow.activity_class,\n row_type: activityRow.row_type,\n default_value: activityRow.default_value || null,\n parent_menu: null,\n child_menu: activityRow.child_menu,\n reason: 'Favorite',\n last_used: activityRow.last_used,\n is_favorite: true\n });\n }\n else {\n reactData.mainMenu.splice(activityRowIndex, 1);\n };\n }\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n updateReactData({\n mainMenu: reactData.mainMenu,\n loading: false\n }, true);\n };\n return;\n };\n\n const onSaveFact = async (pFact, pFactName, pIndex) => {\n if (pFact.activity_key.includes('//')) {\n [pFact.client_id, pFact.activity_key] = pFact.activity_key.split('//');\n }\n if (typeof (pFact.value) === 'string') { putFact(pFact, pFactName, pIndex); }\n else {\n let factFlavor = pFact.activity_key.split('.')[0];\n if (factFlavor !== 'action'\n && pFact.value.hasOwnProperty('selected')\n ) {\n let foundText = [];\n let valueArray = pFact.value.selected.map(selection => { // this adds anything that was selected (checkbox)\n // add qualifiers if applicable\n let constructedQualifier = '';\n if (pFact.value.qualifiers && (selection in pFact.value.qualifiers)) {\n let qArray = [];\n Object\n .keys(pFact.value.qualifiers[selection])\n .forEach(key => {\n if (pFact.value.qualifiers[selection][key].length > 0) {\n qArray.push(`${key}: ${pFact.value.qualifiers[selection][key].join(' and ')}`);\n }\n });\n if (qArray.length > 0) { constructedQualifier = ` ( ${qArray.join('; ')} )`; }\n }\n if (pFact.value.freeText && pFact.value.freeText.hasOwnProperty(selection)) {\n let freeText = pFact.value.freeText[selection];\n foundText.push(selection); // we might have free text that is NOT associated with a check box, use foundText to prevent duplication\n return `${selection} = ${freeText}${constructedQualifier}`;\n }\n else {\n return `${selection}${constructedQualifier}`;\n }\n });\n for (const key in pFact.value.freeText) {\n if (key !== '%filter%' && !foundText.includes(key)) {\n let constructedQualifier = '';\n if (pFact.value.qualifiers && (key in pFact.value.qualifiers)) {\n let qArray = [];\n Object\n .keys(pFact.value.qualifiers[key])\n .forEach(subkey => {\n if (pFact.value.qualifiers[key][subkey].length > 0) {\n return `${subkey}: ${pFact.value.qualifiers[key][subkey].join(' and ')}`;\n }\n });\n if (qArray.length > 0) { constructedQualifier = ` ( ${qArray.join('; ')} )`; }\n }\n valueArray.push(`${key} = ${pFact.value.freeText[key]}${constructedQualifier}`);\n }\n }\n\n let factValueType = 'selection';\n\n // set the value that will be written into the Fact table\n pFact.value = factValueType + '.' + valueArray.join(' ~ ');\n\n // write the Fact Table entry\n putFact(pFact, pFactName, pIndex);\n }\n };\n updateReactData({\n showNewFactDialog: -1\n }, true);\n };\n\n const onNextFact = async () => {\n updateReactData({\n showNewFactDialog: -1\n }, true);\n };\n\n React.useEffect(() => {\n if (subMenuHead && subMenuHead.current) {\n subMenuHead.current.scrollIntoView({\n behavior: 'smooth',\n block: 'end',\n });\n }\n }, [reactData.currentMenu]);\n\n React.useEffect(() => {\n let response = (\n async () => {\n let reactUpdObj = {};\n let tempName = (patient.hasOwnProperty('name') ? patient.name.first : (session.patient_display_name || pPerson));\n reactUpdObj.greetingName = (tempName || 'AVA User');\n reactUpdObj.greetingWords = makeGreeting();\n reactUpdObj.loading = 'Building your AVA menu';\n updateReactData(reactUpdObj, true);\n await buildMenu();\n let options = {\n belongsTo: (state.groups ? state.groups.belongsTo : {}),\n client_weather: state.session.client_weather\n };\n let marqueeData = [\n { message: `${reactUpdObj.greetingWords}, ${tempName}!` },\n { message: `AVA for ${state.session.client_name}` }\n ];\n marqueeData.push(...(await getMarqueeMessage(session.client_id, options)));\n let urgentMessage = marqueeData.find(m => {\n return (m.criticalMessage || m.priorityMessage);\n });\n if (urgentMessage) {\n marqueeData = [urgentMessage];\n }\n updateReactData({\n marqueeData: marqueeData,\n marqueeVersion: reactData.marqueeVersion++,\n loading: false\n }, true);\n }\n );\n if (reactData.mainMenu.length === 0) {\n response();\n }\n }, [pPerson]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const accessLog = async (pUser, pPwd, pMessage) => {\n var payload =\n {\n 'test': false,\n 'action': \"add_entry\",\n 'request': {\n 'attempted_user': pUser,\n 'attempted_password': pPwd,\n 'result': pMessage\n }\n };\n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:AccessLogMaintenance',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: JSON.stringify(payload)\n };\n lambda\n .invoke(params)\n .promise()\n .catch(err => {\n cl('Access log call failed. Error is', JSON.stringify(err));\n });\n };\n\n const activityLog = async (pUser, pCode, pName, pIndex) => {\n let postTime = new Date().getTime();\n await dbClient\n .put({\n TableName: 'ActivityLog',\n Item: {\n timestamp: postTime,\n user_id: pUser,\n activity_code: pCode,\n activity_name: pName,\n AVA_version: `${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`\n }\n })\n .promise()\n .catch(error => {\n cl(`Bad put to ActivityLog - caught error is: ${error}`);\n });\n };\n\n const putFact = async (pFact, pFactName, pIndex) => {\n let postTime = new Date().getTime();\n const newFact = {\n person_id: pFact.patient_id,\n activity_key: (pFact.client_id ? ((pFact.client_id) + '//') : '') + pFact.activity_key + '#' + postTime,\n value: pFact.value,\n status: 'recorded',\n user_id: pPerson,\n session_id: 'Confirmed',\n method: 'AVAMenu',\n posted_time: postTime\n };\n if (pFact.value) {\n let valueArray = makeArray(pFact.value, '~');\n if (valueArray.length > 0) {\n newFact.valueObj = {};\n valueArray.forEach((val, ndx) => {\n if ((ndx === 0) && (val.includes('.'))) {\n val = val.split('.').slice(1).join('.');\n }\n let [key, value] = val.split(/=/);\n if (!value) {\n [key, value] = val.split(/:/);\n }\n if (!value) {\n value = key;\n key = `v_${ndx}`;\n }\n newFact.valueObj[key.trim()] = value.trim();\n });\n }\n }\n if (pFact.commonKey) {\n newFact.common_key = pFact.commonKey;\n newFact.request_id = pFact.commonKey;\n }\n await dbClient\n .put({\n TableName: 'Facts',\n Item: newFact\n })\n .promise()\n .catch(error => { console.error('Error adding a fact:', error.message); });\n };\n\n /* function makeGreetingName(pString) {\n setGreetingName(pString || 'AVA User');\n return pString;\n } */\n\n function makeExpiration() {\n let cognito_expires = JSON.parse(sessionStorage.getItem('cognito_expires'));\n let sTime = new Date(cognito_expires ? (cognito_expires * 1000) : (nowTime + oneHour));\n return `Sess exp ${sTime.toLocaleDateString('en-US', {\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true\n })}`;\n }\n\n function makeGreeting() {\n if (session?.custom_greeting) {\n return session.custom_greeting;\n }\n else {\n return `Good ${makeTime(new Date()).dayPart}`;\n }\n }\n\n function proxyAuthority() {\n if (state.accessList && state.accessList.hasOwnProperty(session.client_id) && state.accessList[session.client_id].hasOwnProperty('count')) {\n if ((state.accessList[session.client_id].count.proxy > 0) || (state.accessList[session.client_id].count.full > 0)) {\n return true;\n }\n }\n return false;\n }\n\n const createAccountAuthority = () => {\n if (state.accessList && state.accessList.hasOwnProperty(session.client_id) && state.accessList[session.client_id].hasOwnProperty('count')) {\n if (state.user?.account_class && (['master', 'support', 'admin'].includes(state.user.account_class))) {\n return true;\n }\n }\n return false;\n };\n\n function rowIsOpen(pRow) {\n return (reactData.sectionOpen[pRow.section_name] || (reactData.currentMenu !== 'main'));\n }\n\n // ******************\n\n return (\n \n \n \n {/* Header with Avatar, Message, and VertMenu */}\n \n {\n if (!state.hasOwnProperty('groups') || !state.groups.hasOwnProperty('adminHierarchy')) {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Still loading Group information',\n message: `AVA is still loading. Wait just a moment and try again, please.`\n }\n }, true);\n }\n else {\n pause();\n updateReactData({\n groupData: state.groups,\n showPasswordEdit: false,\n popupMenuOpen: false,\n showProfileEdit: true\n }, true);\n }\n }}\n >\n \n {session?.kiosk_mode ? 'View/Update not available' : `View/Update ${reactData.greetingName}'${reactData.greetingName.slice(-1) === 's' ? '' : 's'} Profile`}\n \n }\n placement='bottom-start'>\n \n \n \n \n {`${reactData.greetingWords},`}\n \n \n {`${reactData.greetingName}!`}\n \n \n \n {/* AVA Logo and Pop-up Menu */}\n \n {\n updateReactData({\n anchorEl: event.currentTarget,\n popupMenuOpen: true\n }, true);\n }}\n title={\n \n {session?.kiosk_mode ? 'View/Update not available' : `View/Update ${reactData.greetingName}'${reactData.greetingName.slice(-1) === 's' ? '' : 's'} Profile`}\n \n }\n placement='bottom-start'>\n \n \n {makeDate(reactData.current_time, { timeZone: state.session.client_timezone }).absolute.split(' at ').map((tLine, tX) => (\n \n {tLine}\n \n ))}\n \n {\n updateReactData({\n popupMenuOpen: false\n }, true);\n }}\n keepMounted>\n \n {(session?.patient_id !== session?.user_id) && (\n {\n updateReactData({\n popupMenuOpen: false\n }, true);\n await switchActiveAccount(\n session,\n (session.user_homeClient || session.client_id),\n {\n id: session.user_id,\n name: session.user_display_name\n }\n );\n }}>\n \n \n {`Switch to My Profile (${session.user_id})`}\n \n \n )}\n {(session?.patient_id !== session?.user_id) && (\n {\n // let sessionObject = JSON.parse(sessionStorage.getItem('AVASessionData'));\n updateReactData({\n popupMenuOpen: false\n }, true);\n await switchActiveAccount(\n session,\n (session.client_id || session.user_homeClient),\n {\n id: session.patient_id,\n name: reactData.greetingName\n },\n { resetUser: true }\n );\n }}>\n \n \n {`Reload as ${session?.patient_id}`}\n \n \n )}\n {!session?.kiosk_mode && (\n {\n if (!state.hasOwnProperty('groups') || !state.groups.hasOwnProperty('adminHierarchy')) {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Still loading Group information',\n message: `AVA is still loading. Wait just a moment and try again, please.`\n }\n }, true);\n }\n else {\n pause();\n updateReactData({\n groupData: state.groups,\n showPasswordEdit: true,\n popupMenuOpen: false,\n showProfileEdit: true\n }, true);\n }\n }}>\n \n \n \n {`Manage ${(session.patient_id === session.user_id) ? 'my' : reactData.greetingName + \"'\" + ((reactData.greetingName.slice(-1) === 's') ? '' : 's')} Password`}\n \n \n \n )\n }\n {(\n state.hasOwnProperty('accessList') &&\n state.accessList.hasOwnProperty('subscription') &&\n state.accessList.subscription.subscription_active\n )\n &&\n {\n window.open(`https://families.avaseniorliving.com/p/login/9AQ4hT0kI91OcFidQQ`);\n }}>\n \n \n {'Manage Subscription'}\n \n \n }\n {proxyAuthority()\n &&\n {\n updateReactData({\n showPersonSelect: true,\n popupMenuOpen: false\n }, true);\n }}>\n \n \n {'Switch Account'}\n \n \n }\n {createAccountAuthority()\n &&\n {\n pause();\n updateReactData({\n groupData: state.groups,\n showAddAccount: true,\n popupMenuOpen: false\n }, true);\n }}>\n \n \n {'Create Account'}\n \n \n }\n {\n pause();\n updateReactData({\n showQuickSearch: true,\n popupMenuOpen: false\n }, true);\n }}>\n \n \n {'Quick Search'}\n \n \n {\n await accessLog(session.user_id, `*na*`, `Manual sign-out`);\n removeCookie(\"AVAuser\");\n Auth.signOut().then(() => {\n let jumpTo = window.location.origin;\n window.location.replace(`${jumpTo}?client=${state.session.client_id}`);\n });\n }}>\n \n \n {'Sign Out'}\n \n \n {\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }}>\n \n \n {'Restart AVA'}\n \n \n {(window.location.href.split('//')[1].slice(0, 1).toUpperCase() !== 'T') &&\n {\n window.location.replace(`https://test.smsoftware.io?rel=${new Date().getTime()}`);\n }}>\n \n \n {'Use Beta Version'}\n \n \n }\n {(window.location.href.split('//')[1].slice(0, 1).toUpperCase() === 'T') &&\n {\n window.location.replace(`https://dev.smsoftware.io?rel=${new Date().getTime()}`);\n }}>\n \n \n {'Use Public Version'}\n \n \n }\n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n {makeExpiration()}\n \n {`User ${session.user_id}${session.patient_id !== session.user_id ? (' (' + session.patient_id + ')') : ''}`}\n \n \n \n \n \n\n {/* AVA Menu */}\n {reactData.mainMenu && reactData.mainMenu.length > 0 &&\n \n \n \n \n {reactData.currentMenu !== 'main' &&\n \n {\n reactData.menuArray.pop();\n reactData.menuNames.pop();\n updateReactData({\n menuArray: reactData.menuArray,\n menuNames: reactData.menuNames,\n currentMenu: reactData.menuArray[reactData.menuArray.length - 1]\n }, true);\n }}\n >\n \n \n \n \n \n {`Return to ${reactData.menuNames[reactData.menuNames.length - 1]}`}\n \n \n \n \n \n \n }\n {reactData.mainMenu.map((this_row, index) => (\n ((this_row.menu_name === reactData.currentMenu) &&\n \n {currentSection !== this_row.section_name &&\n {\n reactData.sectionOpen[this_row.section_name] = !reactData.sectionOpen[this_row.section_name];\n await updateAVA(reactData.sectionOpen, reactData.mainMenu);\n updateReactData({\n sectionOpen: reactData.sectionOpen\n }, true);\n }}\n >\n \n \n \n \n \n \n {(currentSection = this_row.section_name)}\n \n {this_row.section_name.trim()}\n \n \n {(reactData.currentMenu !== 'main') ? null : (!reactData.sectionOpen[this_row.section_name] ? 'Show' : 'Hide')}\n \n \n \n }\n {rowIsOpen(this_row) &&\n \n \n {\n e.preventDefault();\n updateReactData({\n alert: {\n severity: 'info',\n title: this_row.activity_name,\n message:
    \n Activity Code: {this_row.activity_code}
    \n Row Type: {this_row.row_type}
    \n Why on Menu: {this_row.reason}
    \n }\n }, true);\n }}\n >\n {\n await activityLog(pPerson, this_row.activity_code, this_row.activity_name, index);\n reactData.mainMenu[index].last_used = new Date().getTime();\n let reactUpdObj = {\n mainMenu: reactData.mainMenu\n };\n if (this_row.row_type !== 'document') {\n if (this_row.subMenu_data) {\n let subMenu = await MakeAVAMenu(patient, defaultClient, screenQuiet, this_row.subMenu_data);\n delete reactData.mainMenu[index].subMenu_data;\n reactData.mainMenu.push(...subMenu);\n reactUpdObj.mainMenu = reactData.mainMenu;\n }\n if (this_row.child_menu) {\n reactUpdObj.currentMenu = this_row.child_menu;\n reactData.menuArray.push(this_row.child_menu);\n reactUpdObj.menuArray = reactData.menuArray;\n reactData.menuNames.push((reactUpdObj.currentMenu === 'main') ? 'AVA Main Menu' : this_row.section_name);\n reactUpdObj.menuNames = reactData.menuNames;\n }\n else {\n let gad_response = await getActivityDetail(this_row, state);\n reactUpdObj.selected = gad_response.activityRec;\n reactUpdObj.loading = false;\n if (gad_response.loadError) {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'Activity error',\n message: `AVA could not load ${this_row.activity_name}. This may resolve itself after AVA's data load completes. Wait just a moment and try again, please. If the error persists, contact Support (activity_code=${this_row.activity_name})`\n }\n }, true);\n }\n else {\n pause();\n reactUpdObj.showNewFactDialog = index;\n }\n }\n }\n updateReactData(reactUpdObj, true);\n }}\n >\n {this_row.row_type === 'document' ?\n \n {this_row.activity_name}\n \n :\n {this_row.activity_name}\n }\n \n \n {(this_row.is_favorite) ?\n ((['Favorite', 'History'].includes(this_row.reason)) &&\n {\n await updateFavorites('remove', index);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n \n )\n :\n {\n await updateFavorites('add', index);\n setForceRedisplay(!forceRedisplay);\n }}\n >\n \n \n }\n \n \n \n {((index === (reactData.mainMenu.length - 1))\n || (this_row.menu_name !== reactData.mainMenu[index + 1].menu_name)\n || (this_row.section_name !== reactData.mainMenu[index + 1].section_name)\n ) &&\n }\n
    \n }\n
    \n )\n ))}\n \n \n \n \n }\n\n {/* Message Box */}\n {reactData.mainMenu && reactData.mainMenu.length > 0 &&\n \n \n \n {reactData.loading &&\n \n {`Loading AVA`}\n \n {`AVA version ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n \n {reactData.loading.startsWith('Common activities')\n ?\n \n {'Common activities for'}\n {reactData.loading.split(' for ')[1]}\n \n :\n {reactData.loading}\n }\n \n \n }\n \n \n {reactData.marqueeData &&\n reactData.marqueeData.map((marqueeLine, marqueeIndex) => (\n \n {marqueeLine.message}\n \n ))}\n \n \n \n }\n\n {reactData.showPersonSelect &&\n {\n updateReactData({\n showPersonSelect: false\n }, true);\n }}\n />\n }\n\n {reactData.showProfileEdit &&\n \n {!session.useOldVersion &&\n {\n if (updatedPerson.saveCompleted || !reactData.menu_reloaded) {\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n else {\n updateReactData({\n showProfileEdit: false\n }, true);\n }\n }}\n />\n }\n {session.useOldVersion &&\n {\n if (updatedPerson) {\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n else {\n updateReactData({\n showProfileEdit: false\n }, true);\n }\n }}\n />\n }\n \n }\n\n {reactData.showAddAccount &&\n \n {!session.useOldVersion &&\n {\n updateReactData({\n showAddAccount: false\n }, true);\n }}\n />\n }\n {session.useOldVersion &&\n {\n reset();\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }}\n />\n }\n \n }\n\n {reactData.showQuickSearch &&\n {\n updateReactData({\n showQuickSearch: false\n }, true);\n }}\n />\n }\n\n {/* Launch Children */}\n {(reactData.showNewFactDialog > -1) &&\n reactData.selected &&\n {\n let reactUpdObj = {};\n if (session?.url_parameters && ('activity' in session.url_parameters) && ('user' in session.url_parameters)) {\n let jumpTo = window.location.href.replace('theseus', 'thankyou').split('?')[0];\n jumpTo += `?user=${session.url_parameters.user}`;\n window.location.replace(jumpTo);\n }\n else if ((['continue', 'next'].includes(response))\n && (reactData.mainMenu[reactData.showNewFactDialog].raw_data.hasOwnProperty('nextActivity'))) {\n let nextActivityList = makeArray(reactData.mainMenu[reactData.showNewFactDialog].raw_data.nextActivity);\n let nextActivityRec;\n if (isObject(nextActivityList[0])) {\n if (!nextActivityList[0].activity_code) {\n reactUpdObj.showNewFactDialog = -1;\n }\n else {\n let gotRec = await getActivity(state.session.client_id, nextActivityList[0].activity_code);\n // default values passed in through the nextActivity will drop in\n gotRec.default_value = Object.assign((gotRec.default_value || {}), nextActivityList[0].default_value);\n nextActivityRec = deepCopy(gotRec);\n }\n }\n else {\n nextActivityRec = await getActivity(state.session.client_id, nextActivityList[0]);\n }\n // the assign here \"promotes\" the default_value in the validation object up to the activityRec itself where getActivityDetails expects it to be\n nextActivityRec.default_value = Object.assign({}, nextActivityRec.validation.default_value, nextActivityRec.default_value);\n let gad_response = await getActivityDetail(nextActivityRec, state);\n reactUpdObj.selected = gad_response.activityRec;\n }\n else {\n if (response && response.hasOwnProperty('alert')) {\n reactUpdObj.alert = response.alert;\n }\n reset();\n reactUpdObj.showNewFactDialog = -1;\n }\n updateReactData(reactUpdObj, true);\n }}\n onSave={\n async (pResult) => {\n reset();\n if ('client_id' in reactData.selected) {\n pResult.client_id = reactData.selected.client_id;\n }\n await onSaveFact(pResult, reactData.selected.name, reactData.showNewFactDialog);\n }\n }\n onNext={() => {\n reset();\n onNextFact();\n }}\n onSelected={() => { }}\n />\n }\n
    \n \n {reactData.alert &&\n {\n updateReactData({\n alert: false\n }, true);\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center'\n }}\n >\n {\n updateReactData({\n alert: false\n }, true);\n }}\n >\n {reactData.alert.title && {reactData.alert.title}}\n {reactData.alert.message}\n \n \n }\n \n );\n};","import React from 'react';\nimport { Auth } from '@aws-amplify/auth';\nimport { recordExists, isObject, cl, switchActiveAccount, makeArray, dbClient, lambda, deepCopy, getMarqueeMessage } from '../../util/AVAUtilities';\nimport { makeDate, makeTime } from '../../util/AVADateTime';\nimport { getImage } from '../../util/AVAPeople';\nimport { getActivity } from '../../util/AVAObservations';\nimport { getActivityDetail } from '../../util/AVAActivityLoader';\nimport { AVATextStyle, AVADefaults, hexToRgb, isDark } from '../../util/AVAStyles';\n\nimport Card from '@material-ui/core/Card';\nimport CardActionArea from '@material-ui/core/CardActionArea';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardMedia from '@material-ui/core/CardMedia';\n\nimport { Snackbar } from '@material-ui/core';\nimport Alert from '@material-ui/lab/Alert';\nimport AlertTitle from '@material-ui/lab/AlertTitle';\n\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n// import useMediaQuery from '@material-ui/core/useMediaQuery';\nimport Marquee from \"react-fast-marquee\";\n\nimport { useCookies } from 'react-cookie';\nimport { useIdleTimer } from 'react-idle-timer';\nimport useSession from '../../hooks/useSession';\nimport SwitchPatientDialog from '../dialogs/SwitchPatientDialog';\nimport PatientDialog from '../dialogs/PatientDialog';\nimport PeopleMaintenance from '../dialogs/PeopleMaintenance';\nimport NewFactDialog from '../dialogs/NewFactDialog';\nimport MakeAVAMenu from '../../util/MakeAVAMenu';\n\nimport Box from '@material-ui/core/Box';\nimport Avatar from '@material-ui/core/Avatar';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport Dialog from '@material-ui/core/Dialog';\n\nimport Menu from '@material-ui/core/Menu';\nimport MenuList from '@material-ui/core/MenuList';\nimport MenuItem from '@material-ui/core/MenuItem';\n\nimport EditIcon from '@material-ui/icons/PersonOutlineOutlined';\nimport ExitToAppIcon from '@material-ui/icons/ExitToApp';\nimport SwapHorizIcon from '@material-ui/icons/SwapHoriz';\nimport SubscriptionIcon from '@material-ui/icons/CardMembership';\nimport HomeIcon from '@material-ui/icons/Home';\nimport AutorenewIcon from '@material-ui/icons/Autorenew';\nimport NewReleasesOutlinedIcon from '@material-ui/icons/NewReleasesOutlined';\nimport PersonAddIcon from '@material-ui/icons/PersonAdd';\nimport SearchIcon from '@material-ui/icons/Search';\n\nimport Tooltip from '@material-ui/core/Tooltip';\nimport QuickSearch from './QuickSearch';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n maxWidth: 100,\n minWidth: 100,\n maxHeight: 100,\n minHeight: 100,\n },\n cardcontent: {\n height: 80,\n alignContent: 'center',\n\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center'\n },\n cardcontentdetail: {\n height: 100,\n alignContent: 'center',\n padding: 0\n },\n media: {\n height: 20,\n },\n page: {\n height: 950,\n maxWidth: 1000\n },\n progressBar: {\n marginBottom: theme.spacing(3),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px'\n },\n pendingBar: {\n marginRight: theme.spacing(2.2),\n marginTop: theme.spacing(1),\n backgroundColor: '#a3a0a0',\n color: '#000000',\n transition: 'none',\n height: '5px',\n alignSelf: 'flex-end'\n },\n freeInput: {\n marginLeft: '25px',\n marginRight: 2,\n marginBottom: theme.spacing(2),\n paddingLeft: 0,\n paddingRight: 0,\n paddingBottom: theme.spacing(1),\n width: '60%',\n verticalAlign: 'middle',\n fontSize: theme.typography.fontSize * 0.4,\n },\n avatar: {\n marginTop: 0,\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: 0,\n height: 60,\n width: 60,\n paddingTop: 0,\n fontSize: '1.3rem',\n },\n logoSmall: {\n maxWidth: '100px',\n marginBottom: '15px'\n },\n popUpMenuButton: {\n alignContent: 'center',\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n paddingTop: 0,\n fontSize: '1.3rem',\n },\n popUpMenu: {\n marginRight: theme.spacing(3),\n paddingRight: 2,\n },\n title: {\n marginTop: 0,\n marginLeft: 0,\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n hello: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: 0,\n fontSize: theme.typography.fontSize * 1.5,\n },\n buttonArea: {\n justifyContent: 'center',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n rowButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'contained',\n size: 'small'\n },\n rowButtonDefault: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n },\n rowButtonRed: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n color: theme.palette.reject[theme.palette.type],\n },\n rowButtonGreen: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n },\n rowButtonBlue: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n variant: 'outlined',\n textTransform: 'none',\n size: 'small',\n },\n listItem: {\n justifyContent: 'space-between',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(1),\n },\n sectionHeader: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n },\n messageArea: {\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n clientBackground: {\n backgroundColor: AVADefaults({ client_style: 'get' }) ? AVADefaults({ client_style: 'get' }).backgroundColor : null\n },\n clientPopUp: {\n borderRadius: '30px 30px 30px 30px',\n },\n\n profileArea: {\n alignItems: 'center'\n },\n popUpMenuRow: {\n marginLeft: theme.spacing(1),\n fontSize: theme.typography.fontSize * 1.0,\n },\n popUpFooter: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n logoDisplay: {\n maxWidth: '600px',\n },\n\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n makeIconStyle: {\n marginRight: theme.spacing(1),\n },\n locationLine: {\n fontSize: theme.typography.fontSize * 1.0,\n },\n preferenceLine: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n techInfoLine: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(2),\n },\n techInfoLine2: {\n fontSize: theme.typography.fontSize * 0.8,\n marginLeft: theme.spacing(4),\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n confirm: {\n backgroundColor: 'green',\n },\n lastName: {\n fontWeight: 'bold',\n marginRight: theme.spacing(1),\n },\n boldCenter: {\n fontWeight: 'bold',\n textAlign: 'center'\n }\n}));\n\nexport default ({ pPerson, patient, defaultClient, onReset }) => {\n\n const classes = useStyles();\n\n const { state } = useSession();\n const { roles, session } = state;\n\n const [, , removeCookie] = useCookies(['AVAuser']);\n\n const [reactData, setReactData] = React.useState({\n mainMenu: [],\n greetingName: '',\n greetingWords: '',\n loading: 'Initializing',\n progress: 100,\n pWidth: 60,\n currentMenu: 'main',\n menuArray: ['main'],\n menuNames: [],\n selected: null,\n sectionOpen: false,\n current_time: new Date(),\n showPersonSelect: false,\n popupMenuOpen: false,\n showProfileEdit: false,\n showNewFactDialog: -1,\n showAddAccount: false,\n showQuickSearch: false,\n accessList: false,\n showProfileEdit_id: false,\n linkedPersonFilter: '',\n showPasswordEdit: false,\n groupData: {},\n anchorEl: null,\n lastActiveTime: new Date(),\n idleState: true,\n enteredIdleStateTime: new Date(),\n menu_reloaded: false,\n loadedMenuVersion: 1,\n marqueeData: [],\n marqueeVersion: 0,\n alert: false\n });\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n newData.current_time = new Date();\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) { setForceRedisplay(forceRedisplay => !forceRedisplay); }\n };\n\n let currentSection = '';\n\n const oneMinute = 1000 * 60;\n const oneHour = 60 * oneMinute;\n const msBeforeSleeping = 1 * oneMinute;\n\n const subMenuHead = React.useRef(null);\n\n const onIdle = async () => {\n let now = new Date();\n let minutesSinceActive = 0;\n if (!reactData.idleState) {\n cl(`Entering idle state at ${now.toLocaleString()}.`);\n updateReactData({\n idleState: true,\n enteredIdleStateTime: now,\n }, true);\n }\n else {\n minutesSinceActive = Math.floor((now.getTime() - reactData.enteredIdleStateTime.getTime()) / oneMinute);\n cl(`Still idle at ${new Date().toLocaleString()}. Idle for ${minutesSinceActive} minutes.`);\n }\n if ((minutesSinceActive > 60) || (state.session?.kiosk_mode && state.profile?.kiosk_mode)) {\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${now.getTime()}`);\n }\n else if (!reactData.menu_reloaded) {\n await checkReload();\n }\n else if ((now.getTime() - reactData.lastActiveTime.getTime()) > (5 * oneMinute)) {\n cl(`Update while idle at ${now.toLocaleString()}.`);\n let options = {\n belongsTo: (state.groups ? state.groups.belongsTo : {}),\n client_weather: state.session.client_weather\n };\n let marqueeData = [\n { message: `${reactData.greetingWords}, ${reactData.greetingName}!` },\n { message: `AVA for ${state.session.client_name}` }\n ];\n marqueeData.push(...(await getMarqueeMessage(session.client_id, options)));\n let urgentMessage = marqueeData.find(m => {\n return (m.criticalMessage || m.priorityMessage);\n });\n if (urgentMessage) {\n marqueeData = [urgentMessage];\n }\n updateReactData({\n lastActiveTime: now,\n marqueeData: marqueeData,\n marqueeVersion: reactData.marqueeVersion++\n }, true);\n }\n reset();\n };\n\n const checkReload = async () => {\n let menuRec = await dbClient\n .get({\n Key: { person_id: `${state.session.patient_id}%%${state.session.user_id}` },\n TableName: \"AVAMenu\"\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'No internet',\n message: `There is no internet connection.`\n }\n }, true);\n }\n cl(`caught error getting People record; error is:`, error);\n });\n if (recordExists(menuRec) && (menuRec.Item.menu_version !== reactData.loadedMenuVersion)) {\n let reactUpdObj = {\n menu_reloaded: true,\n loadedMenuVersion: menuRec.Item.menu_version\n };\n if ((menuRec.Item.AVA_main_menu.length > 0)) {\n reactUpdObj.mainMenu = menuRec.Item.AVA_main_menu;\n }\n updateReactData(reactUpdObj, true);\n }\n };\n\n async function onAction() {\n let now = new Date();\n if ((reactData.idleState) || ((now.getTime() - reactData.lastActiveTime.getTime()) > oneMinute)) {\n cl(`Action/Update at ${now.toLocaleString()}. Last active at ${reactData.lastActiveTime.toLocaleString()}`);\n let options = {\n belongsTo: (state.groups ? state.groups.belongsTo : {}),\n client_weather: state.session.client_weather\n };\n let marqueeData = [\n { message: `${reactData.greetingWords}, ${reactData.greetingName}!` },\n { message: `AVA for ${state.session.client_name}` }\n ];\n marqueeData.push(...(await getMarqueeMessage(session.client_id, options)));\n let urgentMessage = marqueeData.find(m => {\n return (m.criticalMessage || m.priorityMessage);\n });\n if (urgentMessage) {\n marqueeData = [urgentMessage];\n }\n updateReactData({\n lastActiveTime: now,\n idleState: false,\n marqueeData: marqueeData,\n marqueeVersion: reactData.marqueeVersion++\n }, true);\n }\n if (!reactData.menu_reloaded) {\n await checkReload();\n }\n reset();\n };\n\n const { start, reset, pause } = useIdleTimer({\n onIdle,\n onAction,\n timeout: msBeforeSleeping,\n throttle: 500\n });\n\n let nowTime = new Date().getTime();\n\n // drag to Favorites\n const handleDragStart = (ev, id) => {\n ev.dataTransfer.setData('id', JSON.stringify(id));\n };\n\n const handleDragOver = (ev) => {\n ev.preventDefault();\n };\n\n const handleDrop = async (ev, { droppedOn }) => {\n ev.preventDefault();\n let draggedFrom = JSON.parse(ev.dataTransfer.getData('id'));\n let activityRow = reactData.mainMenu[draggedFrom.index];\n let activityLine = activityRow.raw_data;\n let personRec = await dbClient\n .get({\n Key: { person_id: pPerson },\n TableName: \"People\"\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'No internet',\n message: `There is no internet connection. AVA cannot update your Favorites.`\n }\n }, true);\n }\n cl(`caught error getting People record; error is:`, error);\n });\n if (!recordExists(personRec)) {\n return;\n }\n let favoriteList = [];\n if ('favorite_activities' in personRec.Item) {\n favoriteList = personRec.Item.favorite_activities;\n }\n let draggedAt = favoriteList.findIndex(r => {\n if (typeof (r) === 'string') {\n return (r.split('~')[0] === activityRow.activity_code);\n }\n else {\n return (r.activity_code === activityRow.activity_code);\n }\n });\n if (draggedFrom.from_type === 'favorites') {\n if (droppedOn.to_type === 'favorites') {\n // re-ordering favorites\n favoriteList.splice(draggedAt, 1);\n reactData.mainMenu.splice(draggedFrom.index, 1);\n let droppedAt = favoriteList.findIndex(r => {\n if (typeof (r) === 'string') {\n return (r.split('~')[0] === droppedOn.activity_code);\n }\n else {\n return (r.activity_code === droppedOn.activity_code);\n }\n });\n favoriteList.splice(droppedAt, 0, draggedFrom.rawData);\n reactData.mainMenu.splice(droppedOn.index, 0, draggedFrom.wholeRow);\n }\n else {\n // remove from favorites\n if (draggedAt > -1) {\n favoriteList.splice(draggedAt, 1);\n reactData.mainMenu.splice(draggedFrom.index, 1);\n }\n }\n }\n else {\n // adding something to favorites\n if (draggedAt === -1) {\n favoriteList.unshift(activityLine);\n reactData.mainMenu[draggedFrom.index].is_favorite = true;\n reactData.mainMenu.unshift({\n menu_name: 'main',\n sort_key: `**2-0000`,\n section_name: (reactData.mainMenu[0].section_name.toLowerCase().includes('favorites')\n ? reactData.mainMenu[0].section_name\n : `My Favorites`\n ),\n section_color: '#6bb44b',\n section_icon: 'https://ava-icons.s3.amazonaws.com/icons8-favorite-50.png',\n row_color: '#6bb44b',\n activity_code: activityRow.activity_code,\n activity_name: activityRow.activity_name,\n activity_class: activityRow.activity_class,\n row_type: activityRow.row_type,\n raw_data: activityLine,\n default_value: activityRow.default_value || null,\n parent_menu: null,\n child_menu: activityRow.child_menu,\n reason: 'Favorite',\n last_used: activityRow.last_used,\n is_favorite: true\n });\n }\n }\n await dbClient\n .update({\n Key: { person_id: pPerson },\n UpdateExpression: 'set favorite_activities = :f',\n ExpressionAttributeValues: {\n ':f': favoriteList,\n },\n TableName: \"People\",\n })\n .promise()\n .catch(error => {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'No internet',\n message: `AVA couldn't update your Favorites.`\n }\n }, true);\n return;\n });\n updateReactData({\n mainMenu: reactData.mainMenu,\n loading: false\n }, true);\n };\n\n const buildMenu = async (reload = false, beQuiet = null) => {\n let reactUpdObj = {\n sectionOpen: false\n };\n // AVA_section_open in People record, or (legacy code) current_event in SessionV2 record\n // is used to save what the screen looked like last time the user was in AVA\n let menuRec = await dbClient\n .get({\n Key: {\n person_id: `${state.session.patient_id}%%${state.session.user_id}`\n },\n TableName: \"AVAMenu\"\n })\n .promise()\n .catch(error => {\n if (error.code === 'NetworkingError') {\n reactUpdObj.alert = {\n severity: 'error',\n title: 'No internet',\n message: `There is no internet connection.`\n };\n }\n else {\n reactUpdObj.alert = {\n severity: 'error',\n title: 'Unusual error',\n message: `When getting your menu history, an error occurred. The error is ${error}`\n };\n }\n });\n if (recordExists(menuRec)) {\n reactUpdObj.loadedMenuVersion = menuRec.Item.menu_version;\n reactUpdObj.sectionOpen = false; \n if ((menuRec.Item.AVA_main_menu && (menuRec.Item.AVA_main_menu.length > 0)) && !reload) {\n reactUpdObj.mainMenu = menuRec.Item.AVA_main_menu;\n reactUpdObj.sectionOpen = Object.assign({}, reactUpdObj.mainMenu[0], { index: 0 }); \n updateReactData(reactUpdObj, true);\n return menuRec.Item.AVA_main_menu;\n }\n }\n\n // we are going to have to build their menu for the first time...\n let forceRefresh = true;\n let wholeMenu = await MakeAVAMenu(patient, defaultClient, (beQuiet ? screenQuiet : screenStatus), null, forceRefresh, state);\n\n if (wholeMenu.length > 0) {\n await updateAVA(reactData.sectionOpen, wholeMenu);\n reactUpdObj.mainMenu = wholeMenu;\n if (!reactUpdObj.sectionOpen) {\n reactUpdObj.sectionOpen = Object.assign({}, reactUpdObj.mainMenu[0], { index: 0 }); \n }\n updateReactData(reactUpdObj, true);\n return wholeMenu;\n }\n else {\n reactUpdObj.alert = {\n severity: 'info',\n title: 'Warning',\n message: `AVA didn't find any options for you. Ask AVA Support to check on this.`\n };\n let helpRow = {\n activity_code: 'message.chubbie_request',\n activity_name: 'Send a message to AVA Support',\n child_menu: null,\n default_value: null,\n menu_name: 'help',\n parent_menu: null,\n row_color: '#a1adb8',\n row_type: 'message',\n section_color: '#a1adb8',\n section_icon: 'https://ava-icons.s3.amazonaws.com/icons8-new-message-50.png',\n section_name: 'Get AVA Help',\n sort_key: 'Messages, Comments, and Feedback'\n };\n reactUpdObj.mainMenu = [helpRow];\n updateReactData(reactUpdObj, true);\n }\n // end\n return reactUpdObj.mainMenu;\n };\n\n const updateAVA = async (pOpen, pMenu) => {\n if (pOpen) {\n dbClient\n .update({\n Key: { person_id: `${state.session.patient_id}%%${state.session.user_id}` },\n UpdateExpression: 'set AVA_section_open = :o',\n ExpressionAttributeValues: {\n ':o': pOpen\n },\n TableName: \"AVAMenu\",\n })\n .promise()\n .catch(error => {\n cl(`AVA couldn't update your Menu settings. Error is ${error}`);\n });\n dbClient\n .update({\n Key: { session_id: session.user_id },\n UpdateExpression: 'set current_event = :e',\n ExpressionAttributeValues: {\n ':e': JSON.stringify(pOpen)\n },\n TableName: \"SessionsV2\",\n })\n .promise()\n .catch(error => { cl(`caught error updating SessionsV2; error is:`, error); });\n }\n start();\n };\n\n const screenQuiet = (statusMessage) => {\n return;\n };\n\n const screenStatus = (statusMessage, progressPct, progressWidth, interimMenu) => {\n let reactUpdObj = {\n loading: statusMessage,\n progress: progressPct,\n pWidth: progressWidth * 100\n };\n if (interimMenu) {\n reactUpdObj.mainMenu = interimMenu;\n }\n updateReactData(reactUpdObj, true);\n };\n\n const onSaveFact = async (pFact, pFactName, pIndex) => {\n if (pFact.activity_key.includes('//')) {\n [pFact.client_id, pFact.activity_key] = pFact.activity_key.split('//');\n }\n if (typeof (pFact.value) === 'string') { putFact(pFact, pFactName, pIndex); }\n else {\n let factFlavor = pFact.activity_key.split('.')[0];\n if (factFlavor !== 'action'\n && pFact.value.hasOwnProperty('selected')\n ) {\n let foundText = [];\n let valueArray = pFact.value.selected.map(selection => { // this adds anything that was selected (checkbox)\n // add qualifiers if applicable\n let constructedQualifier = '';\n if (pFact.value.qualifiers && (selection in pFact.value.qualifiers)) {\n let qArray = [];\n Object\n .keys(pFact.value.qualifiers[selection])\n .forEach(key => {\n if (pFact.value.qualifiers[selection][key].length > 0) {\n qArray.push(`${key}: ${pFact.value.qualifiers[selection][key].join(' and ')}`);\n }\n });\n if (qArray.length > 0) { constructedQualifier = ` ( ${qArray.join('; ')} )`; }\n }\n if (pFact.value.freeText && pFact.value.freeText.hasOwnProperty(selection)) {\n let freeText = pFact.value.freeText[selection];\n foundText.push(selection); // we might have free text that is NOT associated with a check box, use foundText to prevent duplication\n return `${selection} = ${freeText}${constructedQualifier}`;\n }\n else {\n return `${selection}${constructedQualifier}`;\n }\n });\n for (const key in pFact.value.freeText) {\n if (key !== '%filter%' && !foundText.includes(key)) {\n let constructedQualifier = '';\n if (pFact.value.qualifiers && (key in pFact.value.qualifiers)) {\n let qArray = [];\n Object\n .keys(pFact.value.qualifiers[key])\n .forEach(subkey => {\n if (pFact.value.qualifiers[key][subkey].length > 0) {\n return `${subkey}: ${pFact.value.qualifiers[key][subkey].join(' and ')}`;\n }\n });\n if (qArray.length > 0) { constructedQualifier = ` ( ${qArray.join('; ')} )`; }\n }\n valueArray.push(`${key} = ${pFact.value.freeText[key]}${constructedQualifier}`);\n }\n }\n\n let factValueType = 'selection';\n\n // set the value that will be written into the Fact table\n pFact.value = factValueType + '.' + valueArray.join(' ~ ');\n\n // write the Fact Table entry\n putFact(pFact, pFactName, pIndex);\n }\n };\n updateReactData({\n showNewFactDialog: -1\n }, true);\n };\n\n const onNextFact = async () => {\n updateReactData({\n showNewFactDialog: -1\n }, true);\n };\n\n React.useEffect(() => {\n if (subMenuHead && subMenuHead.current) {\n subMenuHead.current.scrollIntoView({\n behavior: 'smooth',\n block: 'end',\n });\n }\n }, [reactData.currentMenu]);\n\n React.useEffect(() => {\n let response = (\n async () => {\n let reactUpdObj = {};\n let tempName = (patient.hasOwnProperty('name') ? patient.name.first : (session.patient_display_name || pPerson));\n reactUpdObj.greetingName = (tempName || 'AVA User');\n reactUpdObj.greetingWords = makeGreeting();\n reactUpdObj.loading = 'Building your AVA menu';\n updateReactData(reactUpdObj, true);\n await buildMenu();\n let options = {\n belongsTo: (state.groups ? state.groups.belongsTo : {}),\n client_weather: state.session.client_weather\n };\n let marqueeData = [\n { message: `${reactUpdObj.greetingWords}, ${tempName}!` },\n { message: `AVA for ${state.session.client_name}` }\n ];\n marqueeData.push(...(await getMarqueeMessage(session.client_id, options)));\n let urgentMessage = marqueeData.find(m => {\n return (m.criticalMessage || m.priorityMessage);\n });\n if (urgentMessage) {\n marqueeData = [urgentMessage];\n }\n updateReactData({\n marqueeData: marqueeData,\n marqueeVersion: reactData.marqueeVersion++,\n loading: false\n }, true);\n }\n );\n if (reactData.mainMenu.length === 0) {\n response();\n }\n }, [pPerson]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const accessLog = async (pUser, pPwd, pMessage) => {\n var payload =\n {\n 'test': false,\n 'action': \"add_entry\",\n 'request': {\n 'attempted_user': pUser,\n 'attempted_password': pPwd,\n 'result': pMessage\n }\n };\n let params = {\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:AccessLogMaintenance',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: JSON.stringify(payload)\n };\n lambda\n .invoke(params)\n .promise()\n .catch(err => {\n cl('Access log call failed. Error is', JSON.stringify(err));\n });\n };\n\n const activityLog = async (pUser, pCode, pName, pIndex) => {\n let postTime = new Date().getTime();\n await dbClient\n .put({\n TableName: 'ActivityLog',\n Item: {\n timestamp: postTime,\n user_id: pUser,\n activity_code: pCode,\n activity_name: pName,\n AVA_version: `${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`\n }\n })\n .promise()\n .catch(error => {\n cl(`Bad put to ActivityLog - caught error is: ${error}`);\n });\n };\n\n const putFact = async (pFact, pFactName, pIndex) => {\n let postTime = new Date().getTime();\n const newFact = {\n person_id: pFact.patient_id,\n activity_key: (pFact.client_id ? ((pFact.client_id) + '//') : '') + pFact.activity_key + '#' + postTime,\n value: pFact.value,\n status: 'recorded',\n user_id: pPerson,\n session_id: 'Confirmed',\n method: 'AVAMenu',\n posted_time: postTime\n };\n if (pFact.value) {\n let valueArray = makeArray(pFact.value, '~');\n if (valueArray.length > 0) {\n newFact.valueObj = {};\n valueArray.forEach((val, ndx) => {\n if ((ndx === 0) && (val.includes('.'))) {\n val = val.split('.').slice(1).join('.');\n }\n let [key, value] = val.split(/=/);\n if (!value) {\n [key, value] = val.split(/:/);\n }\n if (!value) {\n value = key;\n key = `v_${ndx}`;\n }\n newFact.valueObj[key.trim()] = value.trim();\n });\n }\n }\n if (pFact.commonKey) {\n newFact.common_key = pFact.commonKey;\n newFact.request_id = pFact.commonKey;\n }\n await dbClient\n .put({\n TableName: 'Facts',\n Item: newFact\n })\n .promise()\n .catch(error => { console.error('Error adding a fact:', error.message); });\n };\n\n /* function makeGreetingName(pString) {\n setGreetingName(pString || 'AVA User');\n return pString;\n } */\n\n function makeExpiration() {\n let cognito_expires = JSON.parse(sessionStorage.getItem('cognito_expires'));\n let sTime = new Date(cognito_expires ? (cognito_expires * 1000) : (nowTime + oneHour));\n return `Sess exp ${sTime.toLocaleDateString('en-US', {\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true\n })}`;\n }\n\n function makeGreeting() {\n if (session?.custom_greeting) {\n return session.custom_greeting;\n }\n else {\n return `Good ${makeTime(new Date()).dayPart}`;\n }\n }\n\n function proxyAuthority() {\n if (state.accessList && state.accessList.hasOwnProperty(session.client_id) && state.accessList[session.client_id].hasOwnProperty('count')) {\n if ((state.accessList[session.client_id].count.proxy > 0) || (state.accessList[session.client_id].count.full > 0)) {\n return true;\n }\n }\n return false;\n }\n\n const createAccountAuthority = () => {\n if (state.accessList && state.accessList.hasOwnProperty(session.client_id) && state.accessList[session.client_id].hasOwnProperty('count')) {\n if (state.user?.account_class && (['master', 'support', 'admin'].includes(state.user.account_class))) {\n return true;\n }\n }\n return false;\n };\n\n // ******************\n\n return (\n \n \n \n {/* Header with Avatar, Message, and VertMenu */}\n \n {\n if (!state.hasOwnProperty('groups') || !state.groups.hasOwnProperty('adminHierarchy')) {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Still loading Group information',\n message: `AVA is still loading. Wait just a moment and try again, please.`\n }\n }, true);\n }\n else {\n pause();\n updateReactData({\n groupData: state.groups,\n showPasswordEdit: false,\n popupMenuOpen: false,\n showProfileEdit: true\n }, true);\n }\n }}\n >\n \n {session?.kiosk_mode ? 'View/Update not available' : `View/Update ${reactData.greetingName}'${reactData.greetingName.slice(-1) === 's' ? '' : 's'} Profile`}\n \n }\n placement='bottom-start'>\n \n \n \n \n {`${reactData.greetingWords},`}\n \n \n {`${reactData.greetingName}!`}\n \n \n \n {/* AVA Logo and Pop-up Menu */}\n \n {\n updateReactData({\n anchorEl: event.currentTarget,\n popupMenuOpen: true\n }, true);\n }}\n title={\n \n {`Administration Menu`}\n \n }\n placement='bottom-start'>\n \n \n {makeDate(reactData.current_time, { timeZone: state.session.client_timezone }).absolute.split(' at ').map((tLine, tX) => (\n \n {tLine}\n \n ))}\n \n {\n updateReactData({\n popupMenuOpen: false\n }, true);\n }}\n keepMounted>\n \n {(session?.patient_id !== session?.user_id) && (\n {\n updateReactData({\n popupMenuOpen: false\n }, true);\n await switchActiveAccount(\n session,\n (session.user_homeClient || session.client_id),\n {\n id: session.user_id,\n name: session.user_display_name\n }\n );\n }}>\n \n \n {`Switch to My Profile (${session.user_id})`}\n \n \n )}\n {(session?.patient_id !== session?.user_id) && (\n {\n // let sessionObject = JSON.parse(sessionStorage.getItem('AVASessionData'));\n updateReactData({\n popupMenuOpen: false\n }, true);\n await switchActiveAccount(\n session,\n (session.client_id || session.user_homeClient),\n {\n id: session.patient_id,\n name: reactData.greetingName\n },\n { resetUser: true }\n );\n }}>\n \n \n {`Reload as ${session?.patient_id}`}\n \n \n )}\n {!session?.kiosk_mode && (\n {\n if (!state.hasOwnProperty('groups') || !state.groups.hasOwnProperty('adminHierarchy')) {\n updateReactData({\n alert: {\n severity: 'warning',\n title: 'Still loading Group information',\n message: `AVA is still loading. Wait just a moment and try again, please.`\n }\n }, true);\n }\n else {\n pause();\n updateReactData({\n groupData: state.groups,\n showPasswordEdit: true,\n popupMenuOpen: false,\n showProfileEdit: true\n }, true);\n }\n }}>\n \n \n \n {`Manage ${(session.patient_id === session.user_id) ? 'my' : reactData.greetingName + \"'\" + ((reactData.greetingName.slice(-1) === 's') ? '' : 's')} Password`}\n \n \n \n )\n }\n {(\n state.hasOwnProperty('accessList') &&\n state.accessList.hasOwnProperty('subscription') &&\n state.accessList.subscription.subscription_active\n )\n &&\n {\n window.open(`https://families.avaseniorliving.com/p/login/9AQ4hT0kI91OcFidQQ`);\n }}>\n \n \n {'Manage Subscription'}\n \n \n }\n {proxyAuthority()\n &&\n {\n updateReactData({\n showPersonSelect: true,\n popupMenuOpen: false\n }, true);\n }}>\n \n \n {'Switch Account'}\n \n \n }\n {createAccountAuthority()\n &&\n {\n pause();\n updateReactData({\n groupData: state.groups,\n showAddAccount: true,\n popupMenuOpen: false\n }, true);\n }}>\n \n \n {'Create Account'}\n \n \n }\n {\n pause();\n updateReactData({\n showQuickSearch: true,\n popupMenuOpen: false\n }, true);\n }}>\n \n \n {'Quick Search'}\n \n \n {\n await accessLog(session.user_id, `*na*`, `Manual sign-out`);\n removeCookie(\"AVAuser\");\n Auth.signOut().then(() => {\n let jumpTo = window.location.origin;\n window.location.replace(`${jumpTo}?client=${state.session.client_id}`);\n });\n }}>\n \n \n {'Sign Out'}\n \n \n {\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }}>\n \n \n {'Restart AVA'}\n \n \n {(window.location.href.split('//')[1].slice(0, 1).toUpperCase() !== 'T') &&\n {\n window.location.replace(`https://test.smsoftware.io?rel=${new Date().getTime()}`);\n }}>\n \n \n {'Use Beta Version'}\n \n \n }\n {(window.location.href.split('//')[1].slice(0, 1).toUpperCase() === 'T') &&\n {\n window.location.replace(`https://dev.smsoftware.io?rel=${new Date().getTime()}`);\n }}>\n \n \n {'Use Public Version'}\n \n \n }\n \n \n {`AVA vers ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n {makeExpiration()}\n \n {`User ${session.user_id}${session.patient_id !== session.user_id ? (' (' + session.patient_id + ')') : ''}`}\n \n \n \n \n \n\n {/* AVA Menu */}\n {reactData.mainMenu && reactData.mainMenu.length > 0 &&\n \n \n \n {reactData.mainMenu.map((this_row, index) => (\n ((this_row.menu_name === reactData.currentMenu) &&\n \n {currentSection !== this_row.section_name &&\n {\n updateReactData({\n sectionOpen: (reactData.sectionOpen && (reactData.sectionOpen.index === index))\n ? false\n : Object.assign({}, this_row, { index })\n }, true);\n }}\n >\n \n \n \n { if (this_row.is_favorite) { handleDragOver(e); } }}\n onDrop={async (e) => {\n if (this_row.is_favorite) {\n await handleDrop(e, {\n droppedOn: {\n to_type: 'favorites',\n }\n });\n }\n }}\n >\n \n {(currentSection = this_row.section_name)}\n \n \n {this_row.section_name.trim()}\n \n \n \n \n \n }\n \n )\n ))}\n \n \n {reactData.mainMenu.map((this_row, lower_index) => (\n \n {(reactData.sectionOpen.section_name === this_row.section_name) &&\n { if (this_row.is_favorite) { handleDragOver(e); } }}\n onDrop={async (e) => {\n if (this_row.is_favorite) {\n await handleDrop(e, {\n droppedOn: {\n to_type: 'favorites',\n activity_code: this_row.activity_code,\n index: lower_index\n }\n });\n }\n }}\n onContextMenu={async (e) => {\n e.preventDefault();\n updateReactData({\n alert: {\n severity: 'info',\n title: this_row.activity_name,\n message:
    \n Activity Code: {this_row.activity_code}
    \n Row Type: {this_row.row_type}
    \n Why on Menu: {this_row.reason}
    \n }\n }, true);\n }}\n onClick={async () => {\n await activityLog(pPerson, this_row.activity_code, this_row.activity_name, reactData.sectionOpen.index);\n reactData.mainMenu[reactData.sectionOpen.index].last_used = new Date().getTime();\n let reactUpdObj = {\n mainMenu: reactData.mainMenu\n };\n if (this_row.row_type !== 'document') {\n if (this_row.subMenu_data) {\n let subMenu = await MakeAVAMenu(patient, defaultClient, screenQuiet, this_row.subMenu_data);\n delete reactData.mainMenu[reactData.sectionOpen.index].subMenu_data;\n reactData.mainMenu.push(...subMenu);\n reactUpdObj.mainMenu = reactData.mainMenu;\n }\n if (this_row.child_menu) {\n reactUpdObj.currentMenu = this_row.child_menu;\n reactData.menuArray.push(this_row.child_menu);\n reactUpdObj.menuArray = reactData.menuArray;\n reactData.menuNames.push((reactUpdObj.currentMenu === 'main') ? 'AVA Main Menu' : this_row.section_name);\n reactUpdObj.menuNames = reactData.menuNames;\n }\n else {\n let gad_response = await getActivityDetail(this_row, state);\n reactUpdObj.selected = gad_response.activityRec;\n reactUpdObj.loading = false;\n if (gad_response.loadError) {\n updateReactData({\n alert: {\n severity: 'error',\n title: 'Activity error',\n message: `AVA could not load ${this_row.activity_name}. This may resolve itself after AVA's data load completes. Wait just a moment and try again, please. If the error persists, contact Support (activity_code=${this_row.activity_name})`\n }\n }, true);\n }\n else {\n pause();\n reactUpdObj.showNewFactDialog = reactData.sectionOpen.index;\n }\n }\n }\n updateReactData(reactUpdObj, true);\n }}\n >\n handleDragStart(e, {\n index: lower_index,\n from_type: ((this_row.is_favorite) ? 'favorites' : 'menu'),\n rawData: this_row.raw_data,\n wholeRow: this_row\n })}\n >\n \n \n {this_row.row_type === 'document' ?\n \n \n {this_row.activity_name}\n \n \n :\n \n {this_row.activity_name}\n \n }\n \n \n \n
    \n\n }\n\n
    \n ))}\n \n \n \n }\n\n {/* Message Box */}\n {reactData.mainMenu && reactData.mainMenu.length > 0 &&\n \n \n \n {reactData.loading &&\n \n {`Loading AVA`}\n \n {`AVA version ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n \n \n }\n \n \n {reactData.marqueeData &&\n reactData.marqueeData.map((marqueeLine, marqueeIndex) => (\n \n {marqueeLine.message}\n \n ))}\n \n \n \n }\n\n {reactData.showPersonSelect &&\n {\n updateReactData({\n showPersonSelect: false\n }, true);\n }}\n />\n }\n\n {reactData.showProfileEdit &&\n \n {!session.useOldVersion &&\n {\n if (updatedPerson.saveCompleted || !reactData.menu_reloaded) {\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n else {\n updateReactData({\n showProfileEdit: false\n }, true);\n }\n }}\n />\n }\n {session.useOldVersion &&\n {\n if (updatedPerson) {\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }\n else {\n updateReactData({\n showProfileEdit: false\n }, true);\n }\n }}\n />\n }\n \n }\n\n {reactData.showAddAccount &&\n \n {!session.useOldVersion &&\n {\n reset();\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }}\n />\n }\n {session.useOldVersion &&\n {\n reset();\n sessionStorage.removeItem('AVASessionData');\n window.location.replace(`${window.location.href.split('?')[0]}?rel=${new Date().getTime()}`);\n }}\n />\n }\n \n }\n\n {reactData.showQuickSearch &&\n {\n updateReactData({\n showQuickSearch: false\n }, true);\n }}\n />\n }\n\n {/* Launch Children */}\n {(reactData.showNewFactDialog > -1) &&\n reactData.selected &&\n {\n let reactUpdObj = {};\n if (session?.url_parameters && ('activity' in session.url_parameters) && ('user' in session.url_parameters)) {\n let jumpTo = window.location.href.replace('theseus', 'thankyou').split('?')[0];\n jumpTo += `?user=${session.url_parameters.user}`;\n window.location.replace(jumpTo);\n }\n else if ((['continue', 'next'].includes(response))\n && (reactData.mainMenu[reactData.showNewFactDialog].raw_data.hasOwnProperty('nextActivity'))) {\n let nextActivityList = makeArray(reactData.mainMenu[reactData.showNewFactDialog].raw_data.nextActivity);\n let nextActivityRec;\n if (isObject(nextActivityList[0])) {\n if (!nextActivityList[0].activity_code) {\n reactUpdObj.showNewFactDialog = -1;\n }\n else {\n let gotRec = await getActivity(state.session.client_id, nextActivityList[0].activity_code);\n // default values passed in through the nextActivity will drop in\n gotRec.default_value = Object.assign((gotRec.default_value || {}), nextActivityList[0].default_value);\n nextActivityRec = deepCopy(gotRec);\n }\n }\n else {\n nextActivityRec = await getActivity(state.session.client_id, nextActivityList[0]);\n }\n // the assign here \"promotes\" the default_value in the validation object up to the activityRec itself where getActivityDetails expects it to be\n nextActivityRec.default_value = Object.assign({}, nextActivityRec.validation.default_value, nextActivityRec.default_value);\n let gad_response = await getActivityDetail(nextActivityRec, state);\n reactUpdObj.selected = gad_response.activityRec;\n }\n else {\n if (response && response.hasOwnProperty('alert')) {\n reactUpdObj.alert = response.alert;\n }\n reset();\n reactUpdObj.showNewFactDialog = -1;\n }\n updateReactData(reactUpdObj, true);\n }}\n onSave={\n async (pResult) => {\n reset();\n if ('client_id' in reactData.selected) {\n pResult.client_id = reactData.selected.client_id;\n }\n await onSaveFact(pResult, reactData.selected.name, reactData.showNewFactDialog);\n }\n }\n onNext={() => {\n reset();\n onNextFact();\n }}\n onSelected={() => { }}\n />\n }\n
    \n \n {reactData.alert &&\n {\n updateReactData({\n alert: false\n }, true);\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center'\n }}\n >\n {\n updateReactData({\n alert: false\n }, true);\n }}\n >\n {reactData.alert.title && {reactData.alert.title}}\n {reactData.alert.message}\n \n \n }\n
    \n );\n};","import React from 'react';\n\nimport Box from '@material-ui/core/Box';\n\nimport useSession from '../hooks/useSession';\n\nimport AVAMenu from '../components/sections/AVAMenu';\nimport ConnectMenu from '../components/sections/ConnectMenu';\nimport FormFillB from '../components/forms/FormFillB';\nimport PeopleMaintenance from '../components/dialogs/PeopleMaintenance';\n\nimport { useCookies } from 'react-cookie';\n\nexport default () => {\n const { state } = useSession();\n const { patient, session } = state;\n const [cookies, , removeCookie] = useCookies(['AVAuser', 'AVAaction']);\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.update();\n })\n .catch(error => {\n console.error(error.message);\n throw error.message;\n });\n }\n\n if (cookies.AVAaction) {\n if (cookies.AVAaction.document) {\n return (\n {\n removeCookie(\"AVAaction\");\n if (statusObj.document_status !== 'aborted') {\n if (statusObj.nextAction) {\n if (statusObj.nextAction.action === 'logIn') {\n sessionStorage.removeItem('AVASessionData');\n let jumpTo = `${window.location.href.replace('refresh', 'theseus').split('?')[0]}?user=${statusObj.nextAction.target}`;\n window.location.replace(jumpTo);\n }\n }\n }\n let jumpTo = window.location.href.replace('theseus', 'thankyou').split('?')[0];\n window.location.replace(jumpTo);\n }}\n />\n );\n }\n else if (cookies.AVAaction.forms) {\n return (\n { \n removeCookie(\"AVAaction\");\n }}\n />\n );\n }\n let jumpTo = window.location.href.replace('theseus', 'thankyou').split('?')[0];\n window.location.replace(jumpTo);\n }\n\n return (\n \n {(state.session.client_style && state.session.client_style.ui_tiles)\n ? \n : \n }\n \n );\n};\n","import React from 'react';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport Card from '@material-ui/core/Card';\nimport CardMedia from '@material-ui/core/CardMedia';\n\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport useSession from '../hooks/useSession';\n\nimport { useCookies } from 'react-cookie';\n\nconst useStyles = makeStyles(theme => ({\n formControl: {\n margin: theme.spacing(1),\n [theme.breakpoints.down('xs')]: {\n width: '100%',\n minWidth: 64,\n },\n },\n title: {\n margin: theme.spacing(1),\n },\n appBar: {\n position: 'relative',\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'flex-start',\n zIndex: 1,\n },\n gridList: {\n fontWeight: 'bold',\n marginTop: 10,\n justifyContent: 'center',\n maxWidth: '600px',\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n logoDisplay: {\n maxWidth: '600px',\n marginBottom: '15px'\n },\n mainPaper: {\n },\n defaultButton: {\n borderRadius: 50,\n marginLeft: 0,\n paddingLeft: 13,\n paddingRight: 10,\n backgroundColor: theme.palette.info[theme.palette.type],\n variant: 'outlined',\n fontSize: theme.typography.fontSize * 0.6,\n color: theme.palette.info[theme.palette.type],\n height: theme.typography.fontSize * 1.8,\n },\n confirm: {\n backgroundColor: theme.palette.confirm[theme.palette.type],\n },\n reject: {\n backgroundColor: theme.palette.reject[theme.palette.type],\n },\n inputRoot: {\n color: 'inherit',\n },\n inputInput: {\n padding: theme.spacing(1, 1, 1, 0),\n paddingLeft: 3,\n transition: theme.transitions.create('width'),\n [theme.breakpoints.up('md')]: {\n width: '20ch',\n },\n },\n descriptionText: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n activityText: {\n marginLeft: theme.spacing(3),\n },\n}));\n\nexport default () => {\n\n const classes = useStyles();\n const { state } = useSession();\n const { session } = state;\n\n const [, , removeCookie] = useCookies(['AVAuser', 'AVAaction']);\n\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.update();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n\n removeCookie(\"AVAuser\");\n\n return (\n \n \n \n \n \n \n \n {`Thank you from ${session?.client_name}!`}\n \n \n \n \n );\n};\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (response.status === 404 || (contentType != null && contentType.indexOf('javascript') === -1)) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log('No internet connection found. App is running in offline mode.');\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","import React from 'react';\nimport Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport useSession from '../hooks/useSession';\n\nimport * as serviceWorker from '../serviceWorker';\n\nexport default () => {\n const { state } = useSession();\n const { session } = state;\n serviceWorker.unregister();\n\n let jumpTo = window.location.href.replace('refresh', 'theseus');\n if (session?.url_parameters) {\n let link = '?';\n for (let key in session.url_parameters) {\n jumpTo += `${link}${key}=${session.url_parameters[key]}`;\n link = '&';\n }\n }\n window.location.replace(jumpTo);\n\n return (\n \n \n {`Loading AVA version ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n \n \n );\n};\n","import React from 'react';\nimport Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\n\nexport default () => (\n \n \n 404\n \n \n Not Found\n \n \n);\n","import React from 'react';\nimport { Redirect, Route, Switch } from 'react-router-dom';\nimport NotFound from '../screens/NotFound';\n\nexport default ({ menu, homePath }) => (\n \n \n \n \n {menu.map(item => (\n \n {item.screen}\n \n ))}\n \n \n \n \n);\n","import React from 'react';\nimport Box from '@material-ui/core/Box';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport ListItem from '@material-ui/core/ListItem';\nimport Slide from '@material-ui/core/Slide';\nimport { useSnackbar } from 'notistack';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Button from '@material-ui/core/Button';\nimport CloseIcon from '@material-ui/icons/Close';\nimport Paper from '@material-ui/core/Paper';\nimport { getImage } from '../../util/AVAPeople';\nimport { getCustomizations } from '../../util/AVAUtilities';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport Typography from '@material-ui/core/Typography';\n\nimport { AVAclasses } from '../../util/AVAStyles';\n\nconst useStyles = makeStyles(theme => ({\n formControl: {\n margin: 0,\n paddingTop: 0,\n overflowX: 'hidden'\n },\n AVAButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n noDisplay: {\n display: 'none',\n visibility: 'hidden'\n },\n listRow: {\n marginTop: theme.spacing(1),\n marginLeft: 0,\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n listRowIndent: {\n marginTop: theme.spacing(1),\n marginLeft: theme.spacing(4),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n listRowBottom: {\n marginTop: theme.spacing(1),\n marginLeft: 0,\n marginRight: theme.spacing(2),\n marginBottom: theme.spacing(1),\n fontSize: '1.3rem',\n },\n title: {\n marginTop: theme.spacing(3),\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n marginBottom: 0,\n fontSize: '1.3rem',\n },\n groupName: {\n fontWeight: 'bold',\n color: 'red'\n }\n}));\n\nconst Transition = React.forwardRef((props, ref) => );\n\nexport default ({ selectionList, onCancel, onSelect }) => {\n\n const { closeSnackbar, enqueueSnackbar } = useSnackbar();\n\n const [reactData, setReactData] = React.useState({\n moduleState: 'start'\n });\n\n const [forceRedisplay, setForceRedisplay] = React.useState(false);\n const updateReactData = (newData, force = false) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n if (force) {\n setForceRedisplay(!forceRedisplay);\n }\n };\n\n const classes = useStyles();\n const AVAClass = AVAclasses();\n\n async function initialLoad() {\n let clientList = [];\n let clientObj = {};\n let choosePeople = false;\n for (let s = 0; s < selectionList.length; s++) {\n let this_selection = selectionList[s];\n if (!clientList.includes(this_selection.client_id)) {\n clientList.push(this_selection.client_id);\n let cRec = await getCustomizations('*all', this_selection.client_id);\n clientObj[this_selection.client_id] = {\n client_name: cRec.client_name,\n client_logo: cRec.logo,\n peopleRecs: []\n };\n }\n if (clientObj[this_selection.client_id].peopleRecs.push({\n person_id: this_selection.person_id,\n display_name: (this_selection.name ? (`${this_selection.name.first} ${this_selection.name.last}`).trim() : (this_selection.display_name || this_selection.person_id))\n }) > 1) {\n choosePeople = true;\n };\n }\n if (choosePeople) {\n clientList.forEach(this_client => {\n if (clientObj[this_client].peopleRecs.length > 1) {\n clientObj[this_client].peopleRecs.sort((a, b) => {\n return ((a.display_name > b.display_name) ? 1 : -1);\n });\n }\n });\n };\n updateReactData({\n clientObj,\n choosePeople,\n chooseClient: (clientList.length > 1)\n }, false);\n };\n\n React.useEffect(() => {\n async function initialize() {\n updateReactData({ moduleState: 'initializing' }, false);\n await initialLoad();\n updateReactData({ moduleState: 'ready' }, true);\n }\n initialize();\n }, [selectionList]); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n (reactData.moduleState === 'ready') &&\n { onCancel(); }}\n >\n \n {`Select from these choices`}\n \n \n {Object.keys(reactData.clientObj).map((this_client_id) => (\n \n {reactData.chooseClient &&\n {\n if (reactData.choosePeople) { }\n else {\n closeSnackbar();\n enqueueSnackbar(\n `Logging you in to ${reactData.clientObj[this_client_id].client_name}`,\n { variant: 'success' }\n );\n onSelect({\n person_id: reactData.clientObj[this_client_id].peopleRecs[0].person_id,\n client_id: this_client_id\n });\n }\n }}\n >\n \n \n \n {reactData.clientObj[this_client_id].client_name}\n \n \n \n }\n {reactData.choosePeople &&\n reactData.clientObj[this_client_id].peopleRecs.map((this_person, pX) => (\n {\n closeSnackbar();\n enqueueSnackbar(\n `Logging you in as ${this_person.display_name}${reactData.chooseClient ? (' to ' + reactData.clientObj[this_client_id].client_name) : ''}`,\n { variant: 'success' }\n );\n onSelect({\n person_id: this_person.person_id,\n client_id: this_client_id\n });\n }}\n >\n \n \n \n {this_person.display_name}\n \n \n \n ))\n }\n \n ))}\n \n \n {\n onCancel();\n }}\n startIcon={}\n >\n {'Back'}\n \n \n \n );\n};\n","import React from 'react';\n\nconst getNavigatorInstance = () => {\n if (typeof window !== 'undefined') {\n if (window.navigator || navigator) {\n return window.navigator || navigator;\n }\n }\n return false;\n};\n\nconst useIosCheck = () => {\n const nav = getNavigatorInstance();\n\n return React.useMemo(() => {\n if (nav && nav.standalone) {\n // user already installed the app\n return [nav?.platform || 'not installed', false];\n }\n\n // check if current device is iOS/iOS 13\n return ([\n nav?.platform || 'not installed',\n nav &&\n (/iPad|iPhone|iPod/.test(nav.platform) || (nav.platform === 'MacIntel' && nav.maxTouchPoints > 1)) &&\n !window.MSStream\n ]);\n }, [nav]);\n};\n\nexport default useIosCheck;\n","import React from 'react';\nimport { dbClient, lambda, makeArray, getCustomizations, deepCopy, uuid } from '../util/AVAUtilities';\nimport { accountAccess, getAllGroups, getGroupsBelongTo } from '../util/AVAGroups';\nimport { getAllOccurrences, v2buildCalendar } from '../util/AVACalendars';\nimport { sendMessages } from '../util/AVAMessages';\nimport { addDays } from '../util/AVADateTime';\nimport { useSnackbar } from 'notistack';\nimport { Auth } from 'aws-amplify';\nimport { useLocation } from 'react-router-dom';\nimport { AVAclasses, AVADefaults } from '../util/AVAStyles';\nimport AVAConfirm from '../components/forms/AVAConfirm';\nimport MakeAVAMenu from '../util/MakeAVAMenu';\nimport PatientDialog from '../components/dialogs/PatientDialog';\nimport SelectAccount from '../components/dialogs/SelectAccount';\n\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport Dialog from '@material-ui/core/Dialog';\n\nimport { useCookies } from 'react-cookie';\nimport useSession from '../hooks/useSession';\nimport useIosCheck from '../hooks/useIosCheck';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\n// import useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport { SET_PATIENT, SET_PROFILE, SET_GROUPS, SET_ACCESSLIST, SET_CALENDAR, SET_SESSION, SET_USER } from '../contexts/Session/actions';\nimport AVATextInput from '../components/forms/AVATextInput';\n\nconst useStyles = makeStyles(theme => ({\n logoSmall: {\n maxWidth: '100px',\n marginBottom: '15px'\n },\n AVAButton: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(1),\n variant: 'outlined',\n border: '0.75px solid gray',\n textTransform: 'none',\n textDecoration: 'none',\n textWrap: 'nowrap',\n fontWeight: 'bold',\n size: 'small',\n },\n notTitle: {\n marginTop: theme.spacing(2),\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(1),\n fontSize: theme.typography.fontSize * 1.0,\n },\n buttonArea: {\n marginTop: theme.spacing(4)\n },\n}));\n\nconst AWS = require('aws-sdk');\nconst CognitoClient = new AWS.CognitoIdentityServiceProvider({\n region: \"us-east-1\"\n});\n\nexport default Component => props => {\n\n // Constants and React state variables\n const { closeSnackbar, enqueueSnackbar } = useSnackbar();\n\n const { dispatch, state } = useSession();\n const AVAClass = AVAclasses();\n\n const [cookies, setCookie, removeCookie] = useCookies(['AVAuser', 'AVAclient', 'AVAvalidated', 'AVAaction']);\n\n const [doneTrying, setDoneTrying] = React.useState(false);\n const [AVAReady, setAVAReady] = React.useState(false);\n let localAVAReady = false;\n const [AVAFollowUpData, setAVAFollowUpData] = React.useState();\n\n const classes = useStyles();\n const [platform] = useIosCheck();\n\n const AVA_default_user = process.env.REACT_APP_AVA_PU;\n const AVA_default_password = process.env.REACT_APP_AVA_PP;\n\n const [messageList, setMessageList] = React.useState([]);\n\n const [reactData, setReactData] = React.useState({\n currentClientLogo:\n ((state.session && state.session.client_logo)\n ? state.session.client_logo\n : process.env.REACT_APP_AVA_LOGO\n ),\n customizationData: {\n client_name: 'AVA Sign-in'\n },\n urlData: {},\n multipleAccountList: false\n });\n\n const updateReactData = (newData) => {\n setReactData((prevValues) => (Object.assign(\n prevValues,\n newData\n )));\n };\n\n let bootState = {};\n let belongsTo;\n\n const allParams = useParams();\n function useParams() {\n const { search } = useLocation();\n return React.useMemo(() => new URLSearchParams(search), [search]);\n };\n\n React.useEffect(() => {\n let checkUser = (\n async () => {\n let activeUser;\n let sessionObject = JSON.parse(sessionStorage.getItem('AVASessionData'));\n sessionStorage.removeItem('cognito_expires');\n let localCognitoSession = await Auth\n .currentSession()\n .catch(e => {\n console.log(e);\n });\n if (localCognitoSession) {\n sessionStorage.setItem('cognito_expires', JSON.stringify(localCognitoSession.accessToken?.payload?.exp));\n await refreshSession(localCognitoSession.getRefreshToken());\n if (sessionObject) { // There is a good sessionObject. This contains actual info about user\n activeUser = sessionObject.currentProfile.person_id;\n let uMessage = `Found ${activeUser} in session memory (AVASessionData)`;\n await logAccessAttempt(activeUser, '', true, uMessage);\n let goodLaunch = await launchAVA(activeUser);\n if (goodLaunch) {\n setAVAFollowUpData({ 'Completed': true });\n await logAccessAttempt(activeUser, '', true, `Good AVA session object found in memory; AVA launched successfully`);\n setDoneTrying(true);\n return;\n }\n }\n else if (localCognitoSession.idToken.payload['cognito:username'] !== AVA_default_user) {\n activeUser = localCognitoSession.idToken.payload['cognito:username'];\n let uMessage = `${activeUser} is already logged in`;\n await logAccessAttempt(activeUser, '', true, uMessage);\n let goodLaunch = await launchAVA(activeUser);\n if (goodLaunch) {\n setAVAFollowUpData({ 'Completed': true });\n await logAccessAttempt(activeUser, '', true, `No AVA session in memory; Cognito session for known user found; AVA launched successfully`);\n setDoneTrying(true);\n return;\n }\n }\n else if (localCognitoSession.idToken.payload.jti) {\n let AVAsession = await getSessions(localCognitoSession.idToken.payload.jti);\n if (AVAsession && AVAsession.login.user_id) {\n activeUser = AVAsession.login.user_id;\n let uMessage = `Found ${activeUser} in Sessions table with jti (session_id) ${localCognitoSession.idToken.payload.jti}`;\n await logAccessAttempt(activeUser, '', true, uMessage);\n let goodLaunch = await launchAVA(activeUser);\n if (goodLaunch) {\n setAVAFollowUpData({ 'Completed': true });\n await logAccessAttempt(activeUser, '', true, `Device found in Sessions table; AVA launched successfully`);\n setDoneTrying(true);\n return;\n }\n }\n }\n }\n // No security session OR already logged in, but with an unknown user. Do we know who this is?\n // Does the URL contain a User ID and/or client?\n let urlData = getParamsFromURL();\n if (urlData) {\n updateReactData({\n urlData: Object.assign({}, urlData, {\n client_id: urlData.client || urlData.client_id,\n user_id: urlData.user || urlData.user_id\n })\n });\n if (reactData.urlData.client_id) {\n let cData = await getCustomizations('*all', reactData.urlData.client_id);\n updateReactData({\n customizationData: Object.assign({}, cData, reactData.urlData),\n currentClientLogo: cData.logo\n });\n }\n if (reactData.urlData.create) {\n await tryUser(`ava-${reactData.urlData.client_id}`, reactData.urlData.client_id, 'url');\n return;\n }\n if (reactData.urlData.user_id) {\n await tryUser(reactData.urlData.user_id, reactData.urlData.client_id, 'url');\n return;\n }\n }\n // Check for a cookie\n let cookieValues = getCookie();\n if (cookieValues) {\n if (reactData.urlData.client_id) {\n if (cookieValues.client !== reactData.urlData.client_id) {\n // the URL was asking for a client that was not the one in the cookie\n cookieValues = {};\n }\n }\n else if (cookieValues.client) {\n let cData = await getCustomizations('*all', (cookieValues.client));\n updateReactData({\n customizationData: Object.assign({}, cData, { client_id: cookieValues.client }),\n currentClientLogo: cData.logo\n });\n }\n if (cookieValues.user_id && (!reactData.urlData.user_id) && (!reactData.urlData.tfa)) {\n await tryUser(cookieValues.user_id, cookieValues.client, 'cookie');\n return;\n }\n }\n // No URL data and no cookie\n setAVAFollowUpData({ 'NeedUser': true });\n return;\n });\n checkUser();\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n async function tryUser(pUser, pClient, pSource, options = {}) {\n // return values:\n // good - locked and loaded. AVA signed-in and ready\n // invalid - not a valid user ID\n // password - user ID is valid, but password needed to log in\n //\n // Do we know this person's password?\n pUser = pUser.trim();\n let [goodSessionV2, foundSession, dbError] = await getSessionV2(pUser);\n if (goodSessionV2) {\n options.waiveTFA = true;\n }\n else { // That is not a valid User ID, maybe it's a name?\n if (dbError) {\n setDoneTrying(true);\n return 'network';\n }\n await logAccessAttempt(pUser, '', false, `${pUser} is not a valid User ID (no SessionV2).`);\n closeSnackbar();\n // does the entered information show up in the PeopleAccount table (used for alternate IDs)?\n updateReactData({\n enteredID: pUser\n }, false);\n let [accountFound, foundPerson] = await getByAlternateID(pUser);\n if (accountFound) {\n [goodSessionV2, foundSession, dbError] = await getSessionV2(foundPerson.person_id);\n }\n else if (Array.isArray(foundPerson)) {\n if (foundPerson.length === 1) {\n [goodSessionV2, foundSession, dbError] = await getSessionV2(foundPerson[0].person_id);\n }\n else {\n enqueueSnackbar(`\"${pUser}\" matches ${foundPerson.length} accounts.`, { variant: 'error', persist: true });\n updateReactData({ multipleAccountList: foundPerson });\n setDoneTrying(true);\n setAVAFollowUpData({ 'NeedUser': false, 'SelectfromList': true });\n return 'ambiguous';\n }\n }\n if (!goodSessionV2) { // either !accountFound and null returned from getAlternate ID OR (accountFound and !goodSessionV2) will arrive here \n enqueueSnackbar(`\"${pUser}\" can't be used to log in. Please try again.`, { variant: 'error', persist: true });\n setDoneTrying(true);\n setAVAFollowUpData({ 'NeedUser': true });\n return 'invalid';\n }\n else {\n pUser = foundSession.session_id;\n }\n }\n // if the entry was bad, we should have bailed out by now...\n if (reactData.urlData.client_id && (reactData.urlData.client_id !== foundSession.client_id)) {\n // good account, but not in the client that was requested\n await logAccessAttempt(pUser, '', true, 'Good UserID entered, but it was not in the URL Client');\n closeSnackbar();\n enqueueSnackbar(`This account does not exist in ${reactData.customizationData.client_name}.`, { variant: 'error', persist: true });\n setDoneTrying(true);\n setAVAFollowUpData({ 'NeedUser': true });\n return 'invalid';\n }\n let tempURLOBj = getParamsFromURL();\n if (tempURLOBj && tempURLOBj.tfa && !options.waiveTFA) {\n await logAccessAttempt(pUser, '', true, 'Two-factor authentication required.');\n closeSnackbar();\n let [goodUser, foundPatient] = await getPerson(pUser);\n foundPatient.sessionRec = foundSession;\n if (goodUser) {\n let cRec = await getCustomizations('client_name', foundPatient.client_id);\n let client_name = cRec.customization_value;\n let tempPass = uuid(6);\n foundPatient.sessionRec.last_login = tempPass;\n let source = reactData.enteredID;\n let prefMethod;\n let expectedAddress;\n if (source.includes('@')) {\n prefMethod = 'email';\n expectedAddress = foundPatient.messaging.email || source;\n enqueueSnackbar(\n `We've sent an e-Mail to ${expectedAddress}. Look for a security code in that message and enter it here.`,\n { variant: 'success', persist: true });\n }\n else {\n prefMethod = 'sms';\n expectedAddress = foundPatient.messaging.sms || source;\n enqueueSnackbar(\n `We've sent a text to (${expectedAddress.slice(2, 5)}) ${expectedAddress.slice(5, 8)}-${expectedAddress.slice(8)}. Look for a security code in that message and enter it here.`,\n { variant: 'success', persist: true });\n }\n await sendMessages({\n client: foundPatient.client_id,\n author: foundSession.user_id,\n person_id: foundSession.person_id,\n preferred_method: prefMethod,\n messageText: `To access your ${client_name} account, use this code: ${tempPass}`,\n recipientList: [foundPatient.person_id],\n subject: `Security message from ${client_name}`\n });\n setAVAFollowUpData({ 'passwordRequired': true, 'enteredUserID': pUser, 'possibleUserRecs': [foundPatient] });\n return 'password';\n }\n else {\n let eMessage = `When fetching People account for this two factor authentication request, ${pUser} is not found`;\n await logAccessAttempt(pUser, '', false, eMessage);\n setDoneTrying(true);\n enqueueSnackbar(`${eMessage}. This is an unusual situation. AVA Support has been notified.`, { variant: 'error', persist: true });\n sendMessage('AVA', 'bootstrap', eMessage, 'ava_support');\n setAVAFollowUpData({ 'NeedUser': true });\n return 'invalid';\n }\n }\n if (\n (foundSession.forceSetPassword || (reactData.customizationData.client_style?.mandatory_passwords && !foundSession.last_login))\n && ((pSource === 'entered') || (pSource === 'selection'))\n ) {\n await logAccessAttempt(pUser, '', true, 'Good UserID entered. Password must be set/reset for this account.');\n closeSnackbar();\n enqueueSnackbar(`Please set a new password.`, { variant: 'error', persist: true });\n let [goodUser, foundPatient] = await getPerson(pUser);\n if (!goodUser) {\n let eMessage = `When fetching People account for this password-required Session, ${pUser} is not found`;\n await logAccessAttempt(pUser, '', false, eMessage);\n setDoneTrying(true);\n enqueueSnackbar(`${eMessage}. This is an unusual situation. AVA Support has been notified.`, { variant: 'error', persist: true });\n sendMessage('AVA', 'bootstrap', eMessage, 'ava_support');\n setAVAFollowUpData({ 'NeedUser': true });\n return 'invalid';\n }\n foundPatient.sessionRec = foundSession;\n setAVAFollowUpData({ 'passwordRequired': true, 'forceSetPassword': true, 'enteredUserID': pUser, 'possibleUserRecs': [foundPatient] });\n return 'password';\n }\n else if (\n (foundSession.requirePassword || reactData.customizationData.client_style?.mandatory_passwords)\n && ((pSource === 'entered') || (pSource === 'selection'))\n ) {\n await logAccessAttempt(pUser, '', true, 'Good UserID entered. Password is required for this account.');\n closeSnackbar();\n enqueueSnackbar(`This account requires a password.`, { variant: 'error', persist: true });\n let [goodUser, foundPatient] = await getPerson(pUser);\n if (!goodUser) {\n let eMessage = `When fetching People account for this password-required Session, ${pUser} is not found`;\n await logAccessAttempt(pUser, '', false, eMessage);\n setDoneTrying(true);\n enqueueSnackbar(`${eMessage}. This is an unusual situation. AVA Support has been notified.`, { variant: 'error', persist: true });\n sendMessage('AVA', 'bootstrap', eMessage, 'ava_support');\n setAVAFollowUpData({ 'NeedUser': true });\n return 'invalid';\n }\n foundPatient.sessionRec = foundSession;\n setAVAFollowUpData({ 'passwordRequired': true, 'enteredUserID': pUser, 'possibleUserRecs': [foundPatient] });\n return 'password';\n }\n else if (foundSession.last_login) { // Yes! We have a User and a Password\n let [goodLogin, ,] = await cognitoLogin(pUser, foundSession.last_login);\n if (goodLogin) {\n await logAccessAttempt(pUser, foundSession.last_login, true, `Successful Log-in using stored password; user ID supplied from ${pSource}`);\n await launchAVA(pUser);\n return 'good';\n }\n else {\n await logAccessAttempt(pUser, foundSession.last_login, false, `Failed Log-in. Attempted stored password; user ID supplied from ${pSource}`);\n setDoneTrying(false);\n // intentionally fall through to attempt default credentials\n }\n }\n // We know the person, but have not been able to log them in yet\n // Attempt to log person is with generic credentials\n let result = await genericLogin(pUser, pSource);\n if (result === 'good') {\n return 'good';\n }\n // If we got to here... we had a good User, but did not get that user authenticated\n // Let's ask for the password and try to get in that way...\n closeSnackbar();\n enqueueSnackbar(`We're having trouble logging you in automatically. Please enter your password.`, { variant: 'error', persist: true });\n setAVAFollowUpData({ 'enteredUserID': pUser, 'NeedUser': false });\n setDoneTrying(true);\n return 'password';\n }\n\n async function genericLogin(pUser, pSource) {\n let [goodLogin, ,] = await cognitoLogin(AVA_default_user, AVA_default_password);\n if (goodLogin) {\n await logAccessAttempt(pUser, '', true, `Successful Log-in using generic credentials; user ID supplied from ${pSource}`);\n await launchAVA(pUser);\n return 'good';\n }\n else {\n let eMessage = `Failed Log-in using generic credentials; user ID supplied from ${pSource}`;\n await logAccessAttempt(pUser, '', false, eMessage);\n closeSnackbar();\n enqueueSnackbar(`${eMessage}.. AVA support has been notified.`, { variant: 'error', persist: true });\n sendMessage('AVA', 'bootstrap', eMessage, 'ava_support');\n return 'failed';\n }\n }\n\n async function refreshSession(refresh_token) {\n let cognitoPoolUser = await Auth\n .currentUserPoolUser()\n .catch(e => {\n console.log(e);\n });\n CognitoClient.adminInitiateAuth(\n {\n 'AuthFlow': 'REFRESH_TOKEN_AUTH',\n 'ClientId': cognitoPoolUser.pool.clientId,\n 'UserPoolId': cognitoPoolUser.pool.userPoolId,\n 'AuthParameters': refresh_token\n });\n }\n\n function promptForUser() {\n if (testModeErrorTrap()) { return false; }\n return (AVAFollowUpData && AVAFollowUpData.NeedUser);\n }\n\n function promptForPassword() {\n if (testModeErrorTrap()) { return false; }\n return (AVAFollowUpData && AVAFollowUpData.hasOwnProperty('enteredUserID') && !AVAFollowUpData.forceSetPassword);\n }\n\n function promptSetPassword() {\n if (testModeErrorTrap()) { return false; }\n return (AVAFollowUpData && AVAFollowUpData.hasOwnProperty('enteredUserID') && AVAFollowUpData.forceSetPassword);\n }\n\n function promptConfirmPassword() {\n if (testModeErrorTrap()) { return false; }\n return (AVAFollowUpData && AVAFollowUpData.hasOwnProperty('enteredUserID') && AVAFollowUpData.confirmSetPassword);\n }\n\n const selectFromMultipleAccounts = () => {\n return (!!reactData.multipleAccountList);\n };\n\n function newSubscriptionPrompt() {\n return (AVAFollowUpData && (AVAFollowUpData.hasOwnProperty('newSubscription') || AVAFollowUpData.hasOwnProperty('addAccount')));\n }\n\n function promptSignUp() {\n return (AVAFollowUpData && AVAFollowUpData.hasOwnProperty('PromptSignUp'));\n }\n\n function verifySubscription() {\n return (AVAFollowUpData && AVAFollowUpData.hasOwnProperty('checkSubscription'));\n }\n\n function verifySignUp() {\n return (AVAFollowUpData && AVAFollowUpData.hasOwnProperty('checkSignUp'));\n }\n\n function testModeErrorTrap() {\n return (\n doneTrying\n && (messageList.length > 0)\n && (window.location.href.split('//')[1].slice(0, 1).toUpperCase() === 'T')\n );\n }\n\n async function forgotPassword() {\n const showWarning = new Promise((resolve, reject) => {\n const snackAction = (\n \n \n \n \n );\n closeSnackbar();\n let lKP = AVAFollowUpData.possibleUserRecs[0].sessionRec.last_login.length;\n let exposed = AVAFollowUpData.possibleUserRecs[0].sessionRec.last_login.slice(0, 3);\n let hint = exposed.padEnd(lKP, '*');\n enqueueSnackbar(\n `Here's a hint... your password is ${hint}`,\n { variant: 'warning', persist: true, action: snackAction }\n );\n });\n let rValue = await showWarning;\n closeSnackbar();\n return rValue;\n }\n\n if (!AVAReady && !localAVAReady) {\n return (\n \n {reactData?.customizationData?.client_style?.checkin_image\n ?\n \n \n \n :\n \n \n \n \n \n \n \n }\n {testModeErrorTrap() &&\n \n {`AVA Assistant`}\n {messageList.map((pLine, index) => (\n \n {pLine}\n \n ))}\n {\n let emptyList = [];\n setMessageList(emptyList);\n }}\n >\n {'Dismiss'}\n \n \n }\n {promptForUser() &&\n {\n enqueueSnackbar(`Please enter your ID`, { variant: 'info', persist: true });\n setMessageList([]);\n }}\n onSave={async (enteredUserID) => {\n if (!enteredUserID) {\n enqueueSnackbar(`You must enter an ID`, { variant: 'info' });\n }\n else if (enteredUserID.toLowerCase() === 'client') {\n if (reactData.hasOwnProperty('urlData')) {\n delete reactData.urlData.client_id;\n }\n updateReactData({\n urlData: reactData.urlData,\n customizationData: { client_name: 'AVA Sign-in' }\n });\n setAVAFollowUpData({\n NeedUser: true,\n });\n }\n else {\n setMessageList([]);\n closeSnackbar();\n enqueueSnackbar(`Signing in with \"${enteredUserID.toLowerCase()}\"`, { variant: 'info' });\n let result = await tryUser(enteredUserID.toLowerCase(), reactData.customizationData.client_id, 'entered');\n if ((result === 'invalid') && (enteredUserID.toLowerCase() !== enteredUserID)) {\n closeSnackbar();\n enqueueSnackbar(`Signing in with \"${enteredUserID}\"`, { variant: 'info' });\n await tryUser(enteredUserID, reactData.customizationData.client_id, 'entered');\n }\n }\n setDoneTrying(true);\n }}\n allowCancel={false}\n />\n }\n {promptForPassword() &&\n {\n setMessageList([]);\n closeSnackbar();\n enqueueSnackbar(`Please enter your User ID or Name`, { variant: 'info', persist: true });\n setAVAFollowUpData({ 'NeedUser': true });\n }}\n onSave={async (enteredPass, whichButton) => {\n setMessageList([]);\n closeSnackbar();\n if (whichButton === 2) {\n let requestAction = await forgotPassword();\n if (requestAction === 'need_help') {\n await sendMessages({\n client: AVAFollowUpData.possibleUserRecs[0].sessionRec.client_id,\n author: AVAFollowUpData.possibleUserRecs[0].sessionRec.user_id,\n person_id: AVAFollowUpData.possibleUserRecs[0].person_id,\n messageText: `Account holder ${AVAFollowUpData.possibleUserRecs[0].person_id} in client ${AVAFollowUpData.possibleUserRecs[0].sessionRec.client_id} has asked for password help.`,\n recipientList: ['ava-support', 'rsteele'],\n subject: 'Password Assistance Requested'\n });\n closeSnackbar();\n enqueueSnackbar(`A request was sent to the AVA Support team`, { variant: 'info' });\n }\n return;\n }\n closeSnackbar();\n enqueueSnackbar(`AVA is verifying your information`, { variant: 'info' });\n for (let p = 0; p < AVAFollowUpData.possibleUserRecs.length; p++) {\n let [thatWorked, ,] = await cognitoLogin(AVAFollowUpData.possibleUserRecs[p].person_id, enteredPass);\n if (thatWorked) {\n let userFrom = '';\n if (AVAFollowUpData.possibleUserRecs.length > 1) {\n userFrom = `- user ID is #${p + 1} of ${AVAFollowUpData.possibleUserRecs.length} possible matches`;\n }\n await logAccessAttempt(AVAFollowUpData.possibleUserRecs[p].person_id, enteredPass, true, `Successful Log-in using entered password ${userFrom}`);\n launchAVA(AVAFollowUpData.possibleUserRecs[p].person_id);\n return;\n }\n }\n // the entered data did not work as a password; perhaps as a apartment number, etc?\n closeSnackbar();\n for (let p = 0; p < AVAFollowUpData.possibleUserRecs.length; p++) {\n let possibility = AVAFollowUpData.possibleUserRecs[p];\n if (AVAFollowUpData.possibleUserRecs[p].sessionRec.last_login.toLowerCase() === enteredPass.toLowerCase()) {\n let result = await tryUser(possibility.person_id, possibility.client_id, 'stored password match', { waiveTFA: true });\n if (result === 'good') {\n let eMessage = `Successful Login for ${possibility.person_id}`;\n enqueueSnackbar(eMessage, { variant: 'info', persist: false });\n await logAccessAttempt(possibility.person_id, '', true, eMessage);\n launchAVA(possibility.person_id);\n return;\n }\n }\n else if (enteredPass && possibility.location && possibility.location.toLowerCase().includes(enteredPass.toLowerCase())) {\n if (possibility.sessionRec.requirePassword) {\n let eMessage = `Using the information provided, AVA located account \"${possibility.person_id}\", but that account requires a password. (\"${enteredPass}\" is not the right password.)`;\n await logAccessAttempt(possibility.person_id, '', false, eMessage);\n setDoneTrying(false);\n enqueueSnackbar(`${eMessage} Please try again.`, { variant: 'error', persist: true });\n return;\n }\n let result = await tryUser(possibility.person_id, possibility.client_id, 'location match');\n if (result !== 'good') {\n let eMessage = `Using the information provided, AVA located account \"${possibility.person_id}\". However, we can't log that account into AVA.`;\n await logAccessAttempt(possibility.person_id, '', false, eMessage);\n enqueueSnackbar(`${eMessage} Please try again.`, { variant: 'error', persist: true });\n return;\n }\n else {\n let eMessage = `Successful Login for ${possibility.person_id} using entered location list of ${AVAFollowUpData.possibleUserRecs.length} possible matches`;\n enqueueSnackbar(eMessage, { variant: 'info', persist: false });\n await logAccessAttempt(possibility.person_id, '', true, eMessage);\n launchAVA(possibility.person_id);\n return;\n }\n }\n }\n let eMessage = `AVA could not log you in with \"${enteredPass}\"`;\n await logAccessAttempt('Text - not a UserID', '', false, eMessage);\n enqueueSnackbar(`${eMessage} Please try again.`, { variant: 'error', persist: true });\n setDoneTrying(true);\n return;\n }}\n />\n }\n {promptSetPassword() &&\n {\n setMessageList([]);\n closeSnackbar();\n enqueueSnackbar(`Please enter your User ID or Name`, { variant: 'info', persist: true });\n setAVAFollowUpData({ 'NeedUser': true });\n }}\n onSave={async (enteredPass) => {\n setMessageList([]);\n closeSnackbar();\n setAVAFollowUpData({\n passwordRequired: true,\n proposedPassword: enteredPass,\n confirmSetPassword: true,\n enteredUserID: AVAFollowUpData.enteredUserID,\n possibleUserRecs: AVAFollowUpData.possibleUserRecs\n });\n return;\n }}\n />\n }\n {promptConfirmPassword() &&\n {\n setMessageList([]);\n closeSnackbar();\n setAVAFollowUpData({\n passwordRequired: true,\n forceSetPassword: true,\n enteredUserID: AVAFollowUpData.enteredUserID,\n possibleUserRecs: AVAFollowUpData.possibleUserRecs\n });\n return;\n }}\n onConfirm={async () => {\n setMessageList([]);\n let this_user = AVAFollowUpData.possibleUserRecs[0];\n // update SessionV2 with this password\n await updateDb(\n [ \n {\n table: \"SessionsV2\",\n key: {\n session_id: AVAFollowUpData.enteredUserID.toLowerCase()\n },\n data: {\n last_login: AVAFollowUpData.proposedPassword,\n forceSetPassword: false,\n storePassword: true,\n password_change_date: new Date().toLocaleString()\n }\n },\n {\n table: \"People\",\n key: {\n person_id: AVAFollowUpData.enteredUserID.toLowerCase()\n },\n data: {\n newPassword: AVAFollowUpData.proposedPassword,\n storePassword: true,\n password_change_date: new Date().toLocaleString()\n }\n },\n ]\n );\n closeSnackbar();\n enqueueSnackbar(`Your new password has been set to ${AVAFollowUpData.proposedPassword} and you are being signed-in now...`, { variant: 'info' });\n let result = await tryUser(this_user.person_id, this_user.client_id, 'stored password match', { waiveTFA: true });\n if (result === 'good') {\n let eMessage = `Successful Login for ${this_user.person_id}`;\n enqueueSnackbar(eMessage, { variant: 'info', persist: false });\n await logAccessAttempt(this_user.person_id, '', true, eMessage);\n launchAVA(this_user.person_id);\n return;\n }\n let eMessage = `Something went wrong.`;\n await logAccessAttempt('Text - new password set, but login failed', '', false, eMessage);\n enqueueSnackbar(`${eMessage} Please try again.`, { variant: 'error', persist: true });\n setDoneTrying(true);\n return;\n }}\n />\n }\n {selectFromMultipleAccounts() &&\n {\n setAVAFollowUpData({ 'NeedUser': true });\n updateReactData({\n multipleAccountList: false\n }, true);\n }}\n onSelect={async (response) => {\n updateReactData({\n multipleAccountList: false\n }, false);\n let result = await tryUser(response.person_id, response.client_id, \"selection\");\n if (result === 'good') {\n let eMessage = `Successful Login for ${response.person_id}`;\n await logAccessAttempt(response.person_id, '', true, eMessage);\n launchAVA(response.person_id);\n return;\n }\n }}\n />\n }\n {promptSignUp() &&\n {\n setMessageList([]);\n closeSnackbar();\n enqueueSnackbar(`Please enter your User ID`, { variant: 'info', persist: true });\n setAVAFollowUpData({ 'NeedUser': true });\n }}\n onConfirm={() => {\n setAVAFollowUpData({\n 'addAccount': true,\n 'prompt': [\n 'Tap below to continue'\n ],\n pUser: AVAFollowUpData.pUser,\n pSource: AVAFollowUpData.pSource,\n pClient: AVAFollowUpData.pClient,\n client_id: AVAFollowUpData.pClient\n });\n setDoneTrying(true);\n return 'subscription';\n }}\n />\n }\n {newSubscriptionPrompt() &&\n {\n if (response) {\n let request = {\n client: AVAFollowUpData.client_id,\n author: AVAFollowUpData.pUser.toLowerCase(),\n person_id: AVAFollowUpData.pUser.toLowerCase(),\n messageText:\n `${(response.first + ' ' + response.last).trim()} has created an account in ${AVAFollowUpData.client_id} with the ID ${response.person_id}.`,\n recipientList: ['ava-support'],\n subject: `New Account for ${(response.first + ' ' + response.last).trim()}`\n };\n await sendMessages(request);\n setDoneTrying(true);\n setAVAFollowUpData({\n 'addAccount': true,\n 'prompt': [\n 'Tap below to continue'\n ],\n pUser: AVAFollowUpData.pUser,\n pSource: AVAFollowUpData.pSource,\n pClient: AVAFollowUpData.pClient,\n client_id: AVAFollowUpData.pClient\n });\n setDoneTrying(true);\n return (await genericLogin(response.person_id, AVAFollowUpData.pSource));\n }\n else {\n setDoneTrying(true);\n setAVAFollowUpData({ 'NeedUser': true });\n }\n }}\n />\n }\n {verifySubscription() &&\n {\n return (await genericLogin(AVAFollowUpData.pUser, AVAFollowUpData.pSource));\n }}\n onConfirm={async () => {\n let request = {\n client: AVAFollowUpData.client_id,\n author: AVAFollowUpData.pUser.toLowerCase(),\n person_id: AVAFollowUpData.pUser.toLowerCase(),\n messageText:\n `The owner of this e-Mail address indicated their intention to subscribe to AVA in the ${AVAFollowUpData.client_id} client. Please check the Stripe reports for more information.`,\n recipientList: ['ava-support'],\n subject: `New Subscription for ${AVAFollowUpData.pUser.toLowerCase()}`\n };\n await sendMessages(request);\n return (await genericLogin(AVAFollowUpData.pUser, AVAFollowUpData.pSource));\n }}\n />\n }\n {verifySignUp() &&\n {\n setMessageList([]);\n closeSnackbar();\n enqueueSnackbar(`Please enter your User ID`, { variant: 'info', persist: true });\n setAVAFollowUpData({ 'NeedUser': true });\n }}\n onConfirm={async () => {\n await updateDb(\n [\n {\n \"table\": \"People\",\n \"key\": { \"person_id\": AVAFollowUpData.pUser.toLowerCase() },\n \"data\": {\n \"client_id\": AVAFollowUpData.client_id || AVAFollowUpData.client_name,\n \"name\": {\n \"first\": AVAFollowUpData.pUser,\n \"last\": \"New Subscriber\"\n },\n \"search_data\": AVAFollowUpData.pUser.toLowerCase(),\n \"messaging\": {\n \"email\": AVAFollowUpData.pUser,\n },\n \"preferred_method\": \"email\",\n \"clients\": [\n {\n \"groups\": [\n \"message_only\",\n \"_TOP_\"\n ],\n \"id\": AVAFollowUpData.client_id || AVAFollowUpData.client_name\n }\n ],\n \"groups\": [\n \"message_only\",\n \"_TOP_\"\n ]\n }\n },\n {\n \"table\": \"SessionsV2\",\n \"key\": { \"session_id\": AVAFollowUpData.pUser.toLowerCase() },\n \"data\": {\n \"client_id\": AVAFollowUpData.client_id || AVAFollowUpData.client_name,\n \"user_id\": AVAFollowUpData.pUser.toLowerCase(),\n \"assigned_to\": \"message_only\",\n \"subscription_status\": \"inactive\"\n }\n }\n ]\n );\n let request = {\n client: AVAFollowUpData.client_id || AVAFollowUpData.client_name,\n author: AVAFollowUpData.pUser.toLowerCase(),\n person_id: AVAFollowUpData.pUser.toLowerCase(),\n messageText: `The owner of this e-Mail address indicated their intention to subscribe to AVA in the ${AVAFollowUpData.client_id || AVAFollowUpData.client_name} client. Please check the Stripe reports for more information.`,\n recipientList: ['ava-support'],\n subject: `New Subscription for ${AVAFollowUpData.pUser.toLowerCase()}`\n };\n await sendMessages(request);\n setMessageList([]);\n closeSnackbar();\n enqueueSnackbar(`Please enter your User ID`, { variant: 'info', persist: true });\n setAVAFollowUpData({ 'NeedUser': true });\n }}\n />\n }\n \n );\n }\n else {\n return ();\n }\n\n async function cognitoLogin(pUser, pPass, pWho = null) {\n try {\n await Auth.signIn({ username: pUser, password: pPass.trim(), clientMetadata: { avaAccount: pWho || pUser } });\n return [true, pUser, pPass];\n }\n catch (e) {\n if (!pPass) {\n await logAccessAttempt(pUser, pPass, false, `You left the password blank!`);\n }\n else {\n await logAccessAttempt(pUser, pPass, false,\n `Failed login. Attempted ${pUser} and ${pPass.trim()}. Cognito responded with ${e.code} - ${e.message}`\n );\n }\n setDoneTrying(false);\n if ((e.code !== 'NotAuthorizedException')\n || (e.message.includes('expired'))\n || (e.message.includes('exceeded'))) {\n return [false, null, null];\n }\n // Likely this is a bad password situation\n // First, try to case-correct the first character of the passed in password\n let c0 = pPass.trim().charAt(0);\n let caseCorrectedPassword;\n if (c0 === c0.toUpperCase()) { // first character was a capital letter\n caseCorrectedPassword = c0.toLowerCase() + pPass.trim().substring(1);\n }\n else { // first character was a lower case letter\n caseCorrectedPassword = c0.toUpperCase() + pPass.trim().substring(1);\n }\n try {\n await Auth.signIn({ username: pUser, password: caseCorrectedPassword, validationData: { avaAccount: pUser } });\n await logAccessAttempt(pUser, pPass, true, 'Successful Log-in with case corrected password');\n return [true, pUser, caseCorrectedPassword];\n }\n catch (e2) {\n await logAccessAttempt(pUser, `${caseCorrectedPassword} (case corrected)`, false,\n `Failed case corrected login. Reason:${e2.code} Message:${e2.message}`\n );\n setDoneTrying(true);\n return [false, null, null];\n }\n }\n }\n\n function bakeCookie(pUser, pClient, pPerson) {\n let ninetyDays = 90 * (24 * 60 * 60);\n setCookie('AVAuser',\n JSON.stringify({\n user_id: pUser,\n client: pClient,\n person_id: pPerson\n }), { path: '/', maxAge: ninetyDays });\n if (pClient) {\n setCookie('AVAclient', JSON.stringify({\n client: pClient,\n }), { path: '/' });\n };\n }\n\n function putValidationCookie() {\n setCookie('AVAvalidated', 'true', { path: '/' });\n }\n\n function putActionCookie(urlObj) {\n removeCookie(\"AVAaction\");\n setCookie('AVAaction', JSON.stringify({\n document: (urlObj.document || null),\n docUser: (urlObj.docUser || null)\n }), { path: '/' });\n }\n\n function getCookie() {\n let returnObj;\n if (cookies.AVAuser && cookies.AVAuser !== 'undefined') {\n if (typeof (cookies.AVAuser) === 'string') { returnObj = JSON.parse(cookies.AVAuser); }\n else { returnObj = cookies.AVAuser; }\n if (!('client' in returnObj)) { returnObj.client = getClientCookie(); }\n return returnObj;\n }\n else {\n let cClient = getClientCookie();\n if (cClient) { return { 'client': cClient }; }\n return false;\n };\n }\n\n function getClientCookie() {\n if (cookies.AVAclient && cookies.AVAclient !== 'undefined') {\n if (typeof (cookies.AVAclient) === 'string') { return cookies.AVAclient; }\n else { return (cookies.AVAclient.client_id || cookies.AVAclient.client_id); }\n }\n else { return null; }\n }\n\n function getParamsFromURL() {\n let returnObject = {};\n allParams.forEach((value, key) => {\n console.log(key, value);\n returnObject[key] = value;\n });\n if (Object.keys(returnObject).length > 0) {\n return returnObject;\n }\n else { return null; }\n }\n\n\n async function sendMessage(pClient, pSender, pMessage, pRecipient) {\n let payload = {\n \"body\": {\n \"client\": pClient,\n \"author\": pSender,\n \"values\": pRecipient + ' ~ MessageText = ' + pMessage\n }\n };\n await lambda\n .invoke({\n FunctionName: 'arn:aws:lambda:us-east-1:125549937716:function:messageEngine',\n InvocationType: 'RequestResponse',\n LogType: 'Tail',\n Payload: JSON.stringify(payload)\n })\n .promise()\n .catch(err => {\n console.log('Call failed. Error is', JSON.stringify(err));\n });\n };\n\n async function getSessionV2(pSessionID) {\n let goodIO = true;\n let sessionRec = await dbClient\n .get({\n Key: { session_id: pSessionID.toLowerCase() },\n TableName: \"SessionsV2\"\n })\n .promise()\n .catch(async (error) => {\n if (error.code === 'NetworkingError') {\n enqueueSnackbar(`There is no internet connection.`, { variant: 'error', persist: true });\n }\n else {\n let eMessageText = JSON.stringify(error.message);\n if (eMessageText.startsWith('Signature not yet current')) {\n enqueueSnackbar(`The clock on this device is incorrect. Please sync your device's time settings.`, { variant: 'error', persist: true });\n }\n else {\n await logAccessAttempt(pSessionID.toLowerCase(), '', false, `Error reading SessionsV2 (case converted) is ${eMessageText}`);\n }\n }\n console.log({ 'Bad get on Session - caught error is': error });\n goodIO = false;\n });\n if (!goodIO) {\n setDoneTrying(true);\n return [false, null, true];\n }\n if (!recordExists(sessionRec) && (pSessionID.toLowerCase() !== pSessionID)) {\n sessionRec = await dbClient\n .get({\n Key: { session_id: pSessionID },\n TableName: \"SessionsV2\"\n })\n .promise()\n .catch(async (error) => {\n await logAccessAttempt(pSessionID, '', false, `Error reading SessionsV2 is: ${JSON.stringify(error)}`);\n console.log({ 'Bad get on Session - caught error is': error });\n goodIO = false;\n });\n }\n if (!goodIO) {\n setDoneTrying(true);\n return [false, null, true];\n }\n if (!recordExists(sessionRec)) {\n setDoneTrying(true);\n return [false, null];\n }\n let user_fontSize = 1;\n if (sessionRec.Item.customizations && sessionRec.Item.customizations.font_size) {\n user_fontSize = sessionRec.Item.customizations.font_size;\n }\n AVADefaults({ fontSize: Math.max(user_fontSize, 1) });\n let logoRec = await dbClient\n .get({\n Key: {\n client_id: sessionRec.Item.client_id,\n custom_key: 'logo'\n },\n TableName: \"Customizations\",\n })\n .promise()\n .catch(error => {\n console.log({ 'Bad get on Customizations - caught error is': error });\n });\n if (recordExists(logoRec)) {\n sessionRec.Item.client_icon = logoRec.Item.icon;\n updateReactData({\n currentClientLogo: sessionRec.Item.client_icon\n });\n }\n setDoneTrying(true);\n return [true, sessionRec.Item];\n }\n\n async function getPerson(pPersonID) {\n let peopleRec = await dbClient\n .get({\n Key: { person_id: pPersonID },\n TableName: \"People\"\n })\n .promise()\n .catch(error => {\n console.log({ 'Bad get on People - caught error is': error });\n });\n if (recordExists(peopleRec)) { return [true, peopleRec.Item]; }\n else { return [false, null]; }\n }\n\n async function getByAlternateID(pInput) {\n var altIDs = await dbClient\n .query({\n KeyConditionExpression: 'identifier = :i',\n ExpressionAttributeValues: { ':i': pInput },\n TableName: \"PeopleAccounts\",\n IndexName: 'alternate_id-index'\n })\n .promise()\n .catch(error => { console.log(`getGroup ERROR reading Customizations; caught error is: ${error}`); });\n if (recordExists(altIDs)) {\n let foundIDs = [];\n for (let p = 0; p < altIDs.Items.length; p++) {\n let [goodGet, this_person] = await getPerson(altIDs.Items[p].person_id);\n if (goodGet &&\n ((!reactData.urlData.client_id)\n || (this_person.client_id === reactData.urlData.client_id)\n )) {\n foundIDs.push(this_person);\n }\n }\n if (foundIDs.length === 0) {\n enqueueSnackbar(`This account does not exist in ${reactData.customizationData.client_name}.`, { variant: 'error', persist: true });\n return [false, null];\n }\n else {\n return [false, foundIDs];\n }\n }\n return [false, null];\n }\n\n async function getSessions(pSession) {\n let sessionRec = await dbClient\n .get({\n Key: { session_key: pSession },\n TableName: \"Sessions\"\n })\n .promise()\n .catch(error => {\n console.log({ 'Bad get on Sessions - caught error is': error });\n });\n if (recordExists(sessionRec)) { return sessionRec.Item; }\n else { return null; }\n }\n\n async function logAccessAttempt(pUser, pAttempted, pOK, pMessage) {\n let pMessageList = messageList;\n if (!pOK) {\n pMessageList.push(pMessage);\n }\n let nowTime = new Date();\n await dbClient\n .put({\n TableName: 'AccessLog',\n Item: {\n timestamp: nowTime.getTime(),\n timestring: nowTime.toLocaleString(),\n user_key: pUser,\n attempted_user: pUser,\n attempted_password: pAttempted,\n result: pMessage\n }\n })\n .promise()\n .catch(error => {\n console.log('Error adding an access log record:', error.message);\n pMessageList.push(`Error adding accessLog is ${error.message}`);\n });\n if (!pOK) {\n setMessageList(pMessageList);\n }\n return;\n };\n\n\n async function updateDb(pData) {\n // pData in the form {[\"table\": , \"key\": {\"key1\": \"keydata1\", etc...}, \"data\": {\"field_name1\": \"new value\", \"field_name2\", \"new value\", ...}]}\n let response = [];\n for (let t = 0; t < pData.length; t++) {\n let k_num = 0;\n let aNamesObj = {};\n let aValuesObj = {};\n let expression = 'set';\n for (let pKey in pData[t].data) {\n let aKey = `n${k_num++}`;\n aNamesObj[`#${aKey}`] = pKey;\n aValuesObj[`:${aKey}`] = pData[t].data[pKey];\n if (k_num > 1) {\n expression += ', ';\n }\n expression += ` #${aKey} = :${aKey}`;\n }\n await dbClient\n .update({\n Key: pData[t].key,\n UpdateExpression: expression,\n ExpressionAttributeValues: aValuesObj,\n ExpressionAttributeNames: aNamesObj,\n TableName: pData[t].table,\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating ${pData[t].table}; error is:`, error);\n response.push(error);\n });\n response.push('OK');\n }\n return response;\n }\n\n\n async function updateSession(pSessionID, pSession, pPatient, pProfile, pLogin, pURL, pMessage, pSessionInfo) {\n let attributeValues = {\n ':s': {\n 'version': `v${process.env.REACT_APP_AVA_VERSION}`,\n 'environment': window.location.href.split('//')[1].charAt(0).toUpperCase(),\n 'time': new Date().toString(),\n 'signin_status': pMessage,\n 'source': 'bootstrap'\n }\n };\n let updateExpression = 'set #s = :s, ';\n if (pLogin) {\n attributeValues[':p'] = pLogin;\n updateExpression += 'last_login = :p, ';\n }\n if (pSession.patient_id) {\n attributeValues[':pid'] = pSession.patient_id;\n updateExpression += 'patient_id = :pid, ';\n }\n if (pProfile.hasOwnProperty('name') || pPatient.patient_id) {\n let showName = (pProfile.hasOwnProperty('name') ? `${pPatient.name.first} ${pPatient.name.last}` : `Unnamed account (${pPatient.patient_id})`);\n attributeValues[':pn'] = showName;\n updateExpression += 'patient_display_name = :pn, ';\n }\n if (platform) {\n attributeValues[':dev'] = platform;\n updateExpression += 'platform = :dev, ';\n }\n if (pURL) {\n if (typeof (pURL) === 'object') {\n attributeValues[':u'] = JSON.stringify(pURL);\n }\n else {\n attributeValues[':u'] = pURL;\n }\n updateExpression += 'url_parameters = :u, ';\n }\n if (pProfile.person_id) {\n attributeValues[':uid'] = pProfile.person_id;\n updateExpression += 'user_id = :uid, ';\n }\n updateExpression = updateExpression.substring(0, updateExpression.length - 2);\n await dbClient\n .update({\n Key: { session_id: pSessionID },\n UpdateExpression: updateExpression,\n ExpressionAttributeValues: attributeValues,\n ExpressionAttributeNames: { \"#s\": \"status\" },\n TableName: \"SessionsV2\",\n })\n .promise()\n .catch(error => { console.log(`caught error updating SessionsV2; error is:`, error); });\n await dbClient\n .put({\n TableName: 'Sessions',\n Item: {\n session_key: pSessionInfo.accessToken.payload.jti,\n last_update: new Date().toLocaleString(),\n platform: platform,\n login: {\n user_id: pSessionID\n }\n }\n })\n .promise()\n .catch(error => { console.error('Error adding a fact:', error.message); });\n }\n\n async function launchAVA(pLaunchUser) {\n // Get the sessionlaunchAVA\n let goodSession, currentSession, dbError;\n [goodSession, currentSession, dbError] = await getSessionV2(pLaunchUser);\n if (!goodSession) {\n let eMessage;\n if (dbError) {\n eMessage = `No Internet connection. Can't connect to the AVA database.`;\n }\n else {\n eMessage = `No SessionV2 record for ${pLaunchUser}. This Account is not set up properly in AVA.`;\n }\n await logAccessAttempt(pLaunchUser, '', false, eMessage);\n enqueueSnackbar(eMessage, { variant: 'error', persist: true });\n sendMessage('AVA', 'bootstrap', eMessage, 'ava_support');\n setAVAReady(false);\n setAVAFollowUpData();\n setDoneTrying(true);\n return false;\n }\n if (currentSession.customizations && currentSession.customizations.font_size) {\n AVADefaults({ fontSize: Math.max(currentSession.customizations.font_size, 1) });\n }\n // Get the User's profile (info about the logged in person)\n let goodUser, currentProfile;\n [goodUser, currentProfile] = await getPerson(pLaunchUser);\n if (!goodUser) {\n let eMessage = `No People record for ${pLaunchUser}. This Account is not set up properly in AVA.`;\n await logAccessAttempt(pLaunchUser, '', false, eMessage);\n enqueueSnackbar(eMessage, { variant: 'error', persist: true });\n sendMessage('AVA', 'bootstrap', eMessage, 'ava_support');\n setAVAReady(false);\n setAVAFollowUpData();\n setDoneTrying(true);\n return false;\n }\n // Get the Patient's profile (info about the active person - usually the same as the logged in user)\n let currentPatient;\n if (currentSession.patient_id === pLaunchUser) {\n currentPatient = currentProfile;\n }\n else {\n if (!currentSession.patient_id && pLaunchUser) {\n currentSession.patient_id = pLaunchUser;\n }\n [goodUser, currentPatient] = await getPerson(currentSession.patient_id);\n if (!goodUser) {\n let eMessage = `Attempt to use account ${currentSession.patient_id} failed. That Account is not set up properly in AVA. Using ${pLaunchUser} instead.`;\n await logAccessAttempt(pLaunchUser, '', false, eMessage);\n enqueueSnackbar(eMessage, { variant: 'error' });\n sendMessage('AVA', 'bootstrap', eMessage, 'ava_support');\n currentPatient = currentProfile;\n currentSession.patient_id = pLaunchUser;\n if (!currentProfile.name) {\n currentSession.patient_name = pLaunchUser;\n }\n else {\n currentSession.patient_name = (`${currentProfile.name.first} ${currentProfile.name.last}`).trim();\n }\n }\n }\n // Get Client Defaults\n if (!currentSession || !currentSession.client_name) {\n let client_list = ['*all', currentSession.client_id];\n for (let cN = 0; cN < client_list.length; cN++) {\n var customizationsRec = await dbClient\n .query({\n KeyConditionExpression: 'client_id = :c',\n ExpressionAttributeValues: { ':c': client_list[cN] },\n TableName: \"Customizations\",\n })\n .promise()\n .catch(error => { console.log(`getGroup ERROR reading Customizations; caught error is: ${error}`); });\n if (recordExists(customizationsRec)) {\n for (let c = 0; c < customizationsRec.Items.length; c++) {\n let cRec = customizationsRec.Items[c];\n AVADefaults({ [cRec.custom_key]: cRec.customization_value });\n switch (cRec.custom_key) {\n case 'logo': {\n currentSession.client_logo = cRec.icon;\n updateReactData({\n currentClientLogo: cRec.icon\n });\n break;\n }\n case 'client_name': {\n currentSession.client_name = cRec.customization_value;\n break;\n }\n case 'group_assignments': {\n currentSession.group_assignments = cRec.customization_value;\n currentSession.inactiveGroupList = ['inactive'];\n let inactiveAssignment = makeArray(currentSession?.group_assignments?.inactive);\n if (inactiveAssignment.length > 0) {\n currentSession.inactiveGroupList.push(...inactiveAssignment);\n }\n break;\n }\n case 'greeting':\n case 'greetings': {\n let today = new Date();\n let this_year = today.getFullYear();\n let this_month = today.getMonth() + 1;\n let this_day = today.getDate();\n let mmdd = `${this_month}.${this_day}`;\n let yymmdd = `${this_year % 100}.${mmdd}`;\n if (cRec.customization_value.hasOwnProperty(yymmdd)) {\n currentSession.custom_greeting = cRec.customization_value[yymmdd];\n }\n else if (cRec.customization_value.hasOwnProperty(mmdd)) {\n currentSession.custom_greeting = cRec.customization_value[mmdd];\n }\n break;\n }\n case 'working_hours': {\n currentSession['working_hours'] = cRec.customization_value;\n currentSession['working_hours'].isHoliday = false;\n if (cRec.customization_value.hasOwnProperty('holidays')) {\n let today = new Date();\n let this_year = today.getFullYear();\n let this_month = today.getMonth() + 1;\n let this_day = today.getDate();\n let mmdd = `${this_month}.${this_day}`;\n let yymmdd = `${this_year % 100}.${mmdd}`;\n if (cRec.customization_value.holidays.hasOwnProperty(yymmdd)) {\n currentSession['working_hours'].isHoliday = true;\n }\n else if (cRec.customization_value.holidays.hasOwnProperty(mmdd)) {\n currentSession['working_hours'].isHoliday = true;\n }\n }\n break;\n }\n default: {\n if (cRec.customization_value) {\n currentSession[cRec.custom_key] = cRec.customization_value;\n }\n break;\n }\n }\n }\n }\n }\n }\n\n belongsTo = await getGroupsBelongTo(currentSession.client_id, currentSession.patient_id, { sort: true });\n let group_structure = await getAllGroups(currentSession.patient_id, currentSession.client_id);\n dispatch({ type: SET_GROUPS, payload: Object.assign({}, group_structure, { belongsTo }) });\n\n currentSession.adminAccount = false;\n if (currentProfile.account_class) {\n if ((currentProfile.account_class === 'master')\n || ((currentProfile.account_class === 'support')\n && (makeArray(currentProfile.clients).some(a => { return (a.id === currentSession.client_id); })))) {\n currentSession.adminAccount = true;\n };\n }\n if (!currentSession.adminAccount) {\n currentSession.adminAccount = await adminAccount(currentSession, currentPatient);\n }\n\n if ((currentSession.adminAccount) && (currentProfile.account_class !== 'master') && (currentProfile.account_class !== 'support')) {\n currentProfile.account_class = 'admin';\n }\n\n dispatch({ type: SET_SESSION, payload: currentSession });\n dispatch({ type: SET_PROFILE, payload: currentProfile });\n dispatch({ type: SET_USER, payload: currentProfile });\n dispatch({ type: SET_PATIENT, payload: currentPatient });\n sessionStorage.setItem('AVASessionData', JSON.stringify({ currentProfile }));\n\n bootState = {\n session: currentSession,\n profile: currentProfile,\n user: currentProfile,\n patient: currentPatient\n };\n\n let sessionInfo = await Auth\n .currentSession()\n .catch(e => {\n console.log(e);\n });\n\n // localStorage.setItem('AVASessionData', JSON.stringify({ currentSession, currentProfile, currentPatient, sessionInfo }));\n // sessionStorage.setItem('AVASessionData', JSON.stringify({ currentSession, currentProfile, currentPatient, sessionInfo }));\n bakeCookie(currentSession.session_id, currentSession.client_id, currentPatient.person_id);\n\n currentSession.url_parameters = getParamsFromURL();\n updateSession(currentSession.session_id, currentSession, currentPatient, currentProfile, currentSession.last_login, currentSession.url_parameters, 'AVA Launch', sessionInfo);\n\n // synchronous load other data\n loadSyncInfo(currentSession, currentPatient);\n\n putValidationCookie();\n if (currentSession.url_parameters) {\n if (currentSession.url_parameters.hasOwnProperty('document')) {\n putActionCookie(currentSession.url_parameters);\n }\n else if (currentSession.url_parameters.hasOwnProperty('forms')) {\n removeCookie(\"AVAaction\");\n setCookie('AVAaction', JSON.stringify({\n forms: true\n }), { path: '/' });\n }\n }\n else if (reactData.urlData.hasOwnProperty('document')) {\n putActionCookie(reactData.urlData);\n }\n setAVAReady(true);\n localAVAReady = true;\n setAVAFollowUpData({ 'Completed': true });\n return true;\n }\n\n async function loadSyncInfo(workSession, this_patient) {\n console.log(`in loadSyncInfo`);\n let pSession = deepCopy(workSession);\n let groupsObj = {};\n let membersObj = {};\n let aPromise = accountAccess(pSession.user_id, pSession.client_id, dispatch)\n .then(accessList => {\n dispatch({ type: SET_ACCESSLIST, payload: accessList });\n bootState.accessList = accessList;\n console.log(`done with loadSyncInfo AccessList.`);\n })\n .catch(error => {\n console.log(`error in loadSyncInfo AccessList. Message is ${error.message}`);\n });\n // let cPromise = getAllGroups(pSession.patient_id, pSession.client_id)\n // .then(groups => {\n // dispatch({ type: SET_GROUPS, payload: Object.assign({}, { belongsTo }, membersObj, groups) });\n // console.log(`done with loadSyncInfo Groups. Retrieved groups keys as ${Object.keys(groups)}`);\n // groupsObj = groups;\n // });\n\n let rightNow = new Date();\n let dPromise = getAllOccurrences(\n {\n client_id: pSession.client_id,\n this_person: pSession.patient_id,\n start_date: rightNow,\n end_date: addDays(rightNow, 35),\n filter: { group: belongsTo },\n },\n ).then(occList => {\n dispatch({ type: SET_CALENDAR, payload: occList });\n bootState.calendar = occList;\n console.log(`done with loadSyncInfo Calendar. Loaded ${Object.keys(occList).length - 1} dates`);\n })\n .catch(error => {\n console.log(`error in loadSyncInfo Calendar. Message is ${error.message}`);\n });\n v2buildCalendar(\n {\n client_id: pSession.client_id,\n this_person: pSession.patient_id,\n start_date: rightNow,\n end_date: addDays(rightNow, 35),\n filter: { group: belongsTo },\n },\n ).then(sampleList => {\n console.log(`done with test calendar load.`);\n console.log({ sampleList });\n })\n .catch(error => {\n console.log(`error in test load Calendar. Message is ${error.message}`);\n });\n // await Promise.allSettled([aPromise, cPromise, dPromise])\n await Promise.allSettled([aPromise, dPromise])\n .then(results => {\n console.log(`All resolved; results are ${JSON.stringify(results)}`, 'Launching MakeAVAMenu');\n bootState.groups = Object.assign({}, { belongsTo }, membersObj, groupsObj);\n MakeAVAMenu(this_patient, pSession.client_id, screenQuiet, null, null, bootState)\n .then(() => {\n console.log(`Menu reload complete`);\n });\n /*\n let last_state = {\n list: deepCopy(bootState.accessList[pSession.client_id].list)\n };\n console.log(`lastState size is approx ${JSON.stringify(last_state).length}`);\n dbClient\n .update({\n Key: { session_id: pSession.user_id },\n UpdateExpression: 'set last_state = :s',\n ExpressionAttributeValues: { \":s\": last_state },\n TableName: \"SessionsV2\",\n })\n .promise()\n .catch(error => {\n console.log(`caught error updating SessionsV2; error is:`, error);\n });\n */\n });\n return;\n }\n\n async function adminAccount(currentSession) {\n if (!currentSession.hasOwnProperty('group_assignments')) { return true; }\n let groupObject = currentSession.group_assignments;\n let adminArray = [];\n if (groupObject.hasOwnProperty('admin')) { adminArray.push(...(makeArray(groupObject.admin))); }\n if (groupObject.hasOwnProperty('staff')) { adminArray.push(...(makeArray(groupObject.staff))); }\n if (adminArray.length === 0) { return true; }\n return adminArray.some(g => {\n return belongsTo.hasOwnProperty[g];\n });\n }\n\n\n function screenQuiet(statusMessage) {\n return;\n };\n\n function recordExists(recordId) {\n if (!recordId) { return false; }\n if (recordId.hasOwnProperty('Count')) { return (recordId.Count > 0); }\n else { return ((recordId.hasOwnProperty(\"Item\") || recordId.hasOwnProperty(\"Items\"))); }\n }\n};\n","import { SET_MODE } from './actions';\n\nexport default (state, action) => {\n const { type, payload } = action;\n switch (type) {\n case SET_MODE:\n return { ...state, mode: payload };\n default:\n return state;\n }\n};\n","export const SET_MODE = 'SET_MODE';\n","import React from 'react';\nimport reducer from './reducer';\n\nconst initialState = {\n mode: 'dark',\n};\n\nexport const DarkModeContext = React.createContext(initialState);\n\nexport default ({ children }) => {\n const [state, dispatch] = React.useReducer(reducer, initialState);\n return {children};\n};\n","import React from 'react';\n\nimport Box from '@material-ui/core/Box';\n\nimport AssignmentIcon from '@material-ui/icons/Assignment';\nimport AutorenewIcon from '@material-ui/icons/Autorenew';\nimport ExitToAppIcon from '@material-ui/icons/ExitToApp';\nimport Typography from '@material-ui/core/Typography';\nimport Button from '@material-ui/core/Button';\n\nimport withRecoil from './wrappers/withRecoil';\nimport withRoot from './wrappers/withRoot';\nimport hocFactory from './util/hocFactory';\nimport TheseusScreen from './screens/TheseusScreen';\nimport ThankYouScreen from './screens/ThankYouScreen';\n\nimport Reloader from './screens/Reloader';\nimport RootNavigation from './navigation/RootNavigation';\nimport withBootstrap from './hocs/withBootstrap';\nimport withDarkMode from './hocs/withDarkMode';\nimport withRouter from './hocs/withRouter';\nimport withSession from './hocs/withSession';\nimport withSnackbar from './hocs/withSnackbar';\nimport withTheme from './hocs/withTheme';\n\nconst menu = [\n { label: 'AVA', path: '/theseus', icon: , screen: },\n { label: 'Refresh', path: '/refresh', icon: , screen: },\n { label: 'Thanks', path: '/thankyou', icon: , screen: },\n];\n\nconst HOME = '/theseus';\nvar hasError = false;\n\nclass ErrorBoundary extends React.Component {\n constructor(props) {\n super(props);\n hasError = false;\n }\n\n static getDerivedStateFromError(error) {\n hasError = true;\n // handleWriteError(`AVA caught error \"${error.message}\" at line ${error.lineNumber} in file ${error.fileName}`);\n }\n\n componentDidCatch(error, info) {\n hasError = true;\n // handleWriteError(`AVA caught error. String is \"${error.toString()}\". Cause is ${error.cause} on stack ${error.stack}`);\n }\n\n render() {\n if (hasError) {\n return (\n \n \n \n {`AVA Encountered an Error`}\n {`version ${process.env.REACT_APP_AVA_VERSION}${window.location.href.split('//')[1].slice(0, 1).toUpperCase()}`}\n {\n let jumpTo = window.location.href.replace('refresh', 'theseus');\n window.location.replace(jumpTo);\n }}\n >\n {'Tap here'}\n \n \n \n \n );\n }\n else {\n return this.props.children;\n }\n }\n}\n\nconst App = () => (\n \n \n \n \n \n \n \n);\n\nexport default hocFactory(\n App,\n [\n withRecoil,\n withRoot,\n withRouter,\n withDarkMode,\n withTheme,\n withSnackbar,\n withSession,\n // withAuth,\n withBootstrap,\n // withA2HS,\n ]);\n","/**\n * Factory for wrapping a Component with specified HOCs (Higher-Order Components).\n *\n * (Note: set rtl = false if you want the outermost HOC layer to be the LAST index)\n *\n * @author Jalo Moster \n * @version 2.0.0\n * @since 7/12/2020\n *\n * @param Component the component to wrap\n * @param hocs the hocs for wrapping the component\n * @param rtl wrap the component from the rightmost (last index) hoc to the leftmost (first index)\n * @returns {React.Component}\n */\nexport default (Component, hocs = [], rtl = true) => {\n if (hocs.length > 0) {\n if (rtl) {\n return hocs.reduceRight((DerivedComponent, withHOC) => withHOC(DerivedComponent), Component);\n }\n return hocs.reduce((DerivedComponent, withHOC) => withHOC(DerivedComponent), Component);\n }\n return Component;\n};\n","import React from 'react';\nimport { RecoilRoot } from 'recoil';\n\nexport default Component => props => (\n \n \n \n);\n","import React from 'react';\nimport { BrowserRouter } from 'react-router-dom';\n\nexport default Component => props => (\n \n \n \n);\n","import React from 'react';\nimport DarkModeProvider from '../contexts/DarkMode';\n\nexport default Component => props => (\n \n \n \n);\n","import React from 'react';\nimport CssBaseline from '@material-ui/core/CssBaseline';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport { ThemeProvider, unstable_createMuiStrictModeTheme } from '@material-ui/core/styles';\n\nimport useDarkMode from '../hooks/useDarkMode';\nimport { SET_MODE } from '../contexts/DarkMode/actions';\n\nexport default Component => props => {\n const { state, dispatch } = useDarkMode();\n const { mode } = state; \n //TEMPORARY FIX TO FORCE LIGHT MODE\n //const { dispatch } = useDarkMode();\n //const mode = 'light';\n const theme = React.useMemo(\n () =>\n unstable_createMuiStrictModeTheme({\n palette: {\n type: mode,\n primary: {\n light: '#a6d4fa',\n main: '#90caf9',\n dark: '#648dae',\n },\n secondary: {\n light: '#f6a5c0',\n main: '#f48fb1',\n dark: '#aa647b',\n },\n confirm: {\n light: '#3bd12a',\n main: '#44f230',\n dark: '#459130',\n },\n reject: {\n light: '#f70531',\n main: '#d10228',\n dark: '#ad0322',\n },\n error: {\n light: '#e57373',\n main: '#f44336',\n dark: '#d32f2f',\n },\n warning: {\n light: '#ffb74d',\n main: '#ff9800',\n dark: '#f57c00',\n },\n info: {\n light: '#64b5f6',\n main: '#2196f3',\n dark: '#1976d2',\n },\n success: {\n light: '#81c784',\n main: '#4caf50',\n dark: '#388e3c',\n },\n },\n }),\n [mode]\n );\n\n let prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)');\n //let prefersDarkMode = false;\n React.useEffect(() => {\n const localTheme = localStorage.getItem('theseus-medical-theme');\n const initial = localTheme || (prefersDarkMode ? 'dark' : 'light');\n dispatch({ type: SET_MODE, payload: initial });\n }, [dispatch, prefersDarkMode]);\n\n return (\n \n \n \n \n );\n};\n","import React from 'react';\nimport { DarkModeContext } from '../contexts/DarkMode';\n\nexport default () => {\n const context = React.useContext(DarkModeContext);\n if (context === undefined) {\n throw new Error('useDarkMode must be used within a DarkModeProvider');\n }\n return context;\n};\n","import React from 'react';\nimport { SnackbarProvider } from 'notistack';\nimport Button from '@material-ui/core/Button';\n// // import useMediaQuery from '@material-ui/core/useMediaQuery';\n\nexport default Component => props => {\n const notistackRef = React.createRef();\n\n const onCLickDismiss = key => () => {\n notistackRef.current.closeSnackbar(key);\n };\n\n return (\n (\n \n )}>\n \n \n );\n};\n","import React from 'react';\nimport SessionProvider from '../contexts/Session';\n\nexport default Component => props => (\n \n \n \n);\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport Amplify from 'aws-amplify';\nimport 'fontsource-roboto';\n\nimport config from './config/amplify.json';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nAmplify.configure(config);\n\nReactDOM.render(\n ,\n document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n","module.exports = __webpack_public_path__ + \"static/media/ava_alert.ca84c521.mp3\";"],"sourceRoot":""}