@openmrs/esm-form-builder-app 2.5.0 → 2.5.1-pre.1001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -7
- package/dist/0078b630bed2938ce03f618c2bcd1363.js +1 -0
- package/dist/{acaef5b3d4971efbf24be1a229186ff5.js → 019e34e85139cfc611bf23efa096c980.js} +1 -1
- package/dist/01d0d81c536cf29f255c5bfabdf357f9.js +1 -0
- package/dist/029f5ee0420883bc3c38a7f143fd174a.js +1 -0
- package/dist/{8d7988f603ec76ecb92315442285a83d.js → 03a5f5b2b97a8fc289399d92fba810d0.js} +1 -1
- package/dist/03c024582e611eac84444a83f7fd962d.js +1 -0
- package/dist/03cecfc674939048da99384e68631f13.js +1 -0
- package/dist/0416c21cfe088739209926632a360e3b.js +1 -0
- package/dist/09c09a39f911db8fb36431d9d48095ac.js +1 -0
- package/dist/{17b41db8dd7120d3a88417a1490f57b7.js → 0bd45b2d490c48c31619072a4fb0eaea.js} +1 -1
- package/dist/0d5aa4cf4cd6ced22d689adc35468925.js +1 -0
- package/dist/{330c0deacbfbbb6f1249b5bd887d608a.js → 0fa30731c46fe8b6a54f9752ad0ed7e0.js} +1 -1
- package/dist/11.js +1 -0
- package/dist/118fa9ea46f9ba830cd0e843f4d3385a.js +1 -0
- package/dist/{5061ac5e99882b9f26051a5d73c75271.js → 1195816afa4a5e8183857be16a04ae6f.js} +1 -1
- package/dist/14729b329294f14e4ca78b8a85f5ffa9.js +1 -0
- package/dist/184.js +2 -0
- package/dist/184.js.LICENSE.txt +14 -0
- package/dist/184.js.map +1 -0
- package/dist/18a469a2f11af88696d750921e25192a.js +1 -0
- package/dist/192.js +1 -0
- package/dist/{447.js.map → 192.js.map} +1 -1
- package/dist/{807.js → 197.js} +1 -1
- package/dist/{7e4b5afab13800eedc72d1669997de99.js → 1c24a68cb472146022d0806ea2505cfb.js} +1 -1
- package/dist/{83d1c691b58768e3ec0a1f88450a7ceb.js → 1ce14f2cad9f3c122cb5ccfcd485ffb4.js} +1 -1
- package/dist/{e6e768df4733fa1a1c8a9b06a24ff2fd.js → 1d3796180f854b5d8ab435ab0a1c2c11.js} +1 -1
- package/dist/{fc84e4779f22e5f1c9a70f56f47e0ed6.js → 1ff1389501159e4846a5133e3b8992d8.js} +1 -1
- package/dist/20545e6680e996248f667158904a6a9b.js +1 -0
- package/dist/214df38fb17fa6274c150507734f4d59.js +1 -0
- package/dist/228.js +1 -0
- package/dist/228.js.map +1 -0
- package/dist/2287e0a9970175f8e26f811b688d2d36.js +1 -0
- package/dist/2302902e10c4afab56e1b864c96070cb.js +1 -0
- package/dist/2348c5ed0da81c27fa889f56e43f91a1.js +1 -0
- package/dist/25be9f866b93e4ffa34f07a4fde632d4.js +1 -0
- package/dist/{56ddbe1e119db3c02da97dc04012cf2b.js → 269732f4c5f6e82ea3246548a9631b47.js} +1 -1
- package/dist/27846e85433e54a3ec0ab34d62233dc5.js +1 -0
- package/dist/29.js +2 -0
- package/dist/29.js.map +1 -0
- package/dist/291.js +2 -0
- package/dist/291.js.LICENSE.txt +9 -0
- package/dist/291.js.map +1 -0
- package/dist/292.js +1 -0
- package/dist/292.js.map +1 -0
- package/dist/{e4bea9a2a2680d970c13cc4ed89bc1a0.js → 2a8394955e047270a2a965ec67843989.js} +1 -1
- package/dist/{99e41196ce05ad5fb70891b44ac227e8.js → 2aa392a501973ebfcea38239a45ed8e7.js} +1 -1
- package/dist/2b1b8f8b9e8f1e423a69afd121fd7da9.js +1 -0
- package/dist/{40f9100a898e3396df73051eb7c44cb8.js → 2b5729e073775b8fb827fc8e4725e48a.js} +1 -1
- package/dist/{262f489eb59166e1215642b60446d123.js → 2b89e20071dd734f42b8694d7a84c264.js} +1 -1
- package/dist/2d17c1117fbcc5f98907a74804e20dde.js +1 -0
- package/dist/{30d2b805bcbc5d6bd558d7bdf9137a0e.js → 2d2a75e3d01a74b93d07db04df8abe5e.js} +1 -1
- package/dist/2e47a5ceba483c50c5ca302447d37e95.js +1 -0
- package/dist/2e841e8b77c2a2c00fd71940632bc1e1.js +1 -0
- package/dist/300.js +1 -0
- package/dist/{465.js → 308.js} +1 -1
- package/dist/318dcae1cdcd4733986a93e7a5fab7b8.js +1 -0
- package/dist/{3cd75b9fb238f5af900205216be23a66.js → 328cbf598e9711b0a87c19437b02f80d.js} +1 -1
- package/dist/{757.js → 335.js} +1 -1
- package/dist/34d45757ec94b255f55a8df0ffbca874.js +1 -0
- package/dist/{fb08407a1b7ad7f9a2da2a7845f596c5.js → 34f99cce131bd7aa65e7a924e2456006.js} +1 -1
- package/dist/360.js +1 -0
- package/dist/360.js.map +1 -0
- package/dist/367def81f25c0a08527f9a4e86e70c56.js +1 -0
- package/dist/38105097fc2497d628f398be7db5f6e8.js +1 -0
- package/dist/3aa9acf68293a7f0389004dd82a08374.js +1 -0
- package/dist/{92e96a5183122509403347f8fde3e407.js → 3ac8c7749734990e2d9f81eeca219886.js} +1 -1
- package/dist/3b624a5e4f3b3ff05a090fcefa18470c.js +1 -0
- package/dist/{8b0e5da82a1aa923f454ee2e6568850b.js → 3bf96f8eb1859e2724a4b769af3b5f1e.js} +1 -1
- package/dist/3e4fdc5660f64b9c38e518be48b3b57e.js +1 -0
- package/dist/{531e426da5d4c152efe1e9522991e466.js → 3eefbe1c009cfd730b2ca6f834367c45.js} +1 -1
- package/dist/3f896944a97f002f2146e028ff2eac63.js +1 -0
- package/dist/410829a762fbac1d1f3ceed934518248.js +1 -0
- package/dist/41ae585cdbb9c2e8eefff5d30193029f.js +1 -0
- package/dist/41e8a86a20df71cb48a373b096c06cd1.js +1 -0
- package/dist/429.js +1 -0
- package/dist/429.js.map +1 -0
- package/dist/{6416bde11154c29c4e296eb82fed0bdf.js → 42e0ea6351d45d342caab13cb12f9ea4.js} +1 -1
- package/dist/431.js +1 -0
- package/dist/431.js.map +1 -0
- package/dist/432a5982ba3ddf958381d780e1e9a8e2.js +1 -0
- package/dist/44efcea2f84e80cc4092a89796afe886.js +1 -0
- package/dist/460.js +1 -0
- package/dist/460.js.map +1 -0
- package/dist/46ed21c8fbddeefacaf10d78887aa22a.js +1 -0
- package/dist/4821925a3d30a9b2e980aa74d0869ab0.js +1 -0
- package/dist/{1d633c2bf495c2c286fe37d00950e1d4.js → 4bee3a46b8378a7b4ef84492f08abd22.js} +1 -1
- package/dist/4c1bdecbedd36a5765de184ac056822a.js +1 -0
- package/dist/4f03709d8b1d52a622f0676f7a299510.js +1 -0
- package/dist/4f683c6881e9f8740f5516a85b9eb9da.js +1 -0
- package/dist/505.js +1 -0
- package/dist/505.js.map +1 -0
- package/dist/{8f8ce96f0f6ce8d8a30d5f2dcb4eca76.js → 5106411f7468a5ee5b1ee77aed12c0c7.js} +1 -1
- package/dist/512.js +1 -0
- package/dist/5398e3b596fa15df4d84b2aa0464e5c4.js +1 -0
- package/dist/{294.js → 540.js} +2 -2
- package/dist/540.js.map +1 -0
- package/dist/55.js +1 -0
- package/dist/{f5d50af31e924b65e3bd3764e8d1df3a.js → 57e14488b13e50ebdb5fdfc7880da683.js} +1 -1
- package/dist/{4b75999ea99d719689337def2fab50a3.js → 5a741aab715866cb4d9a55e89dfc8420.js} +1 -1
- package/dist/5a8ead0357e5029a2518959423dc29f3.js +1 -0
- package/dist/5ce650c06c385f9d15621e54c60457c0.js +1 -0
- package/dist/{49c44a682cc7627c4a2e8b4d1cfec022.js → 5cebfc2c3495b6294dcb2a99e5174872.js} +1 -1
- package/dist/{949a350e1d9f92839865e927eb00673f.js → 5d312b184c1f4565f51247d3c6dbba90.js} +1 -1
- package/dist/601.js +1 -0
- package/dist/601.js.map +1 -0
- package/dist/604.js +2 -0
- package/dist/604.js.LICENSE.txt +24 -0
- package/dist/604.js.map +1 -0
- package/dist/60d2bacc2e51eabc2bb0afa982fffb56.js +1 -0
- package/dist/{6707296f86034ccf2225ce3c27370114.js → 622e27eec5f26148f51ccc30315a3deb.js} +1 -1
- package/dist/{d492c085b5834c819ba21542b9147966.js → 6250c7594cd66ca91184b5beca293e06.js} +1 -1
- package/dist/{45873024a393c691246898090c972cd3.js → 6490772da5aecc6cb9e4c625abc74a96.js} +1 -1
- package/dist/{319.js → 652.js} +1 -1
- package/dist/656927386f77b2620f35af391f59d5ab.js +1 -0
- package/dist/65abcd8e99a385bcd8f1776f160040a9.js +1 -0
- package/dist/{2091e4c01015d7dda392116f3ae59801.js → 678f5201c1917429f334b88078ca4174.js} +1 -1
- package/dist/6821c1c5fb7909037ea68afc9ac6fa84.js +1 -0
- package/dist/685191c4f96bd2812757400e95ea7cbb.js +1 -0
- package/dist/6a0c82e8d455351e74687b23d41140fa.js +1 -0
- package/dist/6a1c347ab79a93f3ac01b08c8ccfc827.js +1 -0
- package/dist/{116d29a13f16f0a9bf9c25eaa2186c24.js → 6a851f05f1f4a974e02fe23eac2bad4e.js} +1 -1
- package/dist/{8a70eec5a46e423328f1e9d7d1a87f41.js → 6b4b87a54f673cfbb82be45329441bef.js} +1 -1
- package/dist/{002a2ac7b7d3b3b807ddcb210cfc91eb.js → 6bed1b724e74e6bc80688f42bc824d70.js} +1 -1
- package/dist/6c6d192b6860b4508a14c2d04769a35e.js +1 -0
- package/dist/6cf2d62a423414bc2d1c7db6405601a5.js +1 -0
- package/dist/6e40b726d91e9138d9eaef6fd012c740.js +1 -0
- package/dist/70efbabef77fb217f904f41dbf7fe8bf.js +1 -0
- package/dist/{b491027881efabe4493ad65daf3368de.js → 7222998c10fabd9c824cf8cf540b3b74.js} +1 -1
- package/dist/{277128dcbc226dfeb8fde9391fb24787.js → 7259bceba25ac1476fc775122a63d249.js} +1 -1
- package/dist/73af2faad0625104d52ff830ef9ea61e.js +1 -0
- package/dist/765a108d65257b76846cf458e46f9bde.js +1 -0
- package/dist/771acd16f7d805828ef10804b038d470.js +1 -0
- package/dist/786.js +8 -0
- package/dist/{166.js.LICENSE.txt → 786.js.LICENSE.txt} +1 -41
- package/dist/786.js.map +1 -0
- package/dist/789.js +1 -0
- package/dist/789.js.map +1 -0
- package/dist/{4150db3307181a1afef55ab2c9ec191e.js → 79241f85b016a7332f85bb66667459c2.js} +1 -1
- package/dist/79455ab9a6cd507f5314141cc965093a.js +1 -0
- package/dist/7b839a5c1f6d89538928c8a29003bbda.js +1 -0
- package/dist/7c488184a1ff274206e8af2c3aeeb2f6.js +1 -0
- package/dist/7c9558a304e8b3331e33a67900720578.js +1 -0
- package/dist/7e7131507a20f96834597eb2de3e880a.js +1 -0
- package/dist/7f007f3f67d9c856e727cec1369f8cba.js +1 -0
- package/dist/{0e693b29bbe881d5b78f15fb9cacbedd.js → 81318a3530fb35d5178eb7a4a13a606f.js} +1 -1
- package/dist/82402c7ad9d114a6d457b8e85733166c.js +1 -0
- package/dist/82c607cd84abbd9d103d44eb63a17380.js +1 -0
- package/dist/835.js +1 -0
- package/dist/835.js.map +1 -0
- package/dist/852.js +1 -0
- package/dist/852.js.map +1 -0
- package/dist/880ae94877022f7fb0458ced0825eb4c.js +1 -0
- package/dist/88730abfeb4a23e692ac7933882f12eb.js +1 -0
- package/dist/{4b73278b511eebb4d0f44a0eec778327.js → 8a5127228870aafabfff6111d29313d6.js} +1 -1
- package/dist/8b5a7ea56e555f0646ff1ec04e2f2ec8.js +1 -0
- package/dist/8b8336037f074d9dcbd20eab535b803f.js +1 -0
- package/dist/{4816d92f4fbed14925ed1946f4135365.js → 8c7616f0adba6a5ac0d2f06ba4ebd696.js} +1 -1
- package/dist/8cf654fbb341b296e1ca1ea64665d2fe.js +1 -0
- package/dist/{0d419aec4c7e2317238c3502a967b560.js → 8ed5aba33ead1f94e97d5c35a5e93434.js} +1 -1
- package/dist/8f3d1d788bae00d28b3f3faa4e0dc8e7.js +1 -0
- package/dist/{ebaed1b3f483c7391037315a62571718.js → 8f9ce72eeabbf31f2d51f4bcfc66d3b0.js} +1 -1
- package/dist/9.js +1 -0
- package/dist/9.js.map +1 -0
- package/dist/90aa502abf90516fba58e6c0e3025808.js +1 -0
- package/dist/{3afb97252c417c5f0dd54e20b1954f63.js → 90f3dc3c18d447104b63c156cb7fddb5.js} +1 -1
- package/dist/91.js +1 -0
- package/dist/91.js.map +1 -0
- package/dist/916.js +1 -0
- package/dist/916.js.map +1 -0
- package/dist/{796a2d1a925ed311f35e5fc5907a3132.js → 91beb08737a1bbf071f351fb0acdbf3c.js} +1 -1
- package/dist/91e35c5eaf4724ba88de11bc0443a5c2.js +1 -0
- package/dist/{50.js → 92.js} +1 -1
- package/dist/933650e44addcb70f81e845ce4186e4d.js +1 -0
- package/dist/947d538f92dd1e146e4a3c41e4eacb92.js +1 -0
- package/dist/{08d12eee2127dc573b757f69752c6704.js → 950a205e91da7e78226dd785fd6d34db.js} +1 -1
- package/dist/953c932d71a79a72673405ec103b5739.js +1 -0
- package/dist/961.js +2 -0
- package/dist/961.js.map +1 -0
- package/dist/963.js +1 -0
- package/dist/963.js.map +1 -0
- package/dist/979.js +1 -1
- package/dist/979.js.map +1 -0
- package/dist/{7abc8b6c17be848321a446cfd88c27a9.js → 983fccb9f00748c487e889f6c83aa367.js} +1 -1
- package/dist/99.js +1 -0
- package/dist/{c97c8951af9153f36715121ab359334c.js → 9920e03a65566d728a73c7bf18bc5741.js} +1 -1
- package/dist/9aa63705c26b041214124ae3f90b0b74.js +1 -0
- package/dist/{9d29de85381ba75c190573ea82708954.js → 9b4de1346c73ba258736f1a3f00fdc14.js} +1 -1
- package/dist/{a6b8f5b8c9ce7808c5ca6baccdf1ad1e.js → 9b9578869f378f8e2afbf85a76c0ac72.js} +1 -1
- package/dist/9ce31ae06cd4113ea5527eb5bf4b0fbf.js +1 -0
- package/dist/9d5bba46df7fb1577fec6cb90f1bb2a7.js +1 -0
- package/dist/9ebb9ac2c9c875649c72722bc585d445.js +1 -0
- package/dist/{df350f726187b69bcededaaed6cf5f31.js → a0e32ba94aa4384823d768802b9486e1.js} +1 -1
- package/dist/a1bb5b3f6078f04941c00f87171dc0ae.js +1 -0
- package/dist/{6327ff8d569aa463a91e5ea774d1980e.js → a223748cd69094dd12b486353b22f479.js} +1 -1
- package/dist/a352be446de3ea29cb0609bb5336b030.js +1 -0
- package/dist/a3a941911290b143d26ceb5e776e1d18.js +1 -0
- package/dist/a3dfa410d90c00078f4b015410048f34.js +1 -0
- package/dist/a41ce517e26d17d855b7224af9ee433b.js +1 -0
- package/dist/a496f663a8cf2dc047e12d8a80d76510.js +1 -0
- package/dist/{8db9f93698f3eea94f936fcb5986f1a3.js → a4d0588d199cb1afffb42e57ea40fa86.js} +1 -1
- package/dist/{ac0681e93739efad9b6f1b85453d6a1b.js → a52f9ac0e3d582ed7e488aa1dfc33eda.js} +1 -1
- package/dist/a569591af2f834ec4b58f43ab7742186.js +1 -0
- package/dist/a6eb87af5cd7ae7e4fcba8ec606ec4ba.js +1 -0
- package/dist/{19df93bf1797b4caf8232cc4b544f865.js → a83211eadd86ef80416334e72774ab11.js} +1 -1
- package/dist/a8c8aa148991e4ca35ed78cd5ccfcc03.js +1 -0
- package/dist/{4123d5ea3e1f99dd3a5f2a89e16c6e59.js → ab0128ab12bcb8729032421b40f5f8dd.js} +1 -1
- package/dist/abaf3295e910c34eae208dfe0fc514b1.js +1 -0
- package/dist/ac75eee083810ee8d0ea57f03a5416bc.js +1 -0
- package/dist/af1635b600efd13f6059eb6ac9deae12.js +1 -0
- package/dist/af6fdb556ee3f9065578bb01f81f6216.js +1 -0
- package/dist/{5b2b9bc695bfdee92665388010a7e74d.js → b10accbff47791a59b8494225af07025.js} +1 -1
- package/dist/b13d991d1e4a016abea3fe5837261690.js +1 -0
- package/dist/b2d48e239f15fa4f535eb38d363dc1f1.js +1 -0
- package/dist/b3f1431b9e6d9e6632a93c2cd89f945b.js +1 -0
- package/dist/{3a3b2fef963d6c2c49c5b11b74a9ea81.js → b953ce2f19e7291598cd9c05128133c1.js} +1 -1
- package/dist/bb1365c0983ce5ad50060b24788b9630.js +1 -0
- package/dist/{2772fa250d538d9b7a8702fb6c50d195.js → bd309bb3f23f2bfbcf914f2e71474ab5.js} +1 -1
- package/dist/{32f291b1164c2610ed1a9260677d15f0.js → be75b76e74c78535966ec8aaa7d46bec.js} +1 -1
- package/dist/{ad88ef07c8c702b1a5f1e3d19c1052c7.js → c1a1f4ba29aa2d9a0b1a1abe5cfee0c6.js} +1 -1
- package/dist/c2fa476995041f9982b89a1c483da2b9.js +1 -0
- package/dist/c3832579be376308fa819b04e7b0c66f.js +1 -0
- package/dist/c4c991b8f5eb242f1e220e5f568fdfbc.js +1 -0
- package/dist/c60efc342d7da27d9a6cf60fbec6f9ce.js +1 -0
- package/dist/c8acc93023012737a3bf8fb767b66838.js +1 -0
- package/dist/{acb898eefa176c3f28344f5780cceb63.js → cb4bb785934eeca9b408e892ae6b73b7.js} +1 -1
- package/dist/{6257c20a623b032171b358cc95a1adab.js → cb5746e29527a2fdb9f857a121e086ed.js} +1 -1
- package/dist/cb622c2d49403c3f56e333bc41a9b89c.js +1 -0
- package/dist/{78b1ba82f7882d931072c4ef6e87f579.js → cc65d108f0e7cfb200de1d0bcf115005.js} +1 -1
- package/dist/cc715c90d57b30965fc297a12746d6b5.js +1 -0
- package/dist/cedeeab4daadcc470520da9661b1d78b.js +1 -0
- package/dist/{0d8cca845a71e82acc3ffc1fc95c94f3.js → cf909ad6e321c2f98750f5c3581556f8.js} +1 -1
- package/dist/d0415105402964718010284fcfa8b2ea.js +1 -0
- package/dist/d09463c099fb2c44719380623a5c68fb.js +1 -0
- package/dist/d1907231dc06c32481fefd6d47da973b.js +1 -0
- package/dist/d4b890206d2316955676dd69ef0f2779.js +1 -0
- package/dist/{700530bc418f23dccca7db36bfa9f745.js → d4f5981ee5a73d8a6e19112f2ffcb72c.js} +1 -1
- package/dist/d7340300249ab98bd9b3f538a767106e.js +1 -0
- package/dist/d76046afaf4d32b0f0afb63b4fabc680.js +1 -0
- package/dist/d85853bab3b213652aee023adecfb690.js +1 -0
- package/dist/{d3c6f63283deafb27231ec767a161534.js → da740c1b29a85b999a6874b59a1baeef.js} +1 -1
- package/dist/dc83a73f0eb89665520bbb6672dfa3cb.js +1 -0
- package/dist/{3d7fd940e543a183c4c376ef0d65773a.js → dc932cde2fbfca8e2901fb693968b131.js} +1 -1
- package/dist/de73b4d2a9ed4bcb851f9141e303636d.js +1 -0
- package/dist/e00b330413304d60c26e164da7f9fe0c.js +1 -0
- package/dist/e63fce237243190962fcc3b12b387e1b.js +1 -0
- package/dist/e7996a1f4aed878b8486d55f411b65cb.js +1 -0
- package/dist/e80d5ee40455d0675f8f2a3688071adf.js +1 -0
- package/dist/e9382a0e67b22188c75e9418de1c9295.js +1 -0
- package/dist/{4dec4bb457555975c148226534ecbdbe.js → eb0b62e1895dcf7491419aa728f00c38.js} +1 -1
- package/dist/eb925c23b7c7a9d047f8722f46e20950.js +1 -0
- package/dist/ebd0bd68d479ea224a6f962d1667219d.js +1 -0
- package/dist/ec7b3f184238605a5239da7559e6cff9.js +1 -0
- package/dist/ec901efce9bc8572f27155236a447e62.js +1 -0
- package/dist/ecff3d4bbf59ef41230960af46098e74.js +1 -0
- package/dist/{53e2fb3b82eafad81897aab9ab79edff.js → ee41eb1fd1d1c87c45e818b5a8a65cf8.js} +1 -1
- package/dist/{f6a1ff9a83e32555a4e3c7b99727e02d.js → ee5d36473f84db2af26d82efd69a38ec.js} +1 -1
- package/dist/ef01988390cb38f64b1969c775015c57.js +1 -0
- package/dist/f01129e1dfd56aa58d31a328b3c5fddb.js +1 -0
- package/dist/f15362a7feef894b2e7f706252e6c510.js +1 -0
- package/dist/{92164e5d714ab4cda2b91eede29bc191.js → f15cbf0d23cba4a313f3f2acfef5370c.js} +1 -1
- package/dist/f4a8f4192f6aeda7f17280c974c9eea7.js +1 -0
- package/dist/f52f3abc162b2643e0c43f6c15a95745.js +1 -0
- package/dist/f6b33aded7ae7504bfcc4550925cccb0.js +1 -0
- package/dist/fb393a7455b47f3d4fc30cf219d5145c.js +1 -0
- package/dist/fb5080213f065f82f0391c551c864434.js +1 -0
- package/dist/fc15e67c3e8e51dd8ccc9c3df78c9738.js +1 -0
- package/dist/fc1dd74e1ec7e59d6d458e2a956d7f26.js +1 -0
- package/dist/fd01cb7c2dce608bfa89475751ac6f1b.js +1 -0
- package/dist/{356c61041d30223f74711e79c8bb8ae9.js → fd3859a700b456e06c65c0cf6b0af05c.js} +1 -1
- package/dist/fd4b01ad8a8261d4583e3b24b8b388b9.js +1 -0
- package/dist/fd98f0e48b18e1de428edd5174539c2a.js +1 -0
- package/dist/{5fc5b7fdc1899b18bee20c7905c76182.js → fe9499c0a5444f7f42843fa00fb355cb.js} +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-form-builder-app.js +1 -1
- package/dist/openmrs-esm-form-builder-app.js.buildmanifest.json +867 -529
- package/dist/openmrs-esm-form-builder-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +42 -37
- package/src/components/action-buttons/action-buttons.component.tsx +41 -61
- package/src/components/action-buttons/action-buttons.scss +5 -0
- package/src/components/action-buttons/unpublish-form.modal.tsx +45 -0
- package/src/components/dashboard/dashboard.component.tsx +37 -70
- package/src/components/dashboard/dashboard.scss +5 -0
- package/src/components/dashboard/dashboard.test.tsx +14 -113
- package/src/components/dashboard/delete-form.modal.tsx +45 -0
- package/src/components/dashboard/delete-form.scss +9 -0
- package/src/components/form-editor/form-editor.component.tsx +185 -207
- package/src/components/form-editor/restore-draft-schema.modal.tsx +53 -0
- package/src/components/interactive-builder/{add-question-modal.component.tsx → add-question.modal.tsx} +236 -30
- package/src/components/interactive-builder/{delete-page-modal.component.tsx → delete-page.modal.tsx} +11 -18
- package/src/components/interactive-builder/{delete-question-modal.component.tsx → delete-question.modal.tsx} +39 -20
- package/src/components/interactive-builder/{delete-section-modal.component.tsx → delete-section.modal.tsx} +11 -13
- package/src/components/interactive-builder/draggable-question.component.tsx +44 -21
- package/src/components/interactive-builder/droppable-container.component.tsx +6 -6
- package/src/components/interactive-builder/droppable-container.scss +9 -0
- package/src/components/interactive-builder/edit-question.modal.tsx +858 -0
- package/src/components/interactive-builder/editable-value.scss +1 -1
- package/src/components/interactive-builder/interactive-builder.component.tsx +98 -183
- package/src/components/interactive-builder/{new-form-modal.component.tsx → new-form.modal.tsx} +8 -19
- package/src/components/interactive-builder/{page-modal.component.tsx → page.modal.tsx} +8 -9
- package/src/components/interactive-builder/question-modal.scss +3 -3
- package/src/components/interactive-builder/{section-modal.component.tsx → section.modal.tsx} +8 -18
- package/src/components/modals/save-form-modal.scss +4 -0
- package/src/components/modals/{save-form-modal.component.tsx → save-form.modal.tsx} +3 -3
- package/src/components/schema-editor/schema-editor.component.tsx +20 -23
- package/src/components/validation-info/validation-info.component.tsx +3 -1
- package/src/config-schema.ts +19 -0
- package/src/form-validator.resource.ts +77 -42
- package/src/forms.resource.ts +2 -2
- package/src/hooks/usePatientIdentifierLookup.ts +18 -0
- package/src/hooks/usePatientIdentifierName.ts +17 -0
- package/src/hooks/usePatientIdentifierTypes.ts +19 -0
- package/src/hooks/usePersonAttributeLookup.ts +18 -0
- package/src/hooks/usePersonAttributeName.ts +17 -0
- package/src/hooks/useProgramStates.ts +51 -0
- package/src/index.ts +46 -0
- package/src/routes.json +46 -0
- package/src/types.ts +35 -5
- package/dist/0.js +0 -1
- package/dist/0.js.map +0 -1
- package/dist/023545291c7d55eb893591da836fc73d.js +0 -1
- package/dist/03452373324e7ceaf58e3830eafd1a28.js +0 -1
- package/dist/039ae6f160cd9781bcbb003484e23cdc.js +0 -1
- package/dist/0ec8abb2e91cb079eed4605ea6851cb8.js +0 -1
- package/dist/1092154c23dcc20005a669b15497159f.js +0 -1
- package/dist/138.js +0 -1
- package/dist/151786e5421aae5a57d862be1387a079.js +0 -1
- package/dist/153.js +0 -1
- package/dist/153.js.map +0 -1
- package/dist/154e51d48e7dc7f244bf748e4deb64f9.js +0 -1
- package/dist/166.js +0 -8
- package/dist/166.js.map +0 -1
- package/dist/16b5146f5e9b7a1a196f6d11a6187282.js +0 -1
- package/dist/1ab96c77da77918d9160c787732c68a6.js +0 -1
- package/dist/1db8d65ab1ad8dbb0aae7b9ebe280ca7.js +0 -1
- package/dist/1ef4b371fd98f0144354e57bb89d7fa3.js +0 -1
- package/dist/1ff3e5ecc0f8d69a4611a7cd8337f0b2.js +0 -1
- package/dist/2184bcd361a0e38d249bc49439d994cb.js +0 -1
- package/dist/252b829e2dab81bc5a4c28d52f34edf5.js +0 -1
- package/dist/275b72e6e6256f50527832ba14ec291e.js +0 -1
- package/dist/2765855f04cd6d7fb7fcf0a81c1e2022.js +0 -1
- package/dist/294.js.map +0 -1
- package/dist/2e2f30806fe3accb9b340fb082a1494e.js +0 -1
- package/dist/3053f55c4697117c4c2cd156803b3155.js +0 -1
- package/dist/3063479c31202a0d1ecf707b2a4ce742.js +0 -1
- package/dist/3564e45dfb2ed064007f910db434889f.js +0 -1
- package/dist/397e6669a1d15065bd742d20079d6a95.js +0 -1
- package/dist/3aa8f5e8ff182ed46cb6570dad4c4eee.js +0 -1
- package/dist/3b8b51248b6aa0474a02a6c352d1caa1.js +0 -1
- package/dist/3bd6e7a72c8b16825ce3a83b17bd681e.js +0 -1
- package/dist/3bfb519dbb980d6d8fee1bf543dfc5ae.js +0 -1
- package/dist/3c1857a15493f62c5c85c13007a6c32c.js +0 -1
- package/dist/3db12a05792313b3c537e3256f5e2e93.js +0 -1
- package/dist/3fa11e77942b4cf2c50e845525ae5a9f.js +0 -1
- package/dist/3fe09c1c283d4a26d228f37a77a018b2.js +0 -1
- package/dist/438ed06fb7f9516b12edaf7411c832b0.js +0 -1
- package/dist/447.js +0 -1
- package/dist/4686855c499be892779f614770ec2cf7.js +0 -1
- package/dist/46f088332f17d2ea452bd0ef7a5cdbc6.js +0 -1
- package/dist/474c86d7a4a0fa50030c6503fdb52392.js +0 -1
- package/dist/489b22b946f5972fed0daab6ef587c60.js +0 -1
- package/dist/494ca3291c219565bfb6e45f8eb8c583.js +0 -1
- package/dist/49c58e614c06572ffbabe974a7fda21c.js +0 -1
- package/dist/4afde8c89469302b064e693fa77035f6.js +0 -1
- package/dist/4f5c3cb0b76fa2978539d8b64a71537d.js +0 -1
- package/dist/4f89e8c1a691faf5f1bfe3987ddf108a.js +0 -1
- package/dist/50bd9a652785963a5d7d24bda4dee4ca.js +0 -1
- package/dist/52c9726f9e52ed3a57c0634718366029.js +0 -1
- package/dist/52ee9d28ed4c3389951a46084343a993.js +0 -1
- package/dist/54a7b0b5248e428a4a703329f36e286f.js +0 -1
- package/dist/574.js +0 -1
- package/dist/583d06a5b9251de455ebd89550449842.js +0 -1
- package/dist/5aedf04cf240c6c43540081c3bf9573e.js +0 -1
- package/dist/5d833ca045603c1105d2db3b9d931274.js +0 -1
- package/dist/62.js +0 -1
- package/dist/62.js.map +0 -1
- package/dist/626.js +0 -1
- package/dist/626.js.map +0 -1
- package/dist/6365d65802807679247605c8df7ea9ec.js +0 -1
- package/dist/645.js +0 -2
- package/dist/645.js.LICENSE.txt +0 -30
- package/dist/645.js.map +0 -1
- package/dist/645b74a0625033669c9d0440b32e3fd0.js +0 -1
- package/dist/66713913fc89a3bcad5d7804c03dcb43.js +0 -1
- package/dist/677b2b5d0c9507508a831e4b67d61c6e.js +0 -1
- package/dist/686915e134683f72ea5f3c227a6f13be.js +0 -1
- package/dist/69ec362e03850ff2d49044acbb19b385.js +0 -1
- package/dist/6aa13e92b5cf7d479e73acdc7c05abf3.js +0 -1
- package/dist/6b07bdedc12700f257d08813b3c0887f.js +0 -1
- package/dist/6bbbe63c75c85941f855ab27fb5f36db.js +0 -1
- package/dist/6f77d1c97d1c6937d21c4a1034be62b6.js +0 -1
- package/dist/70e2f052e416e2611ded0f57ed53f18a.js +0 -1
- package/dist/727e2cbdf695b3abfe88917062d16a5f.js +0 -1
- package/dist/7620537538da40e17ccbf70a43f4fd0c.js +0 -1
- package/dist/77c629df0ebf40b066d0ffeb34b7711b.js +0 -1
- package/dist/788.js +0 -1
- package/dist/7cc98960277ab04470e3ff9ed5fc6028.js +0 -1
- package/dist/800.js +0 -2
- package/dist/800.js.map +0 -1
- package/dist/8211ff24c6eb59feeb74cf3ae60e4e5d.js +0 -1
- package/dist/833.js +0 -1
- package/dist/83e2ed887ee6426c8e0aa4d976b76720.js +0 -1
- package/dist/844.js +0 -1
- package/dist/844.js.map +0 -1
- package/dist/8cfffdd2f772eec8342fdfc4d511e0cc.js +0 -1
- package/dist/8efee5c45bbfdd52eec7a8a0eec72ec3.js +0 -1
- package/dist/919edf70e532c72ecd4b9579c1879bc2.js +0 -1
- package/dist/9296988a753e8e251ff627aef2c929e8.js +0 -1
- package/dist/935.js +0 -2
- package/dist/935.js.map +0 -1
- package/dist/938b32f75aefeab50ba608132c5862c8.js +0 -1
- package/dist/93be766c753e075a3f7d5b89b3ee04ce.js +0 -1
- package/dist/945ea249c1f1d3595cc55a51046d9032.js +0 -1
- package/dist/96efd2775defcf3611fe9a07ed29065f.js +0 -1
- package/dist/979239ac9b74c2c57dcc2b66e7e3b353.js +0 -1
- package/dist/996d24547b492c3140f64d51f5229f3c.js +0 -1
- package/dist/99e45b7d238576aa6d4c830bd8715356.js +0 -1
- package/dist/9b3441051d8551264ac58b36253b9b10.js +0 -1
- package/dist/a13fa501edcc6c9712061e0ca5fd400e.js +0 -1
- package/dist/a58f90f6c8db84024327b4d9059c991e.js +0 -1
- package/dist/a9ed61bdf8ae777e7a6f68bf7175e839.js +0 -1
- package/dist/aa6c0d1a7dfd344894b8eba8db42ad04.js +0 -1
- package/dist/ab3d46f8dd12e29e10eb35c5e406bbcb.js +0 -1
- package/dist/b35c9a9d72f02feae440dd385a020ef6.js +0 -1
- package/dist/b49ae09a10a2a2d6dfc7ba9cb37cbbb3.js +0 -1
- package/dist/b76ff0f203825dcdefb649d98de32f5b.js +0 -1
- package/dist/bba393726b199f66d8b4314385c1f2f0.js +0 -1
- package/dist/c2fb2aaf17fa23ca4b9bf7f1c1441caa.js +0 -1
- package/dist/c4ee489cb1eb39f3d31e99fcc78e886e.js +0 -1
- package/dist/c92169023ff93e3c3e03bc2f4c73615a.js +0 -1
- package/dist/cbf021d377207ecc00145a138fd03f0f.js +0 -1
- package/dist/cd1309ef590ed94ac5735c4c667e6549.js +0 -1
- package/dist/cd88309c904c403022c51d1fa3ee4bf3.js +0 -1
- package/dist/d1f0ad8ca2a550bc292669b06a614f79.js +0 -1
- package/dist/d3a6de3a3eae748464b9d49001eba546.js +0 -1
- package/dist/d723acafb30584c955c9aeaedb3e03f0.js +0 -1
- package/dist/d72f9e2d15bf7a51a613e2f116b1a2df.js +0 -1
- package/dist/d8f7ecdd496f3caf14f5afbedfff1937.js +0 -1
- package/dist/daad7cddd8afb1713b51cf5882d2da34.js +0 -1
- package/dist/e0564e4f4ec3f3165b6890be52cf9a5e.js +0 -1
- package/dist/e06608fe5b8e7e9d30879d4d91113a08.js +0 -1
- package/dist/e0d8e58814f40cb5f60e1fe5fb37e9fa.js +0 -1
- package/dist/e13fc7d468ab9b5797f2a44412ca2f00.js +0 -1
- package/dist/e430b621361ebe3a4071e3cca1d0dbe8.js +0 -1
- package/dist/e45a0dfd102b67ad7cdefe10500bf0d7.js +0 -1
- package/dist/e542ddbb78bb244c0465f22e0e11ab61.js +0 -1
- package/dist/efbb5510bc35424b261de45355e3a626.js +0 -1
- package/dist/f2abbd0caa62a607a87be62111595f0c.js +0 -1
- package/dist/f3a21a0f236d2b7d45be954c32efaa14.js +0 -1
- package/dist/f5dfa3d3658fddbce84d7c3ecd5504f0.js +0 -1
- package/dist/f8ee12a5cfa6ff1d3550ef30a238d89a.js +0 -1
- package/dist/f93c341314b490174cf67fed1ca62ee0.js +0 -1
- package/dist/faa809ba713143a2e8b4760a45e1fe89.js +0 -1
- package/dist/ffb6d262efb0718a20d60b5fecb76ea6.js +0 -1
- package/src/components/interactive-builder/edit-question-modal.component.tsx +0 -543
- /package/dist/{55a1830305eaf8f525aad4c04c138483.js → 0e67325b9a04863301e36c0c37947069.js} +0 -0
- /package/dist/{2611b2dc99534665bf6734ddfa6b8de4.js → 1383530217ac0068c844902d24e18e08.js} +0 -0
- /package/dist/{ff9176b28afa428194276840d85679ef.js → 16c2e1b50af4ba05edaa03c8c9e9d18c.js} +0 -0
- /package/dist/{5f8e9f09349e37425d6ef96bf1bf7a2d.js → 1cc6fc3772824e2f87f10a9c3fad2dae.js} +0 -0
- /package/dist/{392e4c8d74cb1c9267a14eb0270ba2d6.js → 210aec2722e6416a0349a987260e14a3.js} +0 -0
- /package/dist/{71f39fefd16025c224fe31cdb352ae01.js → 228ca80abf1ae030cbfe7faaec61913f.js} +0 -0
- /package/dist/{0c1e757d25446799bcab87a8607dee60.js → 24f97ddd76026815674affbc50ad6169.js} +0 -0
- /package/dist/{800.js.LICENSE.txt → 29.js.LICENSE.txt} +0 -0
- /package/dist/{250c230f9465d8affc02c67d41d7e067.js → 31c610efb1d25afc90853b52ba4cb089.js} +0 -0
- /package/dist/{c3174a46927bbec0fbd8946f97bd7170.js → 44599d9b6202ebebfcdd073edf3562e3.js} +0 -0
- /package/dist/{b8cb123e6c753c6031ab9c6a4acbbcd6.js → 472ba8f81bf8cac86027cb1be4e3b9cd.js} +0 -0
- /package/dist/{a72ec8ab4a5bdfd6695dfa5fa86ef30d.js → 5348f3cfbe5a63954e7d984f197bbddb.js} +0 -0
- /package/dist/{294.js.LICENSE.txt → 540.js.LICENSE.txt} +0 -0
- /package/dist/{cd29b6e52c3ebcbaee8c7bb709fd1d8e.js → 5f5a93ab1249b7cbdb13d9466febd3a0.js} +0 -0
- /package/dist/{951a8cbe4efaab1b1451ffd8904fc9dd.js → 60190285b6c2243e14184b9e57d48dbb.js} +0 -0
- /package/dist/{aefed4953ced506e20b934606ac083f3.js → 60ede8d7ffdf4c05f2ce51b6d8d2be68.js} +0 -0
- /package/dist/{8de1f09307a99c5a8bb0a53d32fbaaa9.js → 65e7cf62ca9df32c18b630f31025a401.js} +0 -0
- /package/dist/{02b97d3c4a7e895228beec69fb63e420.js → 817edb0c6f9d66f9c0027762edb1d797.js} +0 -0
- /package/dist/{b943c561d9e064f79f938275bad6e597.js → 84270e22d4439d15b0d8f392d1338d8e.js} +0 -0
- /package/dist/{41469950e6a0ef73a57342235b44c55a.js → 90812d89181b698975cbb081adcbbcb0.js} +0 -0
- /package/dist/{935.js.LICENSE.txt → 961.js.LICENSE.txt} +0 -0
- /package/dist/{f59696ab0f6f26c339d7e6bb1d73a5c3.js → 96b8d8b5efd11741639659c63a485c27.js} +0 -0
- /package/dist/{410ecb602443afbd5908a14f39b40eb2.js → 981bd23edacd811f9e4a583d89b544ee.js} +0 -0
- /package/dist/{ac12519ccf3cc323b28f70e35f922e3f.js → afba1f28f2baa29eae717d6cb03f5464.js} +0 -0
- /package/dist/{73cdbb2580cd6a02d989c86e56bb83f3.js → c8230f96396f0378d032dce2be3dce66.js} +0 -0
- /package/dist/{6231f0100394f756aac18e8d972d8f2b.js → cb0d121a88477f943960f5ad60602c22.js} +0 -0
- /package/dist/{19017707f34649cae551ee9d5ea1edbf.js → cb9910e014b468ada91393696fcad206.js} +0 -0
- /package/dist/{da3a9dc1f8b62f2221f1040e8d207d0e.js → e37ac12436bcd0536ec98ae8470a1228.js} +0 -0
- /package/dist/{2adc6bc4a8a2bf35636e8fc7fe0df2dd.js → e7f37e0f2b6113039c45a326264c4d36.js} +0 -0
- /package/dist/{cfe1a9dd61dd943a574fc6c7157372f7.js → f666b5647087bcfdf6623f8b14d56657.js} +0 -0
|
@@ -0,0 +1,858 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import debounce from 'lodash-es/debounce';
|
|
4
|
+
import flattenDeep from 'lodash-es/flattenDeep';
|
|
5
|
+
import {
|
|
6
|
+
Button,
|
|
7
|
+
ComboBox,
|
|
8
|
+
Form,
|
|
9
|
+
FormLabel,
|
|
10
|
+
InlineLoading,
|
|
11
|
+
InlineNotification,
|
|
12
|
+
Layer,
|
|
13
|
+
ModalBody,
|
|
14
|
+
ModalFooter,
|
|
15
|
+
ModalHeader,
|
|
16
|
+
MultiSelect,
|
|
17
|
+
RadioButton,
|
|
18
|
+
RadioButtonGroup,
|
|
19
|
+
Search,
|
|
20
|
+
Select,
|
|
21
|
+
SelectItem,
|
|
22
|
+
SelectSkeleton,
|
|
23
|
+
Stack,
|
|
24
|
+
Tag,
|
|
25
|
+
TextInput,
|
|
26
|
+
Tile,
|
|
27
|
+
} from '@carbon/react';
|
|
28
|
+
import { ArrowUpRight } from '@carbon/react/icons';
|
|
29
|
+
import { showSnackbar, useConfig } from '@openmrs/esm-framework';
|
|
30
|
+
import type { ProgramState, RenderType } from '@openmrs/openmrs-form-engine-lib';
|
|
31
|
+
|
|
32
|
+
import type { ConfigObject } from '../../config-schema';
|
|
33
|
+
import type {
|
|
34
|
+
Concept,
|
|
35
|
+
ConceptMapping,
|
|
36
|
+
PatientIdentifierType,
|
|
37
|
+
PersonAttributeType,
|
|
38
|
+
Program,
|
|
39
|
+
ProgramWorkflow,
|
|
40
|
+
Question,
|
|
41
|
+
QuestionType,
|
|
42
|
+
Schema,
|
|
43
|
+
} from '../../types';
|
|
44
|
+
import { useConceptLookup } from '../../hooks/useConceptLookup';
|
|
45
|
+
import { useConceptName } from '../../hooks/useConceptName';
|
|
46
|
+
import { usePatientIdentifierLookup } from '../../hooks/usePatientIdentifierLookup';
|
|
47
|
+
import { usePatientIdentifierName } from '../../hooks/usePatientIdentifierName';
|
|
48
|
+
import { usePatientIdentifierTypes } from '../../hooks/usePatientIdentifierTypes';
|
|
49
|
+
import { usePersonAttributeLookup } from '../../hooks/usePersonAttributeLookup';
|
|
50
|
+
import { usePersonAttributeName } from '../../hooks/usePersonAttributeName';
|
|
51
|
+
import { usePersonAttributeTypes } from '../../hooks/usePersonAttributeTypes';
|
|
52
|
+
import { usePrograms, useProgramWorkStates } from '../../hooks/useProgramStates';
|
|
53
|
+
import styles from './question-modal.scss';
|
|
54
|
+
|
|
55
|
+
interface EditQuestionModalProps {
|
|
56
|
+
closeModal: () => void;
|
|
57
|
+
onSchemaChange: (schema: Schema) => void;
|
|
58
|
+
pageIndex: number;
|
|
59
|
+
questionIndex: number;
|
|
60
|
+
questionToEdit: Question;
|
|
61
|
+
schema: Schema;
|
|
62
|
+
sectionIndex: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface Item {
|
|
66
|
+
id: string;
|
|
67
|
+
text: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface ProgramStateData {
|
|
71
|
+
selectedItems: Array<ProgramState>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const DatePickerType = {
|
|
75
|
+
both: 'both',
|
|
76
|
+
calendar: 'calendar',
|
|
77
|
+
timer: 'timer',
|
|
78
|
+
} as const;
|
|
79
|
+
|
|
80
|
+
type DatePickerTypeValue = (typeof DatePickerType)[keyof typeof DatePickerType];
|
|
81
|
+
|
|
82
|
+
const EditQuestionModal: React.FC<EditQuestionModalProps> = ({
|
|
83
|
+
closeModal,
|
|
84
|
+
onSchemaChange,
|
|
85
|
+
pageIndex,
|
|
86
|
+
questionIndex,
|
|
87
|
+
questionToEdit,
|
|
88
|
+
schema,
|
|
89
|
+
sectionIndex,
|
|
90
|
+
}) => {
|
|
91
|
+
const { t } = useTranslation();
|
|
92
|
+
const { fieldTypes, questionTypes } = useConfig<ConfigObject>();
|
|
93
|
+
|
|
94
|
+
const [answersChanged, setAnswersChanged] = useState(false);
|
|
95
|
+
const [answersFromConcept, setAnswersFromConcept] = useState<
|
|
96
|
+
Array<{
|
|
97
|
+
concept: string;
|
|
98
|
+
label: string;
|
|
99
|
+
}>
|
|
100
|
+
>([]);
|
|
101
|
+
const [conceptMappings, setConceptMappings] = useState<Array<ConceptMapping> | undefined>(
|
|
102
|
+
questionToEdit.questionOptions.conceptMappings,
|
|
103
|
+
);
|
|
104
|
+
const [conceptToLookup, setConceptToLookup] = useState('');
|
|
105
|
+
const [personAttributeTypeToLookup, setPersonAttributeTypeToLookup] = useState('');
|
|
106
|
+
const [patientIdentifierTypeToLookup, setPatientIdentifierTypeToLookup] = useState('');
|
|
107
|
+
const [fieldType, setFieldType] = useState<RenderType | null>(null);
|
|
108
|
+
const [isQuestionRequired, setIsQuestionRequired] = useState(false);
|
|
109
|
+
const [max, setMax] = useState('');
|
|
110
|
+
const [min, setMin] = useState('');
|
|
111
|
+
const [questionId, setQuestionId] = useState('');
|
|
112
|
+
const [questionLabel, setQuestionLabel] = useState('');
|
|
113
|
+
const [questionType, setQuestionType] = useState<QuestionType | null>(null);
|
|
114
|
+
const [rows, setRows] = useState('');
|
|
115
|
+
const [selectedAnswers, setSelectedAnswers] = useState<
|
|
116
|
+
Array<{
|
|
117
|
+
id: string;
|
|
118
|
+
text: string;
|
|
119
|
+
}>
|
|
120
|
+
>([]);
|
|
121
|
+
const [selectedConcept, setSelectedConcept] = useState<Concept | null>(null);
|
|
122
|
+
|
|
123
|
+
const { concepts, isLoadingConcepts } = useConceptLookup(conceptToLookup);
|
|
124
|
+
const { conceptName, conceptNameLookupError, isLoadingConceptName } = useConceptName(
|
|
125
|
+
questionToEdit.questionOptions.concept,
|
|
126
|
+
);
|
|
127
|
+
const [datePickerFormat, setDatePickerFormat] = useState<(typeof DatePickerType)[DatePickerTypeValue]>(
|
|
128
|
+
DatePickerType.both,
|
|
129
|
+
);
|
|
130
|
+
const { patientIdentifierTypes } = usePatientIdentifierTypes();
|
|
131
|
+
const { personAttributeTypes } = usePersonAttributeTypes();
|
|
132
|
+
const { patientIdentifierType } = usePatientIdentifierLookup(patientIdentifierTypeToLookup);
|
|
133
|
+
const { personAttributeType } = usePersonAttributeLookup(personAttributeTypeToLookup);
|
|
134
|
+
const [selectedPatientIdentifierType, setSelectedPatientIdentifierType] = useState(patientIdentifierType);
|
|
135
|
+
const [selectedPersonAttributeType, setSelectedPersonAttributeType] = useState(personAttributeType);
|
|
136
|
+
const { patientIdentifierNameLookupError, isLoadingPatientidentifierName } = usePatientIdentifierName(
|
|
137
|
+
questionToEdit.questionOptions.identifierType,
|
|
138
|
+
);
|
|
139
|
+
const { personAttributeNameLookupError, isLoadingPersonAttributeName } = usePersonAttributeName(
|
|
140
|
+
questionToEdit.questionOptions.attributeType,
|
|
141
|
+
);
|
|
142
|
+
const [addObsComment, setAddObsComment] = useState(false);
|
|
143
|
+
const [selectedProgramState, setSelectedProgramState] = useState<Array<ProgramState>>([]);
|
|
144
|
+
const [selectedProgram, setSelectedProgram] = useState<Program>(null);
|
|
145
|
+
const [programWorkflow, setProgramWorkflow] = useState<ProgramWorkflow>(null);
|
|
146
|
+
const { programs, programsLookupError, isLoadingPrograms } = usePrograms();
|
|
147
|
+
const { programStates, programStatesLookupError, isLoadingProgramStates, mutateProgramStates } = useProgramWorkStates(
|
|
148
|
+
programWorkflow?.uuid,
|
|
149
|
+
);
|
|
150
|
+
const [programWorkflows, setProgramWorkflows] = useState<Array<ProgramWorkflow>>([]);
|
|
151
|
+
|
|
152
|
+
const hasConceptChanged = selectedConcept && questionToEdit?.questionOptions?.concept !== selectedConcept?.uuid;
|
|
153
|
+
const [addInlineDate, setAddInlineDate] = useState(false);
|
|
154
|
+
|
|
155
|
+
const debouncedSearch = useMemo(() => {
|
|
156
|
+
return debounce((searchTerm: string) => setConceptToLookup(searchTerm), 500) as (searchTerm: string) => void;
|
|
157
|
+
}, []);
|
|
158
|
+
|
|
159
|
+
const handleConceptChange = (searchTerm: string) => {
|
|
160
|
+
if (searchTerm) {
|
|
161
|
+
debouncedSearch(searchTerm);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const handleIdentifierTypeSelect = (identifierType: PatientIdentifierType) => {
|
|
166
|
+
setPatientIdentifierTypeToLookup('');
|
|
167
|
+
setSelectedPatientIdentifierType(identifierType);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const handleAttributeTypeSelect = (attributeType: PersonAttributeType) => {
|
|
171
|
+
setPersonAttributeTypeToLookup('');
|
|
172
|
+
setSelectedPersonAttributeType(attributeType);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const handleConceptSelect = (concept: Concept) => {
|
|
176
|
+
setConceptToLookup('');
|
|
177
|
+
setSelectedAnswers([]);
|
|
178
|
+
setSelectedConcept(concept);
|
|
179
|
+
setConceptMappings(
|
|
180
|
+
concept?.mappings?.map((conceptMapping) => {
|
|
181
|
+
const data = conceptMapping.display.split(': ');
|
|
182
|
+
return {
|
|
183
|
+
relationship: conceptMapping.conceptMapType.display,
|
|
184
|
+
type: data[0],
|
|
185
|
+
value: data[1],
|
|
186
|
+
};
|
|
187
|
+
}),
|
|
188
|
+
);
|
|
189
|
+
setAnswersFromConcept(
|
|
190
|
+
concept?.answers?.map((answer) => ({
|
|
191
|
+
concept: answer?.uuid,
|
|
192
|
+
label: answer?.display,
|
|
193
|
+
})) ?? [],
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const questionIdExists = (idToTest: string) => {
|
|
198
|
+
if (questionToEdit?.id === idToTest) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const nestedIds = schema?.pages?.map((page) => {
|
|
203
|
+
return page?.sections?.map((section) => {
|
|
204
|
+
return section?.questions?.map((question) => {
|
|
205
|
+
return question.id;
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
const questionIds: Array<string> = flattenDeep(nestedIds);
|
|
211
|
+
|
|
212
|
+
return questionIds.includes(idToTest);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const handleUpdateQuestion = () => {
|
|
216
|
+
updateQuestion(questionIndex);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const handleProgramWorkflowChange = (selectedItem: ProgramWorkflow) => {
|
|
220
|
+
setProgramWorkflow(selectedItem);
|
|
221
|
+
void mutateProgramStates();
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
const handleProgramChange = (selectedItem: Program) => {
|
|
225
|
+
setSelectedProgram(selectedItem);
|
|
226
|
+
setProgramWorkflows(selectedItem?.allWorkflows);
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
const updateQuestion = (questionIndex: number) => {
|
|
230
|
+
let mappedAnswers = [];
|
|
231
|
+
|
|
232
|
+
// update changed concept based on details
|
|
233
|
+
if (!hasConceptChanged && selectedAnswers?.length) {
|
|
234
|
+
mappedAnswers = selectedAnswers.map((answer) => ({
|
|
235
|
+
concept: answer.id,
|
|
236
|
+
label: answer.text,
|
|
237
|
+
}));
|
|
238
|
+
} else if (hasConceptChanged && answersFromConcept.length === 0) {
|
|
239
|
+
mappedAnswers = [];
|
|
240
|
+
} else if (hasConceptChanged && answersFromConcept?.length > 0 && selectedAnswers?.length) {
|
|
241
|
+
mappedAnswers = selectedAnswers?.length
|
|
242
|
+
? selectedAnswers.map((answer) => ({
|
|
243
|
+
concept: answer.id,
|
|
244
|
+
label: answer.text,
|
|
245
|
+
}))
|
|
246
|
+
: questionToEdit.questionOptions.answers;
|
|
247
|
+
} else {
|
|
248
|
+
if (questionToEdit.type === 'programState') {
|
|
249
|
+
mappedAnswers = selectedProgramState.map((answer) => ({
|
|
250
|
+
value: answer.concept.uuid,
|
|
251
|
+
label: answer.concept.display,
|
|
252
|
+
}));
|
|
253
|
+
} else {
|
|
254
|
+
mappedAnswers = questionToEdit.questionOptions.answers;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
try {
|
|
259
|
+
const data = {
|
|
260
|
+
label: questionLabel ? questionLabel : questionToEdit.label,
|
|
261
|
+
type: questionType ? questionType : questionToEdit.type,
|
|
262
|
+
required: isQuestionRequired ? isQuestionRequired : /true/.test(questionToEdit?.required?.toString()),
|
|
263
|
+
id: questionId ? questionId : questionToEdit.id,
|
|
264
|
+
...(datePickerFormat && {
|
|
265
|
+
datePickerFormat: datePickerFormat,
|
|
266
|
+
}),
|
|
267
|
+
questionOptions: {
|
|
268
|
+
rendering: fieldType ? fieldType : questionToEdit.questionOptions.rendering,
|
|
269
|
+
concept: selectedConcept?.uuid ? selectedConcept.uuid : questionToEdit.questionOptions.concept,
|
|
270
|
+
conceptMappings: conceptMappings?.length ? conceptMappings : questionToEdit.questionOptions.conceptMappings,
|
|
271
|
+
answers: mappedAnswers,
|
|
272
|
+
...(questionType === 'patientIdentifier' && {
|
|
273
|
+
identifierType: selectedPatientIdentifierType
|
|
274
|
+
? selectedPatientIdentifierType['uuid']
|
|
275
|
+
: questionToEdit.questionOptions.identifierType,
|
|
276
|
+
}),
|
|
277
|
+
...(addObsComment && {
|
|
278
|
+
showComment: addObsComment
|
|
279
|
+
? addObsComment
|
|
280
|
+
: /true/.test(questionToEdit.questionOptions.showComment.toString()),
|
|
281
|
+
}),
|
|
282
|
+
...(addInlineDate && {
|
|
283
|
+
showDate: addInlineDate ? addInlineDate : /true/.test(questionToEdit.questionOptions.showDate.toString()),
|
|
284
|
+
}),
|
|
285
|
+
attributeType: selectedPersonAttributeType
|
|
286
|
+
? selectedPersonAttributeType['uuid']
|
|
287
|
+
: questionToEdit.questionOptions.attributeType,
|
|
288
|
+
...(selectedProgram && { programUuid: selectedProgram.uuid }),
|
|
289
|
+
...(programWorkflow && { workflowUuid: programWorkflow.uuid }),
|
|
290
|
+
},
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
schema.pages[pageIndex].sections[sectionIndex].questions[questionIndex] = data;
|
|
294
|
+
|
|
295
|
+
onSchemaChange({ ...schema });
|
|
296
|
+
setQuestionLabel('');
|
|
297
|
+
setQuestionId('');
|
|
298
|
+
setIsQuestionRequired(false);
|
|
299
|
+
setQuestionType(null);
|
|
300
|
+
setFieldType(null);
|
|
301
|
+
setSelectedConcept(null);
|
|
302
|
+
setConceptMappings([]);
|
|
303
|
+
setSelectedAnswers([]);
|
|
304
|
+
setAddObsComment(false);
|
|
305
|
+
setAddInlineDate(false);
|
|
306
|
+
|
|
307
|
+
showSnackbar({
|
|
308
|
+
title: t('questionEdited', 'Question edited'),
|
|
309
|
+
kind: 'success',
|
|
310
|
+
isLowContrast: true,
|
|
311
|
+
subtitle: t('questionEditedMessage', 'The question labelled "{{- questionLabel}}" has been edited.', {
|
|
312
|
+
questionLabel: questionToEdit.label,
|
|
313
|
+
}),
|
|
314
|
+
});
|
|
315
|
+
} catch (error) {
|
|
316
|
+
if (error instanceof Error) {
|
|
317
|
+
showSnackbar({
|
|
318
|
+
title: t('errorUpdatingQuestion', 'Error updating question'),
|
|
319
|
+
kind: 'error',
|
|
320
|
+
subtitle: error?.message,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
closeModal();
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
useEffect(() => {
|
|
329
|
+
const previousPrograms = programs.find((program) => program.uuid === questionToEdit.questionOptions.programUuid);
|
|
330
|
+
setSelectedProgram(previousPrograms);
|
|
331
|
+
}, [programs, questionToEdit.questionOptions.programUuid]);
|
|
332
|
+
|
|
333
|
+
useEffect(() => {
|
|
334
|
+
const previousWorkflow = selectedProgram?.allWorkflows.find(
|
|
335
|
+
(workflow) => workflow.uuid === questionToEdit.questionOptions.workflowUuid,
|
|
336
|
+
);
|
|
337
|
+
setProgramWorkflow(previousWorkflow);
|
|
338
|
+
setProgramWorkflows(selectedProgram?.allWorkflows);
|
|
339
|
+
}, [questionToEdit.questionOptions.workflowUuid, selectedProgram]);
|
|
340
|
+
|
|
341
|
+
useEffect(() => {
|
|
342
|
+
const previousStates = programWorkflow?.states.filter((state) =>
|
|
343
|
+
questionToEdit.questionOptions.answers.some((answer) => answer.value === state.concept.uuid),
|
|
344
|
+
);
|
|
345
|
+
setSelectedProgramState(previousStates);
|
|
346
|
+
}, [programWorkflow, questionToEdit.questionOptions.answers]);
|
|
347
|
+
|
|
348
|
+
return (
|
|
349
|
+
<>
|
|
350
|
+
<ModalHeader closeModal={closeModal} title={t('editQuestion', 'Edit question')} />
|
|
351
|
+
<Form className={styles.form} onSubmit={(event: React.SyntheticEvent) => event.preventDefault()}>
|
|
352
|
+
<ModalBody hasScrollingContent>
|
|
353
|
+
<Stack gap={5}>
|
|
354
|
+
<TextInput
|
|
355
|
+
defaultValue={questionToEdit.label}
|
|
356
|
+
id={questionToEdit.id}
|
|
357
|
+
labelText={t('questionLabel', 'Label')}
|
|
358
|
+
onChange={(event: React.ChangeEvent<HTMLInputElement>) => setQuestionLabel(event.target.value)}
|
|
359
|
+
required
|
|
360
|
+
/>
|
|
361
|
+
<TextInput
|
|
362
|
+
defaultValue={questionToEdit.id}
|
|
363
|
+
id="questionId"
|
|
364
|
+
invalid={questionIdExists(questionId)}
|
|
365
|
+
invalidText={t('questionIdExists', 'This question ID already exists in your schema')}
|
|
366
|
+
labelText={t(
|
|
367
|
+
'questionId',
|
|
368
|
+
'Question ID (prefer using camel-case for IDs). Each field should have a unique ID.',
|
|
369
|
+
)}
|
|
370
|
+
onChange={(event: React.ChangeEvent<HTMLInputElement>) => setQuestionId(event.target.value)}
|
|
371
|
+
placeholder={t(
|
|
372
|
+
'questionIdPlaceholder',
|
|
373
|
+
'Enter a unique ID e.g. "anaesthesiaType" for a question asking about the type of anaesthesia.',
|
|
374
|
+
)}
|
|
375
|
+
required
|
|
376
|
+
/>
|
|
377
|
+
<RadioButtonGroup
|
|
378
|
+
defaultSelected={/true/.test(questionToEdit?.required?.toString()) ? 'required' : 'optional'}
|
|
379
|
+
name="isQuestionRequired"
|
|
380
|
+
legendText={t(
|
|
381
|
+
'isQuestionRequiredOrOptional',
|
|
382
|
+
'Is this question a required or optional field? Required fields must be answered before the form can be submitted.',
|
|
383
|
+
)}
|
|
384
|
+
>
|
|
385
|
+
<RadioButton
|
|
386
|
+
id="questionIsNotRequired"
|
|
387
|
+
defaultChecked={true}
|
|
388
|
+
labelText={t('optional', 'Optional')}
|
|
389
|
+
onClick={() => setIsQuestionRequired(false)}
|
|
390
|
+
value="optional"
|
|
391
|
+
/>
|
|
392
|
+
<RadioButton
|
|
393
|
+
id="questionIsRequired"
|
|
394
|
+
defaultChecked={false}
|
|
395
|
+
labelText={t('required', 'Required')}
|
|
396
|
+
onClick={() => setIsQuestionRequired(true)}
|
|
397
|
+
value="required"
|
|
398
|
+
/>
|
|
399
|
+
</RadioButtonGroup>
|
|
400
|
+
<Select
|
|
401
|
+
defaultValue={questionToEdit.type}
|
|
402
|
+
onChange={(event: React.ChangeEvent<HTMLSelectElement>) =>
|
|
403
|
+
setQuestionType(event.target.value as QuestionType)
|
|
404
|
+
}
|
|
405
|
+
id={'questionType'}
|
|
406
|
+
invalidText={t('typeRequired', 'Type is required')}
|
|
407
|
+
labelText={t('questionType', 'Question type')}
|
|
408
|
+
required
|
|
409
|
+
>
|
|
410
|
+
{!questionType && <SelectItem text={t('chooseQuestionType', 'Choose a question type')} value="" />}
|
|
411
|
+
{questionTypes.map((questionType, key) => (
|
|
412
|
+
<SelectItem text={questionType} value={questionType} key={key} />
|
|
413
|
+
))}
|
|
414
|
+
</Select>
|
|
415
|
+
<Select
|
|
416
|
+
defaultValue={questionToEdit.questionOptions.rendering}
|
|
417
|
+
onChange={(event: React.ChangeEvent<HTMLSelectElement>) => setFieldType(event.target.value as RenderType)}
|
|
418
|
+
id="renderingType"
|
|
419
|
+
invalidText={t('validFieldTypeRequired', 'A valid field type value is required')}
|
|
420
|
+
labelText={t('renderingType', 'Rendering type')}
|
|
421
|
+
required
|
|
422
|
+
>
|
|
423
|
+
{!fieldType && <SelectItem text={t('chooseRenderingType', 'Choose a rendering type')} value="" />}
|
|
424
|
+
{fieldTypes.map((fieldType, key) => (
|
|
425
|
+
<SelectItem text={fieldType} value={fieldType} key={key} />
|
|
426
|
+
))}
|
|
427
|
+
</Select>
|
|
428
|
+
{fieldType === 'number' ? (
|
|
429
|
+
<>
|
|
430
|
+
<TextInput
|
|
431
|
+
id="min"
|
|
432
|
+
labelText="Min"
|
|
433
|
+
value={min || ''}
|
|
434
|
+
onChange={(event: React.ChangeEvent<HTMLInputElement>) => setMin(event.target.value)}
|
|
435
|
+
required
|
|
436
|
+
/>
|
|
437
|
+
<TextInput
|
|
438
|
+
id="max"
|
|
439
|
+
labelText="Max"
|
|
440
|
+
value={max || ''}
|
|
441
|
+
onChange={(event: React.ChangeEvent<HTMLInputElement>) => setMax(event.target.value)}
|
|
442
|
+
required
|
|
443
|
+
/>
|
|
444
|
+
</>
|
|
445
|
+
) : fieldType === 'textarea' ? (
|
|
446
|
+
<TextInput
|
|
447
|
+
id="textAreaRows"
|
|
448
|
+
labelText={t('rows', 'Rows')}
|
|
449
|
+
value={rows || ''}
|
|
450
|
+
onChange={(event: React.ChangeEvent<HTMLInputElement>) => setRows(event.target.value)}
|
|
451
|
+
required
|
|
452
|
+
/>
|
|
453
|
+
) : null}
|
|
454
|
+
|
|
455
|
+
{questionToEdit.type === 'encounterDatetime' ? (
|
|
456
|
+
<RadioButtonGroup
|
|
457
|
+
defaultSelected={questionToEdit?.datePickerFormat}
|
|
458
|
+
name="datePickerFormat"
|
|
459
|
+
legendText={t('datePickerType', 'The type of date picker to show ')}
|
|
460
|
+
>
|
|
461
|
+
<RadioButton
|
|
462
|
+
id="both"
|
|
463
|
+
labelText={t('calendarAndTimer', 'Calendar and timer')}
|
|
464
|
+
onClick={() => setDatePickerFormat(DatePickerType.both)}
|
|
465
|
+
value="both"
|
|
466
|
+
/>
|
|
467
|
+
<RadioButton
|
|
468
|
+
id="calendar"
|
|
469
|
+
labelText={t('calendarOnly', 'Calendar only')}
|
|
470
|
+
onClick={() => setDatePickerFormat(DatePickerType.calendar)}
|
|
471
|
+
value="calendar"
|
|
472
|
+
/>
|
|
473
|
+
<RadioButton
|
|
474
|
+
id="timer"
|
|
475
|
+
labelText={t('timerOnly', 'Timer only')}
|
|
476
|
+
onClick={() => setDatePickerFormat(DatePickerType.timer)}
|
|
477
|
+
value="timer"
|
|
478
|
+
/>
|
|
479
|
+
</RadioButtonGroup>
|
|
480
|
+
) : null}
|
|
481
|
+
|
|
482
|
+
{questionToEdit.type === 'patientIdentifier' && (
|
|
483
|
+
<div>
|
|
484
|
+
<FormLabel className={styles.label}>
|
|
485
|
+
{t('searchForBackingPatientIdentifierType', 'Search for a backing patient identifier type')}
|
|
486
|
+
</FormLabel>
|
|
487
|
+
{patientIdentifierNameLookupError ? (
|
|
488
|
+
<InlineNotification
|
|
489
|
+
kind="error"
|
|
490
|
+
lowContrast
|
|
491
|
+
className={styles.error}
|
|
492
|
+
title={t('errorFetchingPatientIdentifierTypes', 'Error fetching patient identifier types')}
|
|
493
|
+
subtitle={t('pleaseTryAgain', 'Please try again.')}
|
|
494
|
+
/>
|
|
495
|
+
) : null}
|
|
496
|
+
{isLoadingPatientidentifierName ? (
|
|
497
|
+
<InlineLoading className={styles.loader} description={t('loading', 'Loading') + '...'} />
|
|
498
|
+
) : (
|
|
499
|
+
<ComboBox
|
|
500
|
+
id="patientIdentifierTypeLookup"
|
|
501
|
+
items={patientIdentifierTypes}
|
|
502
|
+
itemToString={(item: PatientIdentifierType) => item?.display}
|
|
503
|
+
onChange={({ selectedItem }: { selectedItem: PatientIdentifierType }) => {
|
|
504
|
+
handleIdentifierTypeSelect(selectedItem);
|
|
505
|
+
}}
|
|
506
|
+
placeholder={t('choosePatientIdentifierType', 'Choose a patient identifier type')}
|
|
507
|
+
initialSelectedItem={patientIdentifierTypes.find(
|
|
508
|
+
(patientIdentifierType) =>
|
|
509
|
+
patientIdentifierType?.uuid === questionToEdit.questionOptions?.identifierType,
|
|
510
|
+
)}
|
|
511
|
+
/>
|
|
512
|
+
)}
|
|
513
|
+
</div>
|
|
514
|
+
)}
|
|
515
|
+
|
|
516
|
+
{questionToEdit.type === 'personAttribute' && (
|
|
517
|
+
<div>
|
|
518
|
+
<FormLabel className={styles.label}>
|
|
519
|
+
{t('searchForBackingPersonAttributeType', 'Search for a backing person attribute type')}
|
|
520
|
+
</FormLabel>
|
|
521
|
+
{personAttributeNameLookupError ? (
|
|
522
|
+
<InlineNotification
|
|
523
|
+
kind="error"
|
|
524
|
+
lowContrast
|
|
525
|
+
className={styles.error}
|
|
526
|
+
title={t('errorFetchingPersonAttributeTypes', 'Error fetching person attribute types')}
|
|
527
|
+
subtitle={t('pleaseTryAgain', 'Please try again.')}
|
|
528
|
+
/>
|
|
529
|
+
) : null}
|
|
530
|
+
{isLoadingPersonAttributeName ? (
|
|
531
|
+
<InlineLoading className={styles.loader} description={t('loading', 'Loading') + '...'} />
|
|
532
|
+
) : (
|
|
533
|
+
<ComboBox
|
|
534
|
+
id="personAttributeTypeLookup"
|
|
535
|
+
items={personAttributeTypes}
|
|
536
|
+
itemToString={(item: PersonAttributeType) => item?.display}
|
|
537
|
+
onChange={({ selectedItem }: { selectedItem: PersonAttributeType }) => {
|
|
538
|
+
handleAttributeTypeSelect(selectedItem);
|
|
539
|
+
}}
|
|
540
|
+
placeholder={t('choosePersonAttributeType', 'Choose a person attribute type')}
|
|
541
|
+
initialSelectedItem={personAttributeTypes.find(
|
|
542
|
+
(personAttributeType) =>
|
|
543
|
+
personAttributeType?.uuid === questionToEdit.questionOptions?.attributeType,
|
|
544
|
+
)}
|
|
545
|
+
/>
|
|
546
|
+
)}
|
|
547
|
+
</div>
|
|
548
|
+
)}
|
|
549
|
+
|
|
550
|
+
{questionToEdit.type === 'programState' && (
|
|
551
|
+
<Stack gap={5}>
|
|
552
|
+
{isLoadingPrograms && <SelectSkeleton />}
|
|
553
|
+
{programsLookupError ? (
|
|
554
|
+
<InlineNotification
|
|
555
|
+
kind="error"
|
|
556
|
+
lowContrast
|
|
557
|
+
className={styles.error}
|
|
558
|
+
title={t('errorFetchingPrograms', 'Error fetching programs')}
|
|
559
|
+
subtitle={t('pleaseTryAgain', 'Please try again.')}
|
|
560
|
+
/>
|
|
561
|
+
) : null}
|
|
562
|
+
{programs && (
|
|
563
|
+
<ComboBox
|
|
564
|
+
id="programLookup"
|
|
565
|
+
items={programs}
|
|
566
|
+
itemToString={(item: Program) => item?.name}
|
|
567
|
+
onChange={({ selectedItem }: { selectedItem: Program }) => {
|
|
568
|
+
handleProgramChange(selectedItem);
|
|
569
|
+
}}
|
|
570
|
+
placeholder={t('addProgram', 'Add program')}
|
|
571
|
+
selectedItem={selectedProgram}
|
|
572
|
+
titleText={t('program', 'Program')}
|
|
573
|
+
/>
|
|
574
|
+
)}
|
|
575
|
+
|
|
576
|
+
{selectedProgram && (
|
|
577
|
+
<ComboBox
|
|
578
|
+
id="programWorkflowLookup"
|
|
579
|
+
items={programWorkflows}
|
|
580
|
+
itemToString={(item: ProgramWorkflow) => item?.concept?.display ?? ''}
|
|
581
|
+
onChange={({ selectedItem }: { selectedItem: ProgramWorkflow }) =>
|
|
582
|
+
handleProgramWorkflowChange(selectedItem)
|
|
583
|
+
}
|
|
584
|
+
placeholder={t('addProgramWorkflow', 'Add program workflow')}
|
|
585
|
+
selectedItem={programWorkflow}
|
|
586
|
+
titleText={t('programWorkflow', 'Program workflow')}
|
|
587
|
+
/>
|
|
588
|
+
)}
|
|
589
|
+
{programWorkflow && (
|
|
590
|
+
<>
|
|
591
|
+
{isLoadingProgramStates && <SelectSkeleton />}
|
|
592
|
+
{programStatesLookupError && (
|
|
593
|
+
<InlineNotification
|
|
594
|
+
kind="error"
|
|
595
|
+
lowContrast
|
|
596
|
+
className={styles.error}
|
|
597
|
+
title={t('errorFetchingProgramState', 'Error fetching program state')}
|
|
598
|
+
subtitle={t('pleaseTryAgain', 'Please try again.')}
|
|
599
|
+
/>
|
|
600
|
+
)}
|
|
601
|
+
{programStates?.length > 0 && (
|
|
602
|
+
<MultiSelect
|
|
603
|
+
titleText={t('programState', 'Program state')}
|
|
604
|
+
id="programState"
|
|
605
|
+
items={programStates}
|
|
606
|
+
itemToString={(item: ProgramState) => (item ? item?.concept?.display : '')}
|
|
607
|
+
selectionFeedback="top-after-reopen"
|
|
608
|
+
onChange={(data: ProgramStateData) => setSelectedProgramState(data.selectedItems)}
|
|
609
|
+
selectedItems={selectedProgramState}
|
|
610
|
+
/>
|
|
611
|
+
)}
|
|
612
|
+
<div>
|
|
613
|
+
{selectedProgramState?.map((answer) => (
|
|
614
|
+
<Tag className={styles.tag} key={answer?.uuid} type={'blue'}>
|
|
615
|
+
{answer?.concept?.display}
|
|
616
|
+
</Tag>
|
|
617
|
+
))}
|
|
618
|
+
</div>
|
|
619
|
+
</>
|
|
620
|
+
)}
|
|
621
|
+
</Stack>
|
|
622
|
+
)}
|
|
623
|
+
|
|
624
|
+
{fieldType !== 'ui-select-extended' &&
|
|
625
|
+
questionToEdit.type !== 'encounterDatetime' &&
|
|
626
|
+
(questionType === 'obs' || (!questionType && questionToEdit.type === 'obs')) && (
|
|
627
|
+
<>
|
|
628
|
+
<div>
|
|
629
|
+
<FormLabel className={styles.label}>
|
|
630
|
+
{t('searchForBackingConcept', 'Search for a backing concept')}
|
|
631
|
+
</FormLabel>
|
|
632
|
+
{conceptNameLookupError ? (
|
|
633
|
+
<InlineNotification
|
|
634
|
+
kind="error"
|
|
635
|
+
lowContrast
|
|
636
|
+
className={styles.error}
|
|
637
|
+
title={t('errorFetchingConceptName', "Couldn't resolve concept name")}
|
|
638
|
+
subtitle={t(
|
|
639
|
+
'conceptDoesNotExist',
|
|
640
|
+
`The linked concept '{{conceptName}}' does not exist in your dictionary`,
|
|
641
|
+
{
|
|
642
|
+
conceptName: questionToEdit.questionOptions.concept,
|
|
643
|
+
},
|
|
644
|
+
)}
|
|
645
|
+
/>
|
|
646
|
+
) : null}
|
|
647
|
+
{isLoadingConceptName ? (
|
|
648
|
+
<InlineLoading className={styles.loader} description={t('loading', 'Loading') + '...'} />
|
|
649
|
+
) : (
|
|
650
|
+
<>
|
|
651
|
+
<Search
|
|
652
|
+
defaultValue={conceptName}
|
|
653
|
+
id="conceptLookup"
|
|
654
|
+
onClear={() => setSelectedConcept(null)}
|
|
655
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
656
|
+
handleConceptChange(e.target.value?.trim())
|
|
657
|
+
}
|
|
658
|
+
placeholder={t('searchConcept', 'Search using a concept name or UUID')}
|
|
659
|
+
required
|
|
660
|
+
size="md"
|
|
661
|
+
value={selectedConcept?.display}
|
|
662
|
+
/>
|
|
663
|
+
{(() => {
|
|
664
|
+
if (!conceptToLookup) return null;
|
|
665
|
+
if (isLoadingConcepts)
|
|
666
|
+
return (
|
|
667
|
+
<InlineLoading
|
|
668
|
+
className={styles.loader}
|
|
669
|
+
description={t('searching', 'Searching') + '...'}
|
|
670
|
+
/>
|
|
671
|
+
);
|
|
672
|
+
if (concepts?.length && !isLoadingConcepts) {
|
|
673
|
+
return (
|
|
674
|
+
<ul className={styles.conceptList}>
|
|
675
|
+
{concepts?.map((concept, index) => (
|
|
676
|
+
<li
|
|
677
|
+
role="menuitem"
|
|
678
|
+
className={styles.concept}
|
|
679
|
+
key={index}
|
|
680
|
+
onClick={() => handleConceptSelect(concept)}
|
|
681
|
+
>
|
|
682
|
+
{concept.display}
|
|
683
|
+
</li>
|
|
684
|
+
))}
|
|
685
|
+
</ul>
|
|
686
|
+
);
|
|
687
|
+
}
|
|
688
|
+
return (
|
|
689
|
+
<Layer>
|
|
690
|
+
<Tile className={styles.emptyResults}>
|
|
691
|
+
<span>
|
|
692
|
+
{t('noMatchingConcepts', 'No concepts were found that match')}{' '}
|
|
693
|
+
<strong>"{conceptToLookup}".</strong>
|
|
694
|
+
</span>
|
|
695
|
+
</Tile>
|
|
696
|
+
|
|
697
|
+
<div className={styles.oclLauncherBanner}>
|
|
698
|
+
{
|
|
699
|
+
<p className={styles.bodyShort01}>
|
|
700
|
+
{t('conceptSearchHelpText', "Can't find a concept?")}
|
|
701
|
+
</p>
|
|
702
|
+
}
|
|
703
|
+
<a
|
|
704
|
+
className={styles.oclLink}
|
|
705
|
+
target="_blank"
|
|
706
|
+
rel="noopener noreferrer"
|
|
707
|
+
href={'https://app.openconceptlab.org/'}
|
|
708
|
+
>
|
|
709
|
+
{t('searchInOCL', 'Search in OCL')}
|
|
710
|
+
<ArrowUpRight size={16} />
|
|
711
|
+
</a>
|
|
712
|
+
</div>
|
|
713
|
+
</Layer>
|
|
714
|
+
);
|
|
715
|
+
})()}
|
|
716
|
+
</>
|
|
717
|
+
)}
|
|
718
|
+
</div>
|
|
719
|
+
|
|
720
|
+
<Stack gap={5}>
|
|
721
|
+
{!hasConceptChanged &&
|
|
722
|
+
questionToEdit?.questionOptions.answers?.length &&
|
|
723
|
+
questionToEdit.type !== 'programState' ? (
|
|
724
|
+
<MultiSelect
|
|
725
|
+
className={styles.multiSelect}
|
|
726
|
+
direction="top"
|
|
727
|
+
id="selectAnswers"
|
|
728
|
+
itemToString={(item: Item) => item.text}
|
|
729
|
+
initialSelectedItems={questionToEdit?.questionOptions?.answers?.map((answer) => ({
|
|
730
|
+
id: answer.concept,
|
|
731
|
+
text: answer.label,
|
|
732
|
+
}))}
|
|
733
|
+
items={questionToEdit?.questionOptions?.answers?.map((answer) => ({
|
|
734
|
+
id: answer.concept,
|
|
735
|
+
text: answer.label ?? '',
|
|
736
|
+
}))}
|
|
737
|
+
onChange={({
|
|
738
|
+
selectedItems,
|
|
739
|
+
}: {
|
|
740
|
+
selectedItems: Array<{
|
|
741
|
+
id: string;
|
|
742
|
+
text: string;
|
|
743
|
+
}>;
|
|
744
|
+
}) => {
|
|
745
|
+
setAnswersChanged(true);
|
|
746
|
+
setSelectedAnswers(selectedItems.sort());
|
|
747
|
+
}}
|
|
748
|
+
size="md"
|
|
749
|
+
titleText={t('selectAnswersToDisplay', 'Select answers to display')}
|
|
750
|
+
/>
|
|
751
|
+
) : null}
|
|
752
|
+
{!hasConceptChanged &&
|
|
753
|
+
questionToEdit?.questionOptions?.answers?.length &&
|
|
754
|
+
!answersChanged &&
|
|
755
|
+
questionToEdit.type !== 'programState' ? (
|
|
756
|
+
<div>
|
|
757
|
+
{questionToEdit?.questionOptions?.answers?.map((answer) => (
|
|
758
|
+
<Tag className={styles.tag} key={answer?.concept} type={'blue'}>
|
|
759
|
+
{answer?.label}
|
|
760
|
+
</Tag>
|
|
761
|
+
))}
|
|
762
|
+
</div>
|
|
763
|
+
) : null}
|
|
764
|
+
{hasConceptChanged && answersFromConcept.length ? (
|
|
765
|
+
<MultiSelect
|
|
766
|
+
className={styles.multiSelect}
|
|
767
|
+
direction="top"
|
|
768
|
+
id="selectAnswers"
|
|
769
|
+
itemToString={(item: Item) => item.text}
|
|
770
|
+
items={answersFromConcept.map((answer) => ({
|
|
771
|
+
id: answer.concept,
|
|
772
|
+
text: answer.label,
|
|
773
|
+
}))}
|
|
774
|
+
onChange={({
|
|
775
|
+
selectedItems,
|
|
776
|
+
}: {
|
|
777
|
+
selectedItems: Array<{
|
|
778
|
+
id: string;
|
|
779
|
+
text: string;
|
|
780
|
+
}>;
|
|
781
|
+
}) => setSelectedAnswers(selectedItems.sort())}
|
|
782
|
+
size="md"
|
|
783
|
+
titleText={t('selectAnswersToDisplay', 'Select answers to display')}
|
|
784
|
+
/>
|
|
785
|
+
) : null}
|
|
786
|
+
{(hasConceptChanged ?? answersChanged) && (
|
|
787
|
+
<div>
|
|
788
|
+
{selectedAnswers.map((selectedAnswer) => (
|
|
789
|
+
<Tag className={styles.tag} key={selectedAnswer.id} type={'blue'}>
|
|
790
|
+
{selectedAnswer.text}
|
|
791
|
+
</Tag>
|
|
792
|
+
))}
|
|
793
|
+
</div>
|
|
794
|
+
)}
|
|
795
|
+
<RadioButtonGroup
|
|
796
|
+
defaultSelected={
|
|
797
|
+
/true/.test(questionToEdit?.questionOptions?.showComment?.toString()) ? 'yes' : 'no'
|
|
798
|
+
}
|
|
799
|
+
name="addObsComment"
|
|
800
|
+
legendText={t('addObsCommentTextBox', 'Add obs comment text box')}
|
|
801
|
+
>
|
|
802
|
+
<RadioButton
|
|
803
|
+
id="obsCommentYes"
|
|
804
|
+
defaultChecked={true}
|
|
805
|
+
labelText={t('yes', 'Yes')}
|
|
806
|
+
onClick={() => setAddObsComment(true)}
|
|
807
|
+
value="yes"
|
|
808
|
+
/>
|
|
809
|
+
<RadioButton
|
|
810
|
+
id="obsCommentNo"
|
|
811
|
+
defaultChecked={false}
|
|
812
|
+
labelText={t('no', 'No')}
|
|
813
|
+
onClick={() => setAddObsComment(false)}
|
|
814
|
+
value="no"
|
|
815
|
+
/>
|
|
816
|
+
</RadioButtonGroup>
|
|
817
|
+
|
|
818
|
+
<RadioButtonGroup
|
|
819
|
+
defaultSelected={
|
|
820
|
+
/true/.test(questionToEdit?.questionOptions?.showDate?.toString()) ? 'yes' : 'no'
|
|
821
|
+
}
|
|
822
|
+
name="addInlineDate"
|
|
823
|
+
legendText={t('addInlineDate', 'Add inline date')}
|
|
824
|
+
>
|
|
825
|
+
<RadioButton
|
|
826
|
+
id="inlineDateYes"
|
|
827
|
+
defaultChecked={true}
|
|
828
|
+
labelText={t('yes', 'Yes')}
|
|
829
|
+
onClick={() => setAddInlineDate(true)}
|
|
830
|
+
value="yes"
|
|
831
|
+
/>
|
|
832
|
+
<RadioButton
|
|
833
|
+
id="inlineDateNo"
|
|
834
|
+
defaultChecked={false}
|
|
835
|
+
labelText={t('no', 'No')}
|
|
836
|
+
onClick={() => setAddInlineDate(false)}
|
|
837
|
+
value="no"
|
|
838
|
+
/>
|
|
839
|
+
</RadioButtonGroup>
|
|
840
|
+
</Stack>
|
|
841
|
+
</>
|
|
842
|
+
)}
|
|
843
|
+
</Stack>
|
|
844
|
+
</ModalBody>
|
|
845
|
+
<ModalFooter>
|
|
846
|
+
<Button onClick={closeModal} kind="secondary">
|
|
847
|
+
{t('cancel', 'Cancel')}
|
|
848
|
+
</Button>
|
|
849
|
+
<Button onClick={handleUpdateQuestion}>
|
|
850
|
+
<span>{t('save', 'Save')}</span>
|
|
851
|
+
</Button>
|
|
852
|
+
</ModalFooter>
|
|
853
|
+
</Form>
|
|
854
|
+
</>
|
|
855
|
+
);
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
export default EditQuestionModal;
|